Hey! Investigating ncurses a little (the leak checking code doesn't build for me on interix-prefix), i stumbled over a seemingly inverse logic. the --enable-leaks switch enables leak checking, which i'd expect to be there in the debug-build only, not the !debug one. changing this solves it for me: - $(use_enable !debug leaks) \ + $(use_enable debug leaks) \ is this really a bug, or is it intended?
It doesn't really make any difference since the configure script has a bug and treats --disable-leaks the same way as --enable-leaks...
that's why i fix it in the ebuild: sed -i '/with_no_leaks=yes/s:=.*:=$enableval:' configure #305889 i imagine the negative variable naming messed up my head. "--disable-leaks" really means "disable leak checking".
what about this bug? anybody removing the '!', so leak checking is enabled in debug builds only? it's not so much of a problem for me, because i disabled it in the prefix copy of the ebuild for interix completely, but still... i think it is wrong as it is.
should be included with 5.7-r6
Just ran across this today, it appears it is still backwards. According to curs_memleaks(3x) the _nc_freeall() and _nc_free_and_exit() are normally not available non-standard functions and that they should only be available if ncurses is configured at build time with --disable-leaks. Currently the ebuild has: $(use_enable debug leaks) Which has the effect that if ncurses is built without the debug use flags (most builds), --disable-leaks is passed and the functions are included. If you build with the debug use flag, --enable-leaks is passed and the functions aren't included. This still seems backwards to me.
I Should add that the symbols _nc_free_and_exit and _nc_freeall are present regardless of whether --disable-leaks or --enable-leaks is passed. However, currently only if ncurses is built with --disable-links do the functions actually work as advertised. With USE=debug emerge -1 sys-libs/ncurses: $ valgrind ./eltest ==10886== Memcheck, a memory error detector ==10886== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==10886== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==10886== Command: ./eltest ==10886== ?quit 0 "quit" ==10886== ==10886== HEAP SUMMARY: ==10886== in use at exit: 14,784 bytes in 13 blocks ==10886== total heap usage: 187 allocs, 174 frees, 86,785 bytes allocated ==10886== ==10886== LEAK SUMMARY: ==10886== definitely lost: 0 bytes in 0 blocks ==10886== indirectly lost: 0 bytes in 0 blocks ==10886== possibly lost: 0 bytes in 0 blocks ==10886== still reachable: 14,784 bytes in 13 blocks ==10886== suppressed: 0 bytes in 0 blocks ==10886== Rerun with --leak-check=full to see details of leaked memory ==10886== ==10886== For counts of detected and suppressed errors, rerun with: -v ==10886== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) With USE=-debug emerge -1 sys-libs/ncurses: $ valgrind ./eltest ==4238== Memcheck, a memory error detector ==4238== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==4238== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==4238== Command: ./eltest ==4238== ?quit 0 "quit" ==4238== ==4238== HEAP SUMMARY: ==4238== in use at exit: 0 bytes in 0 blocks ==4238== total heap usage: 188 allocs, 188 frees, 90,455 bytes allocated ==4238== ==4238== All heap blocks were freed -- no leaks are possible ==4238== ==4238== For counts of detected and suppressed errors, rerun with: -v ==4238== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
(In reply to Arthur Taylor from comment #5) not exactly. it was fixed in 5.7-r6 as i claimed, but then it was rebroken in the 5.8 ebuild as the sed line was dropped: sed -i '/with_no_leaks=yes/s:=.*:=$enableval:' configure #305889 but the configure flag wasn't re-inverted to match the sed.
Commit message: Fix the inverted leak flag http://sources.gentoo.org/sys-libs/ncurses/ncurses-5.9-r4.ebuild?rev=1.1