Bug 21996 – -checkaction=context triggers InvalidMemoryOperationError in finalizer

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-06-06T13:06:14Z
Last change time
2021-07-24T17:57:08Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2021-06-06T13:06:14Z
checkaction=context allocates from the GC to create the formatted assert message. This may cause an InvalidMemoryOperationError when called from a destructor during GC finalization.
Comment #1 by dlang-bot — 2021-06-06T13:10:05Z
@MoonlightSentinel created dlang/druntime pull request #3493 "Fix 21996 - Skip message formatting for checkaction=context in finalizer" fixing this issue: - Fix 21996 - Skip message formatting for checkaction=context in finalizer The message formatting isn't `@nogc` yet and hence caused an `InvalidMemoryOperationError` when called from a finalizer. https://github.com/dlang/druntime/pull/3493
Comment #2 by dlang-bot — 2021-06-07T16:29:24Z
dlang/druntime pull request #3493 "Fix 21996 - Skip message formatting for checkaction=context in finalizer" was merged into stable: - b2514d0a42b5490dd3591bcf449eac481bcf8527 by MoonlightSentinel: Fix 21996 - Skip message formatting for checkaction=context in finalizer The message formatting isn't `@nogc` yet and hence caused an `InvalidMemoryOperationError` when called from a finalizer. https://github.com/dlang/druntime/pull/3493
Comment #3 by dlang-bot — 2021-07-24T17:57:08Z
dlang/druntime pull request #3515 "merge stable" was merged into master: - 6563a53ec0b064ea6729d4db36bbfef917c850ce by MoonlightSentinel: Fix 21996 - Skip message formatting for checkaction=context in finalizer The message formatting isn't `@nogc` yet and hence caused an `InvalidMemoryOperationError` when called from a finalizer. - 04f2d6df36eb31b7e1fe201deb33b4128e5041cb by MoonlightSentinel: Fix 21996 - Skip message formatting for checkaction=context in finalizer The message formatting isn't `@nogc` yet and hence caused an `InvalidMemoryOperationError` when called from a finalizer. https://github.com/dlang/druntime/pull/3515