Skip to content

Memory leak in bound closure #8

@pmachata

Description

@pmachata
$ valgrind --leak-check=full ./dwgrep/dwgrep -e '{}->F;'
==12447== Memcheck, a memory error detector
==12447== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==12447== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==12447== Command: ./dwgrep/dwgrep -e {}-\>F;
==12447== 
==12447== 
==12447== HEAP SUMMARY:
==12447==     in use at exit: 192 bytes in 4 blocks
==12447==   total heap usage: 16,953 allocs, 16,949 frees, 892,315 bytes allocated
==12447== 
==12447== 192 (56 direct, 136 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
==12447==    at 0x4C2A0D7: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==12447==    by 0x4E92BA7: allocate (new_allocator.h:104)
==12447==    by 0x4E92BA7: allocate (alloc_traits.h:357)
==12447==    by 0x4E92BA7: __shared_count<frame, std::allocator<frame>, std::shared_ptr<frame>, long unsigned int&> (shared_ptr_base.h:616)
==12447==    by 0x4E92BA7: __shared_ptr<std::allocator<frame>, std::shared_ptr<frame>, long unsigned int&> (shared_ptr_base.h:1090)
==12447==    by 0x4E92BA7: shared_ptr<std::allocator<frame>, std::shared_ptr<frame>, long unsigned int&> (shared_ptr.h:316)
==12447==    by 0x4E92BA7: allocate_shared<frame, std::allocator<frame>, std::shared_ptr<frame>, long unsigned int&> (shared_ptr.h:588)
==12447==    by 0x4E92BA7: make_shared<frame, std::shared_ptr<frame>, long unsigned int&> (shared_ptr.h:604)
==12447==    by 0x4E92BA7: op_scope::pimpl::next() (op.cc:752)
==12447==    by 0x4E8D15C: op_scope::next() (op.cc:792)
==12447==    by 0x4EBBFA5: operator() (libzwerg.cc:291)
==12447==    by 0x4EBBFA5: capture_errors<zw_result_next(zw_result*, zw_stack**, zw_error**)::<lambda()> > (libzwerg.cc:85)
==12447==    by 0x4EBBFA5: zw_result_next (libzwerg.cc:309)
==12447==    by 0x40483B: main (dwgrep.cc:290)
==12447== 
==12447== LEAK SUMMARY:
==12447==    definitely lost: 56 bytes in 1 blocks
==12447==    indirectly lost: 136 bytes in 3 blocks
==12447==      possibly lost: 0 bytes in 0 blocks
==12447==    still reachable: 0 bytes in 0 blocks
==12447==         suppressed: 0 bytes in 0 blocks
==12447== 
==12447== For counts of detected and suppressed errors, rerun with: -v
==12447== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions