Bug 22752 – _d_delThrowable() may crash if a foreign Throwable object is being finalized by the GC

Status
NEW
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2022-02-09T18:49:30Z
Last change time
2024-12-07T13:41:48Z
Assigned to
No Owner
Creator
RK
Moved to GitHub: dmd#17438 →

Comments

Comment #0 by frame86 — 2022-02-09T18:49:30Z
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.
Comment #1 by robert.schadek — 2024-12-07T13:41:48Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17438 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB