Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3260

Programming • Valgrind not displaying lines of codes even with -g flag

$
0
0
I have a serious memory leak in my program. I am trying to debug it with valgrind, but I cannot make it display lines of code for some specific leaks. There was a few leaks before that I fixed because I could see the lines of code. But the ones below cannot be seen. I suspect that the error is located in one of the libraries that my program is using, this is why I could not see the code. I tried to compile with the -static flag, but it cannot find the open gl library if I do so. Here is valgrind's output:

Code:

==11292== ==11292== HEAP SUMMARY:==11292==     in use at exit: 308,693 bytes in 3,297 blocks==11292==   total heap usage: 149,643 allocs, 146,346 frees, 2,715,768,682 bytes allocated==11292== ==11292== 112 (56 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 2,196 of 2,235==11292==    at 0x48455EF: calloc (vg_replace_malloc.c:1328)==11292==    by 0x6D90C8F: ???==11292==    by 0x68CAD5B: ???==11292==    by 0x68B3C50: ???==11292==    by 0x68B3E14: ???==11292==    by 0x6868769: ???==11292==    by 0x686B464: ???==11292==    by 0x6866138: ???==11292==    by 0x68162BF: ???==11292==    by 0x68535BB: ???==11292==    by 0x684FE87: ???==11292==    by 0x67E7C36: ???==11292== ==11292== 5,323 bytes in 255 blocks are definitely lost in loss record 2,229 of 2,235==11292==    at 0x48407B4: malloc (vg_replace_malloc.c:381)==11292==    by 0x49F4969: strdup (strdup.c:42)==11292==    by 0x57BE7BE: ???==11292==    by 0x57BE574: ???==11292==    by 0x572C486: ???==11292==    by 0x572CD56: ???==11292==    by 0x56BB098: ???==11292==    by 0x56BC377: ???==11292==    by 0x198508: makeContextCurrentGLX (in /mnt/data/git/glymmer/demo)==11292==    by 0x18F277: glfwMakeContextCurrent (in /mnt/data/git/glymmer/demo)==11292==    by 0x18F5E2: _glfwRefreshContextAttribs (in /mnt/data/git/glymmer/demo)==11292==    by 0x1A5025: _glfwCreateWindowX11 (in /mnt/data/git/glymmer/demo)==11292== ==11292== LEAK SUMMARY:==11292==    definitely lost: 5,379 bytes in 256 blocks==11292==    indirectly lost: 56 bytes in 1 blocks==11292==      possibly lost: 0 bytes in 0 blocks==11292==    still reachable: 303,258 bytes in 3,040 blocks==11292==         suppressed: 0 bytes in 0 blocks==11292== Reachable blocks (those to which a pointer was found) are not shown.==11292== To see them, rerun with: --leak-check=full --show-leak-kinds=all==11292== ==11292== For lists of detected and suppressed errors, rerun with: -s==11292== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Anybody have a clue on how to debug this?

Statistics: Posted by larienna — 2024-12-05 07:31 — Replies 0 — Views 23



Viewing all articles
Browse latest Browse all 3260

Trending Articles