[so] valgrind
Andrei Ciuca
andrei.ciuca at gmail.com
Thu Nov 1 11:51:02 EET 2007
Valgrind imi tot baga outputul asta :
==2737== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
==2737== malloc/free: in use at exit: 17 bytes in 1 blocks.
==2737== malloc/free: 12 allocs, 11 frees, 209 bytes allocated.
==2737== For counts of detected errors, rerun with: -v
==2737== searching for pointers to 1 not-freed blocks.
==2737== checked 108,128 bytes.
==2737==
==2737== 17 bytes in 1 blocks are possibly lost in loss record 1 of 1
==2737== at 0x401B8C7: operator new(unsigned) (vg_replace_malloc.c:163)
==2737== by 0x40B0C6A: std::string::_Rep::_S_create(unsigned, unsigned,
std::allocator<char> const&) (in /usr/lib/libstdc++.so.6.0.8)
==2737== by 0x40B1BE9: std::string::_Rep::_M_clone(std::allocator<char>
const&, unsigned) (in /usr/lib/libstdc++.so.6.0.8)
==2737== by 0x40B35E7: std::string::reserve(unsigned) (in
/usr/lib/libstdc++.so.6.0.8)
==2737== by 0x4089126: std::basic_istream<char, std::char_traits<char> >&
std::getline<char, std::char_traits<char>, std::allocator<char>
>(std::basic_istream<char, std::char_traits<char> >&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >&,
char) (in /usr/lib/libstdc++.so.6.0.8)
==2737== by 0x40A2178: std::basic_istream<char, std::char_traits<char> >&
std::getline<char, std::char_traits<char>, std::allocator<char>
>(std::basic_istream<char, std::char_traits<char> >&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (in
/usr/lib/libstdc++.so.6.0.8)
==2737== by 0x804A7F1: main (tema1.cpp:877)
==2737==
==2737== LEAK SUMMARY:
==2737== definitely lost: 0 bytes in 0 blocks.
==2737== possibly lost: 17 bytes in 1 blocks.
==2737== still reachable: 0 bytes in 0 blocks.
==2737== suppressed: 0 bytes in 0 blocks.
Despre "possibly lost" memory am gasit pe net asta : ""possibly lost" means
your program is probably leaking memory, unless you're doing funny things
with pointers."
La ce se refera cand spune "funny things with pointers" ... pentru ca ma uit
in codul sursa de ceva timp ... am dezalocat tot ce se putea dezaloca si tot
asta scoate ... am ajuns si la faza in care am comentat partile programului
care alocau ceva si am rulat executand doar comanda exit (eroarea de mai sus
o scoate fara sa am practic malloc/calloc/free in program ... in afara de ce
este in parser , si dau free_parse_memory() inainte sa ies ).
Sugestii ?
Se depuncteaza daca o las asa ? ;;) :D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/so/attachments/20071101/9e9c4220/attachment.html
More information about the so
mailing list