[Issue 20650] New: Cryptic error message when GC called in finalizer
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Mar 9 10:08:45 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20650
Issue ID: 20650
Summary: Cryptic error message when GC called in finalizer
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: default_357-line at yahoo.de
Consider the following code:
class Foo { ~this() { new int; } }
void main() { new Foo; }
What I expected:
core.exception.ReentrantFinalizerException: GC called while finalizing memory.
Are your destructors @nogc?
What I got:
core.exception.InvalidMemoryOperationError at src/core/exception.d(647): Invalid
memory operation
This is cryptic at best and actively misleading at worst, due to the confusion
potential with segfaults. The error message should be made clearer.
--
More information about the Digitalmars-d-bugs
mailing list