bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

memory leak - tgetent - ncurses 5.6


From: Maciek Borzecki
Subject: memory leak - tgetent - ncurses 5.6
Date: Tue, 7 Apr 2009 23:51:07 +0200

Hi,

I'm writing a small application that's using libedit, which internally
calls ncurses.
Monitoring it with valgrind, I keep observing the memory leaks coming
from tgetent as follows (see attachment for full log):

==4683== 44 bytes in 1 blocks are still reachable in loss record 3 of 7
==4683==    at 0x4023DE2: calloc (vg_replace_malloc.c:397)
==4683==    by 0x4083456: _nc_read_termtype (in /lib/libncurses.so.5.6)
==4683==    by 0x4083CC4: _nc_read_file_entry (in /lib/libncurses.so.5.6)
==4683==    by 0x4083E65: _nc_read_entry (in /lib/libncurses.so.5.6)
==4683==    by 0x407FA92: _nc_setupterm (in /lib/libncurses.so.5.6)
==4683==    by 0x40802B7: tgetent (in /lib/libncurses.so.5.6)
==4683==    by 0x404E649: (within /usr/lib/libedit.so.2.11)
==4683==    by 0x404F0D6: el_init (in /usr/lib/libedit.so.2.11)
==4683==    by 0x8049E03: setup_el (uish.c:58)
==4683==    by 0x804A1C8: uish_init (uish.c:167)
==4683==    by 0x8049BF6: main (main.c:106)
==4683==
==4683==
==4683== 78 bytes in 1 blocks are still reachable in loss record 4 of 7
==4683==    at 0x4023DE2: calloc (vg_replace_malloc.c:397)
==4683==    by 0x40834CD: _nc_read_termtype (in /lib/libncurses.so.5.6)
==4683==    by 0x4083CC4: _nc_read_file_entry (in /lib/libncurses.so.5.6)
==4683==    by 0x4083E65: _nc_read_entry (in /lib/libncurses.so.5.6)
==4683==    by 0x407FA92: _nc_setupterm (in /lib/libncurses.so.5.6)
==4683==    by 0x40802B7: tgetent (in /lib/libncurses.so.5.6)
==4683==    by 0x404E649: (within /usr/lib/libedit.so.2.11)
==4683==    by 0x404F0D6: el_init (in /usr/lib/libedit.so.2.11)
==4683==    by 0x8049E03: setup_el (uish.c:58)
==4683==    by 0x804A1C8: uish_init (uish.c:167)
==4683==    by 0x8049BF6: main (main.c:106)
==4683==
==4683==
==4683== 172 bytes in 1 blocks are still reachable in loss record 5 of 7
==4683==    at 0x4023DE2: calloc (vg_replace_malloc.c:397)
==4683==    by 0x407FA6C: _nc_setupterm (in /lib/libncurses.so.5.6)
==4683==    by 0x40802B7: tgetent (in /lib/libncurses.so.5.6)
==4683==    by 0x404E649: (within /usr/lib/libedit.so.2.11)
==4683==    by 0x404F0D6: el_init (in /usr/lib/libedit.so.2.11)
==4683==    by 0x8049E03: setup_el (uish.c:58)
==4683==    by 0x804A1C8: uish_init (uish.c:167)
==4683==    by 0x8049BF6: main (main.c:106)
==4683==
==4683==
==4683== 565 bytes in 1 blocks are still reachable in loss record 6 of 7
==4683==    at 0x4025D2E: malloc (vg_replace_malloc.c:207)
==4683==    by 0x4083376: _nc_read_termtype (in /lib/libncurses.so.5.6)
==4683==    by 0x4083CC4: _nc_read_file_entry (in /lib/libncurses.so.5.6)
==4683==    by 0x4083E65: _nc_read_entry (in /lib/libncurses.so.5.6)
==4683==    by 0x407FA92: _nc_setupterm (in /lib/libncurses.so.5.6)
==4683==    by 0x40802B7: tgetent (in /lib/libncurses.so.5.6)
==4683==    by 0x404E649: (within /usr/lib/libedit.so.2.11)
==4683==    by 0x404F0D6: el_init (in /usr/lib/libedit.so.2.11)
==4683==    by 0x8049E03: setup_el (uish.c:58)
==4683==    by 0x804A1C8: uish_init (uish.c:167)
==4683==    by 0x8049BF6: main (main.c:106)

Digging through changelogs I noticed that memory leaks should be
'reduced' since 5.6. Is this the reduced effect that I'm seeing?
I'll try to track down this further, perhaps the problem is ubuntu
related (canonical's custom patches or whatever).
Looking into libedit's code, the buffer for tgetent is allocated
however, it seems not to be used (actually manual page states that
tgetent ignores buffer pointer).

Cheers,
maciek

Attachment: leak.log
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]