Thread overview
[Issue 19317] dip1008 doesn't call the throwable's destructor in _d_delThrowable
Oct 20, 2018
Nicholas Wilson
Oct 20, 2018
Nicholas Wilson
Mar 24, 2019
Walter Bright
Mar 24, 2019
Walter Bright
Mar 26, 2019
Walter Bright
October 20, 2018
https://issues.dlang.org/show_bug.cgi?id=19317

Nicholas Wilson <iamthewilsonator@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iamthewilsonator@hotmail.co
                   |                            |m

--- Comment #1 from Nicholas Wilson <iamthewilsonator@hotmail.com> ---
_d_delThrowable does call it https://github.com/dlang/druntime/blob/9a8edfb48e4842180c706ee26ebd8edb10be53f4/src/rt/ehalloc.d#L114 so this must be some compiler buggery that just free's it directly.

--
October 20, 2018
https://issues.dlang.org/show_bug.cgi?id=19317

--- Comment #2 from Nicholas Wilson <iamthewilsonator@hotmail.com> ---
Hmm, the actual problem seems to be that _d_delThrowable takes a Throwable [1] (N.B: not the most derived type) and after checking its not null, is ref counted, and `GC.removeRange(t);`ing if necessary, proceeds to call rt_finalize on it[2], which recursively calls the destructors of t and is parent classes (i.e. Throwable and Object) but misses any derived destructors.

[1]: https://github.com/dlang/druntime/blob/master/src/rt/ehalloc.d#L76 [2]: https://github.com/dlang/druntime/blob/master/src/rt/ehalloc.d#L114

--
March 24, 2019
https://issues.dlang.org/show_bug.cgi?id=19317

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=19463

--
March 24, 2019
https://issues.dlang.org/show_bug.cgi?id=19317

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
The fix for https://issues.dlang.org/show_bug.cgi?id=19317 appears to resolve this as well:

https://github.com/dlang/dmd/pull/9481

--
March 26, 2019
https://issues.dlang.org/show_bug.cgi?id=19317

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---


*** This issue has been marked as a duplicate of issue 19463 ***

--