[Issue 16641] Infinite loop on InvalidMemoryOperationError in __dmd_personality_v0
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jul 16 05:49:40 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=16641
Nemanja Boric <4burgos at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |4burgos at gmail.com
--- Comment #6 from Nemanja Boric <4burgos at gmail.com> ---
I've experienced issue similar to this while working on:
https://github.com/dlang/druntime/pull/1872
The trick is that chaining exceptions doesn't work with
`InvalidMemoryOperationError` or similar errors that are statically allocated.
So, if you're executing your `close()` during stack unwinding due to
`AssertError`, say, (like in `scope(exit)`) and that method throws another
Error (invalid GC operation), that will reuse the same statically allocated
memory, chaining `ThrowableInstance.next = &ThrowableInstance`, which will
cause infinite loop in the exception handling.
--
More information about the Digitalmars-d-bugs
mailing list