https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66339

            Bug ID: 66339
           Summary: g++ 5.1.0 Generates memory leak
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: etcwilde at uvic dot ca
  Target Milestone: ---

There is a small memory leak (72kb) in the code outputted by g++.
I get this memory leak on programs with varying complexity, so it doesn't seem
to be a corner case with such a simple program.

The tested program:
int main() { return 0; }

Compiled with:
g++ main.cpp


Valgrind output:

==22976== HEAP SUMMARY:
==22976==     in use at exit: 72,704 bytes in 1 blocks
==22976==   total heap usage: 1 allocs, 0 frees, 72,704 bytes allocated
==22976== 
==22976== 72,704 bytes in 1 blocks are still reachable in loss record 1 of 1
==22976==    at 0x4C29F90: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22976==    by 0x4EC01EF: pool (eh_alloc.cc:117)
==22976==    by 0x4EC01EF: __static_initialization_and_destruction_0
(eh_alloc.cc:244)
==22976==    by 0x4EC01EF: _GLOBAL__sub_I_eh_alloc.cc (eh_alloc.cc:307)
==22976==    by 0x400F0E9: call_init.part.0 (in /usr/lib/ld-2.21.so)
==22976==    by 0x400F1FA: _dl_init (in /usr/lib/ld-2.21.so)
==22976==    by 0x4000DB9: ??? (in /usr/lib/ld-2.21.so)
==22976== 
==22976== LEAK SUMMARY:
==22976==    definitely lost: 0 bytes in 0 blocks
==22976==    indirectly lost: 0 bytes in 0 blocks
==22976==      possibly lost: 0 bytes in 0 blocks
==22976==    still reachable: 72,704 bytes in 1 blocks
==22976==         suppressed: 0 bytes in 0 blocks
==22976==

Reply via email to