Bug 22748 – ~this() @nogc { synchronized ...... } liable to onMemoryOperationError

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-02-08T15:47:31Z
Last change time
2024-12-13T19:20:50Z
Assigned to
No Owner
Creator
Adam D. Ruppe
See also
https://issues.dlang.org/show_bug.cgi?id=14251
Moved to GitHub: dmd#20049 →

Comments

Comment #0 by destructionator — 2022-02-08T15:47:31Z
I don't have a minimized example, this came up in the middle of a large work application, but examining the source code and the stack trace reveals the issue. The destructor is @nogc hoping to avoid these, but this slipped through. I'm not sure if it should actually fail the nogc check (though it does fail a nothrow check which is interesting but not necessarily a bug per se), but regardless we should do something. synchronized(this) calls ensureMontior which calls GC.setAttr which throws the invalid memory operation error.
Comment #1 by robert.schadek — 2024-12-13T19:20:50Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20049 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB