Summary: Failing inner expression leaves ghost-reference to
outer expression on GC which is errenously finalized
--- Comment #0 from Andreas Jung <webmas...@aj-productions.de> 2010-05-02
11:14:25 PDT ---
Created an attachment (id=620)
Demonstration of the bug - define "DEMO_FAILURE" during compilation to see the
bug in action.
Using the latest DMD 2.043.
Please refer to the attachment for a complete example. In short...
Given the following expression:
"auto parent = new Parent( new FailingChild() );".
"FailingChild::this()" throws an exception and "Parent::this( ... )" never gets
The problem: The GC tries to finalize "parent", despite it has never been
- compromised exception safety.
- causes hard-to-find bugs in large scale frameworks, since code is executed in
objects that the programmer is not even aware of.
Without knowing the excact implementation details of the GC, my "guess" on the
problem is: A GC-root to "parent" is added, before "FailingChild::this()" is
My "guess" on the solution: Add the GC-root to "parent" after the inner
expression "FailingChild::this()" is evaluated.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------