Commit 746430cd authored by David Byers's avatar David Byers

Testing (unix.exp)

        Check for memory leaks on all normal exits

Bug fixes
        Plugged memory leak in destruction of a client connection.

Documentation
        Documented that parse data needs to be freed in
        prot_a_destruct.
parent fc61ca6e
1999-05-21 David Byers <davby@ida.liu.se>
* doc/lyskomd.texi (Adding New Input Types): Document the fact
that you have to free data in prot_a_destruct as well.
* src/server/prot-a.c (prot_a_destruct): Free num_lists in the
client structure.
1999-05-21 Per Cederqvist <ceder@paragon.signum.se>
Don't lock the database when dbck is running in read-only mode.
......
......@@ -40,15 +40,19 @@ Before the next release
** Testing
*** Statement coverage tests for the aux-item-def parser
David.
** Known Bugs
** Improvements
* High priority, but they can wait until after the next release.
** Add leaks tests for all situtations when the client gets
disconnected from the server.
** Statement coverage tests for the aux-item-def parser
David.
** Uppmärkningen i texiinfofilerna
** Consider changing many paths so that it is safe to install lyskomd
......
\input texinfo
@c $Id: lyskomd.texi,v 1.19 1999/05/21 11:31:59 byers Exp $
@c $Id: lyskomd.texi,v 1.20 1999/05/21 12:40:59 byers Exp $
@c %**start of header
@setfilename lyskomd.info
@include version.texi
......@@ -1763,6 +1763,9 @@ existing field. It's more trouble than it's worth.
@item server/connection.c
Free the contents of the field in @code{free_parsed()}.
@item server/prot-a.c
Free the contents of the field in @code{prot_a_destruct()}.
@item server/internal-connections.c
Initialize the contents of the field in @code{init_connection()}.
......
/*
* $Id: prot-a.c,v 0.58 1999/05/21 11:36:51 byers Exp $
* $Id: prot-a.c,v 0.59 1999/05/21 12:41:08 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -32,7 +32,7 @@
#endif
static const char *
rcsid = "$Id: prot-a.c,v 0.58 1999/05/21 11:36:51 byers Exp $";
rcsid = "$Id: prot-a.c,v 0.59 1999/05/21 12:41:08 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -358,6 +358,10 @@ prot_a_destruct(Connection *conn)
sfree(conn->misc_info_list.misc);
conn->misc_info_list.misc = NULL;
conn->num_list.length = 0;
sfree(conn->num_list.data);
conn->num_list.data = NULL;
sfree(conn->c_local_text_no_p);
}
......
......@@ -438,6 +438,32 @@ proc lyskomd_fail_start {{aux_item_conf_file "" }
}
}
proc check_memory_usage {} {
set allocated_strings 0
set allocated_blocks 0
set f [ open "etc/memory-usage" ]
while { [ gets $f line] >= 0 } {
if { [regexp "Allocated blocks .grand total." $line] } {
set allocated_blocks [lindex "$line" [expr [llength "$line"] - 1]]
} elseif { [regexp "Allocated strings" $line] } {
set allocated_strings [lindex "$line" [expr [llength "$line"] - 1]]
}
}
close $f
if { $allocated_blocks != 0 } {
fail "Allocated blocks on exit"
} else {
pass "Allocated blocks on exit"
}
if { $allocated_strings != 0 } {
fail "Allocated strings on exit"
} else {
pass "Allocated strings on exit"
}
}
proc lyskomd_death {} {
global spawn_id
global server_id
......@@ -454,6 +480,7 @@ proc lyskomd_death {} {
eof { pass "$test"; wait }
}
system "cat etc/memory-usage >> usage.all"
check_memory_usage
}
proc client_start {nr} {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment