After a SIGABRT, wouldn't you expect a bunch of memory leaks?

Or if you just want to get rid of the possibly lost messages, try
--show-possibly-lost=no

On Wed, Sep 7, 2011 at 6:07 AM, Peng Yu <[email protected]> wrote:
> On Wed, Sep 7, 2011 at 2:42 AM, Tom Hughes <[email protected]> wrote:
>> On 07/09/11 07:17, Peng Yu wrote:
>>
>>> 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?
>>
>> Well if you do what it says and use "-leak-check=full" then you might find
>> out where the leak is coming from.
>
> Here is the output with "-leak-check=full". How can I tell that there
> is definitely no memory leak?
>
>
> /tmp$ valgrind --leak-check=full ./a.out
> ==40738== Memcheck, a memory error detector
> ==40738== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
> ==40738== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
> ==40738== Command: ./a.out
> ==40738==
> --40738-- ./a.out:
> --40738-- dSYM directory is missing; consider using --dsymutil=yes
> terminate called after throwing an instance of 'std::runtime_error'
>  what():  xx
> ==40738==
> ==40738== Process terminating with default action of signal 6 (SIGABRT)
> ==40738==    at 0x1001500B6: __kill (in /usr/lib/libSystem.B.dylib)
> ==40738==    by 0x10006F5D1: __gnu_cxx::__verbose_terminate_handler()
> (in /usr/lib/libstdc++.6.0.9.dylib)
> ==40738==    by 0x10006DAE0: __cxxabiv1::__terminate(void (*)()) (in
> /usr/lib/libstdc++.6.0.9.dylib)
> ==40738==    by 0x10006DB15: std::terminate() (in
> /usr/lib/libstdc++.6.0.9.dylib)
> ==40738==    by 0x10006DBFB: __cxa_throw (in /usr/lib/libstdc++.6.0.9.dylib)
> ==40738==    by 0x100000DF7: main (in ./a.out)
> ==40738==
> ==40738== HEAP SUMMARY:
> ==40738==     in use at exit: 259 bytes in 4 blocks
> ==40738==   total heap usage: 5 allocs, 1 frees, 282 bytes allocated
> ==40738==
> ==40738== 27 bytes in 1 blocks are possibly lost in loss record 2 of 4
> ==40738==    at 0x100010D7B: operator new(unsigned long)
> (vg_replace_malloc.c:261)
> ==40738==    by 0x1000534D0: std::string::_Rep::_S_create(unsigned
> long, unsigned long, std::allocator<char> const&) (in
> /usr/lib/libstdc++.6.0.9.dylib)
> ==40738==    by 0x10005517C: char* std::string::_S_construct<char
> const*>(char const*, char const*, std::allocator<char> const&,
> std::forward_iterator_tag) (in /usr/lib/libstdc++.6.0.9.dylib)
> ==40738==    by 0x10005555E: std::basic_string<char,
> std::char_traits<char>, std::allocator<char> >::basic_string(char
> const*, std::allocator<char> const&) (in
> /usr/lib/libstdc++.6.0.9.dylib)
> ==40738==    by 0x100000D55: main (in ./a.out)
> ==40738==
> ==40738== LEAK SUMMARY:
> ==40738==    definitely lost: 0 bytes in 0 blocks
> ==40738==    indirectly lost: 0 bytes in 0 blocks
> ==40738==      possibly lost: 27 bytes in 1 blocks
> ==40738==    still reachable: 232 bytes in 3 blocks
> ==40738==         suppressed: 0 bytes in 0 blocks
> ==40738== Reachable blocks (those to which a pointer was found) are not shown.
> ==40738== To see them, rerun with: --leak-check=full --show-reachable=yes
> ==40738==
> ==40738== For counts of detected and suppressed errors, rerun with: -v
> ==40738== ERROR SUMMARY: 1 errors from 1 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
>

------------------------------------------------------------------------------
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