|
From: Alexander F. <ale...@gm...> - 2005-07-07 15:14:43
|
Hi, I'm using valgrind 2.4.0 on RH9 Linux (thank you!) and it keeps=20 reporting, that I have 1 memory leak in my C-program: =3D=3D17058=3D=3D 260 bytes in 1 blocks are definitely lost in loss record = 1 of 2 =3D=3D17058=3D=3D at 0x1B90359D: malloc (vg_replace_malloc.c:130) =3D=3D17058=3D=3D by 0x80497FE: new_node (pref.c:514) =3D=3D17058=3D=3D by 0x80499A2: copy_node (pref.c:598) =3D=3D17058=3D=3D by 0x8049E45: accept_new (pref.c:739) =3D=3D17058=3D=3D by 0x8048FE9: main (pref.c:299) =3D=3D17058=3D=3D=20 =3D=3D17058=3D=3D LEAK SUMMARY: =3D=3D17058=3D=3D definitely lost: 260 bytes in 1 blocks. =3D=3D17058=3D=3D possibly lost: 0 bytes in 0 blocks. =3D=3D17058=3D=3D still reachable: 4420 bytes in 17 blocks. =3D=3D17058=3D=3D suppressed: 0 bytes in 0 blocks. I'm trying already since few days, but still can't find that leak. In the new_node() function mentioned above I malloc()=20 a structure (about 20 times) and keep the track to it in a=20 singly-linked tail queue. Since valgrind probably keeps track to all malloc()ed areas, is it possible to make it print the content of that lost area? Then I could identify, which particular node of the list gets lost. I've tried calling my program with "valgrind --leak-check=3Dyes=20 --db-attach=3Dyes ./myprog", but it doesn't ask to attach... Regards Alex |