bug-ncurses
[Top][All Lists]
Advanced

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

Re: ncurses seems to be leaking memory?


From: Benno Schulenberg
Subject: Re: ncurses seems to be leaking memory?
Date: Wed, 17 Jun 2020 10:07:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Op 17-06-2020 om 01:43 schreef Thomas Dickey:
> https://invisible-island.net/ncurses/NEWS.html#t20191214
> 
> 20191214
>         + add exit_curses() and exit_terminfo() to replace internal symbols 
> for
>         leak-checking.
>  
> Those functions are provided whether or not --disable-leaks is configured
> (but will only _help_ with leak-checking if --disable-leaks is configured).

Nano was not seeing exit_curses() either.  Grepping config.log for
"include/ncurses" showed -I/usr/local/include/ncursesw most of the time,
but then near the end it started adding -I/usr/include/ncursesw before it,
and then puts this in the Makefiles:

CPPFLAGS='-D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw
-I/usr/local/include/ncursesw'
NCURSESW_CFLAGS='-D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw'

Nano's configure is doing something wrong.  If I edit the Makefiles to
make them refer only to /usr/local/include/ncursesw, then the compilation
does find exit_curses().  And valgrind reports only this:

==15009== 24 bytes in 1 blocks are definitely lost in loss record 42 of 492
==15009==    at 0x4C2FB0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15009==    by 0x51CC483: tsearch (tsearch.c:338)
==15009==    by 0x4E77BFE: _nc_reset_color_pair (new_pair.c:217)
==15009==    by 0x4E58E88: _nc_init_pair (lib_color.c:654)
==15009==    by 0x4E590E1: init_pair_sp (lib_color.c:694)
==15009==    by 0x4E59102: init_pair (lib_color.c:701)
==15009==    by 0x4E7772C: assume_default_colors_sp (lib_dft_fgbg.c:86)
==15009==    by 0x4E7776F: use_default_colors_sp (lib_dft_fgbg.c:51)
==15009==    by 0x4E77787: use_default_colors (lib_dft_fgbg.c:58)
==15009==    by 0x405E6B: set_interface_colorpairs (color.c:49)
==15009==    by 0x413F43: main (nano.c:2282)

>> ../test/picsmap.c:965:11: warning: implicit declaration of function 
>> ‘strcasecmp’
>> [-Wimplicit-function-declaration]
>>       if (!strcasecmp(name, rgb_table[n].name)) {
>>            ^~~~~~~~~~

The warning isn't there any more on subsequent compiles.  :|

>> In file included from ./nano.h:89:
>> In file included from /usr/include/ncursesw/curses.h:2076:
>> /usr/local/include/ncursesw/unctrl.h:61:54: error: conflicting types for 
>> 'unctrl'
>> NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, 
>> chtype);
>>                                                      ^
>> /usr/local/include/ncursesw/unctrl.h:58:38: note: previous declaration is 
>> here
>> NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype);
>>
>> I work around that by editing that header file and changing the "#if 1"
>> on line 60 to "#if 0".
> 
> What configure-options are you using?

The ones that were near the beginning of the email:

  ./configure -C --enable-widec --with-shared --prefix=/usr/local 
--disable-leaks

Benno


[Not subscribed, please CC.]

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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