<br><br><div class="gmail_quote">On Mon, Mar 30, 2009 at 5:19 PM, Bogdan Sass <span dir="ltr"><<a href="mailto:bogdan.sass@catc.ro">bogdan.sass@catc.ro</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
La rularea valgrind pe un program care foloseste parser-ul din
tema, obtin urmatorul rezultat:<br>
<br>
# valgrind ./parser/CUseParser<br>
==29053== Memcheck, a memory error detector.<br>
==29053== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.<br>
==29053== Using LibVEX rev 1854, a library for dynamic binary
translation.<br>
==29053== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.<br>
==29053== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation
framework.<br>
==29053== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
al.<br>
==29053== For more details, rerun with: -v<br>
==29053==<br>
> test<br>
Command successfully read!<br>
==29053==<br>
==29053== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from
1)<br>
==29053== malloc/free: in use at exit: 4 bytes in 1 blocks.<br>
==29053== malloc/free: 10 allocs, 9 frees, 180 bytes allocated.<br>
==29053== For counts of detected errors, rerun with: -v<br>
==29053== searching for pointers to 1 not-freed blocks.<br>
==29053== checked 96,384 bytes.<br>
==29053==<br>
==29053== LEAK SUMMARY:<br>
==29053== definitely lost: 0 bytes in 0 blocks.<br>
==29053== possibly lost: 0 bytes in 0 blocks.<br>
<b>==29053== still reachable: 4 bytes in 1 blocks.</b><br>
==29053== suppressed: 0 bytes in 0 blocks.<br>
==29053== Rerun with --leak-check=full to see details of leaked memory.<br>
<br>
Din cate am reusit sa imi dau seama, este vorba de niste structuri
yylex care raman alocate la terminare. Ce nu imi dau seama din ce
citesc este daca acest lucru reprezinta sau nu o problema ("lost"
inteleg ce inseamna, dar "still reachable"?). <br>
<br>
Poate cineva sa imi explice ce inseamna acest "still reachable", si
daca este vorba de un memory leak sau doar de un comportament normal?<br>
<br>
</div></blockquote></div><br>Din cate pot specula pe baza a ceea ce scrie in 'man valgrind', s-ar putea sa fie blocuri la care sa fi gasit pointeri care pointeaza spre *interiorul* blocului de memorie, nu la inceput. S-ar putea de asemenea sa fie alarma falsa. "--leak-check=full" zice ceva in plus?<br>
<br>Cosmin.<br>