www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22687] New: GC Leak Detector is not freeing all addresses

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

          Issue ID: 22687
           Summary: GC Leak Detector is not freeing all addresses
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: muhammed.yucel bosagora.io

Malloc logging is called per object basis but free logging depends on debug
flags to work per object basis. It reports freeing per page basis, thus there
are some non-freed addresses remaining in logger even those are freed. Since
log_malloc doesn't check for double allocations on the same address as in the
log_free which checks double frees; this got missed.

Following line should be executed for Leak Detector even no debug flags are
provided. 
https://github.com/dlang/druntime/blob/fb5494278058e2f44033b557b6f4202402f36f04/src/core/internal/gc/impl/conservative/gc.d#L2759

--
Jan 18 2022