[Issue 22752] New: _d_delThrowable() may crash if a foreign Throwable object is being finalized by the GC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 9 18:49:30 UTC 2022


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

          Issue ID: 22752
           Summary: _d_delThrowable() may crash if a foreign Throwable
                    object is being finalized by the GC
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: frame86 at live.com

It's currently possible to return a Throwable object from a D-DLL and throw it
in the main application.

While this is questionable use case - it's also a workaround for the poor
DLL-support because throwing from a DLL function directly crashes.

However, while earlier builds just crashes immediately if a foreign Throwable
object was thrown now the Throwable can be thrown but a timed bomb is plant in
_d_delThrowable() which causes the program later to crash if the GC decides to
finialize it later.

--


More information about the Digitalmars-d-bugs mailing list