-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Nim Version
Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-09-19
Copyright (c) 2006-2025 by Andreas Rumpf
git hash: 3f48576
active boot switches: -d:release
Description
The following code crashes:
type
Boss = ref object of RootObj
name: string
proc crash(boss: Boss) =
(proc () =
let a = boss.name # using `boss.name` in this closure causes the crash
)()
proc working(boss: Boss) =
boss.crash()
let boss = Boss()
var t: Thread[Boss]
createThread(t, working, boss)
joinThread(t)Passing by pointer also crashes.
Current Output
Traceback (most recent call last)
/run/media/root/e/nim/3/src/test.nim(5) test
/root/.local/share/grabnim/nim-devel/lib/system/orc.nim(527) nimDecRefIsLastCyclicDyn
/root/.local/share/grabnim/nim-devel/lib/system/orc.nim(509) rememberCycle
/root/.local/share/grabnim/nim-devel/lib/system/orc.nim(156) unregisterCycle
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Expected Output
no crash
Known Workarounds
none
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels