Hi,

valgrind reports that there is possible lost. But it doesn't seem
there should be any lost. Why valgrind reports it as possible lost? Is
there a way to remove such 'possible lost' from the valgrind report?


/tmp$ cat main.cpp
#include <stdexcept>

int main() {
  throw std::runtime_error("xx");
}
/tmp$ g++ main.cpp
/tmp$ valgrind ./a.out
==32312== Memcheck, a memory error detector
==32312== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==32312== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==32312== Command: ./a.out
==32312==
--32312-- ./a.out:
--32312-- dSYM directory is missing; consider using --dsymutil=yes
terminate called after throwing an instance of 'std::runtime_error'
  what():  xx
==32312==
==32312== Process terminating with default action of signal 6 (SIGABRT)
==32312==    at 0x1001500B6: __kill (in /usr/lib/libSystem.B.dylib)
==32312==    by 0x10006F5D1: __gnu_cxx::__verbose_terminate_handler()
(in /usr/lib/libstdc++.6.0.9.dylib)
==32312==    by 0x10006DAE0: __cxxabiv1::__terminate(void (*)()) (in
/usr/lib/libstdc++.6.0.9.dylib)
==32312==    by 0x10006DB15: std::terminate() (in
/usr/lib/libstdc++.6.0.9.dylib)
==32312==    by 0x10006DBFB: __cxa_throw (in /usr/lib/libstdc++.6.0.9.dylib)
==32312==    by 0x100000DF7: main (in ./a.out)
==32312==
==32312== HEAP SUMMARY:
==32312==     in use at exit: 259 bytes in 4 blocks
==32312==   total heap usage: 5 allocs, 1 frees, 282 bytes allocated
==32312==
==32312== LEAK SUMMARY:
==32312==    definitely lost: 0 bytes in 0 blocks
==32312==    indirectly lost: 0 bytes in 0 blocks
==32312==      possibly lost: 27 bytes in 1 blocks
==32312==    still reachable: 232 bytes in 3 blocks
==32312==         suppressed: 0 bytes in 0 blocks
==32312== Rerun with --leak-check=full to see details of leaked memory
==32312==
==32312== For counts of detected and suppressed errors, rerun with: -v
==32312== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Abort trap


-- 
Regards,
Peng

------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to