bug-ncurses
[Top][All Lists]
Advanced

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

Memleaks?


From: Michael Vetter
Subject: Memleaks?
Date: Fri, 21 Jun 2024 12:25:58 +0200
User-agent: Mozilla Thunderbird

I ran valgrind on my program and saw a couple of memleaks. I suspected that I'm using ncurses wrong but couldn't find the cause.

I then went on to download ncurses 6.3, compiled it and ran: `valgrind --leak-check=full ./test/firstlast`

It interestingly showed me leaks as well.

```

==15006== HEAP SUMMARY:
==15006==     in use at exit: 111,572 bytes in 264 blocks
==15006==   total heap usage: 275 allocs, 11 frees, 120,214 bytes allocated
==15006==
==15006== 9 bytes in 1 blocks are possibly lost in loss record 8 of 74
==15006==    at 0x4845794: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==15006==    by 0x491C75D: strdup (in /usr/lib64/libc.so.6)
==15006==    by 0x4140F5: tparm_setup (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x416EA6: _nc_tiparm (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x406BDE: _nc_mvcur_init_sp (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x4077E7: newterm_sp (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x407A44: newterm (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x4056A0: initscr (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x402462: main (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast)
==15006==
==15006== 24 bytes in 1 blocks are possibly lost in loss record 27 of 74
==15006==    at 0x4845794: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==15006==    by 0x4984CA5: tsearch (in /usr/lib64/libc.so.6)
==15006==    by 0x414110: tparm_setup (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x416EA6: _nc_tiparm (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x406BDE: _nc_mvcur_init_sp (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x4077E7: newterm_sp (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x407A44: newterm (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x4056A0: initscr (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x402462: main (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast)
==15006==
==15006== 168 bytes in 1 blocks are possibly lost in loss record 53 of 74
==15006==    at 0x484CA2F: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==15006==    by 0x41406E: tparm_setup (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x416EA6: _nc_tiparm (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x406BDE: _nc_mvcur_init_sp (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x4077E7: newterm_sp (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x407A44: newterm (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x4056A0: initscr (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast) ==15006==    by 0x402462: main (in /home/michael/Downloads/browser/ncurses/ncurses-6.3/test/firstlast)
==15006==
==15006== LEAK SUMMARY:
==15006==    definitely lost: 0 bytes in 0 blocks
==15006==    indirectly lost: 0 bytes in 0 blocks
==15006==      possibly lost: 201 bytes in 3 blocks
==15006==    still reachable: 111,371 bytes in 261 blocks
==15006==         suppressed: 0 bytes in 0 blocks

```

Am I using valgrind/ncurses wrong? Are there memleaks in ncurses? Any hints/help is appreciated :)

Best,

Michael




reply via email to

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