www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16358] New: the most basic program leaks 88 bytes

https://issues.dlang.org/show_bug.cgi?id=16358

          Issue ID: 16358
           Summary: the most basic program leaks 88 bytes
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

a.d:
°°°°

void main()
{
}

compile & run (dmd v2.071.2-b1):
°°°°°°°

dmd a.d
valgrind --leak-check=full -v ./basic:

output:
°°°°°°°

==10527== HEAP SUMMARY:
==10527==     in use at exit: 88 bytes in 2 blocks
==10527==   total heap usage: 27 allocs, 25 frees, 43,904 bytes allocated
==10527== 
==10527== Searching for pointers to 2 not-freed blocks
==10527== Checked 148,376 bytes
==10527== 
==10527== 16 bytes in 1 blocks are definitely lost in loss record 1 of 2
==10527==    at 0x4C291A0: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10527==    by 0x446CCB: _D2rt5tlsgc4initFZPv (in /tmp/a)
==10527==    by 0x441CC8: thread_attachThis (in /tmp/a)
==10527==    by 0x441B8D: thread_init (in /tmp/a)
==10527==    by 0x436D76: gc_init (in /tmp/a)
==10527==    by 0x4296DE: rt_init (in /tmp/a)
==10527==    by 0x426369: _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv (in
/tmp/a)
==10527==    by 0x426314:
_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv (in /tmp/a)
==10527==    by 0x426285: _d_run_main (in /tmp/a)
==10527==    by 0x425EBD: main (in /tmp/a)
==10527== 
==10527== 72 bytes in 1 blocks are definitely lost in loss record 2 of 2
==10527==    at 0x4C2B290: calloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10527==    by 0x446AAC:
_D2rt8monitor_13ensureMonitorFNbC6ObjectZPOS2rt8monitor_7Monitor (in /tmp/a)
==10527==    by 0x446A02: _d_monitorenter (in /tmp/a)
==10527==    by 0x4418C0: _D4core6thread6Thread8isDaemonMFNdZb (in /tmp/a)
==10527==    by 0x42E8C7: thread_joinAll (in /tmp/a)
==10527==    by 0x429779: rt_term (in /tmp/a)
==10527==    by 0x426394: _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv (in
/tmp/a)
==10527==    by 0x426314:
_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv (in /tmp/a)
==10527==    by 0x426285: _d_run_main (in /tmp/a)
==10527==    by 0x425EBD: main (in /tmp/a)
==10527== 
==10527== LEAK SUMMARY:
==10527==    definitely lost: 88 bytes in 2 blocks
==10527==    indirectly lost: 0 bytes in 0 blocks
==10527==      possibly lost: 0 bytes in 0 blocks
==10527==    still reachable: 0 bytes in 0 blocks
==10527==         suppressed: 0 bytes in 0 blocks

--
Aug 06 2016