[Freeciv-Dev] Re: (PR#6605) memory leak in server (readline)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, Oct 22, 2003 at 06:21:44AM -0700, Jason Short wrote:
>
> ==8657== 40 bytes in 2 blocks are definitely lost in loss record 5 of 18
> ==8657== at 0x40160749: malloc (vg_clientfuncs.c:103)
> ==8657== by 0x40310A21: xmalloc (in /usr/lib/libreadline.so.4.3)
> ==8657== by 0x40313EC2: sh_set_lines_and_columns (in
> /usr/lib/libreadline.so.4.3)
> ==8657== by 0x4030D3B2: _rl_get_screen_size (in
> /usr/lib/libreadline.so.4.3)
> ==8657== by 0x4030D79D: _rl_init_terminal_io (in
> /usr/lib/libreadline.so.4.3)==8657== by 0x402FBBEA:
> readline_initialize_everything (in /usr/lib/libreadline.so.4.3)
> ==8657== by 0x402FBB54: rl_initialize (in /usr/lib/libreadline.so.4.3)
> ==8657== by 0x809C540: sniff_packets (sernet.c:357)
> ==8657== by 0x804FAAC: main_loop (srv_main.c:1480)
> ==8657== by 0x80503E4: srv_loop (srv_main.c:1812)
> ==8657== by 0x804FE68: srv_main (srv_main.c:1599)
> ==8657== by 0x804A27B: main (civserver.c:154)
> ==8657== by 0x403A04EC: __libc_start_main (in /lib/libc-2.3.2.so)
> ==8657== by 0x8049C60: (within /tmp/jshort/freeciv/server/civserver)
>
> Of course this leak only happens once.
IIRC there are other places where we loose one-time memory to 3rd
party libraries.
> It seems this is a bug in readline, or are we missing some
> uninitialize function?
It doesn't look like readline have an uninitialize function.
From
http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Modules/readline.c?only_with_tag=HEAD&view=markup:
/* Initialize (allows .inputrc to override)
*
* XXX: A bug in the readline-2.2 library causes a memory leak
* inside this function. Nothing we can do about it.
*/
rl_initialize();
This also confirms this.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Any sufficiently advanced technology is indistinguishable from magic."
-- Arthur C. Clarke
|
|