-
Notifications
You must be signed in to change notification settings - Fork 997
Open
Labels
Description
One of the causes behind #5081 seems to be that the Boehm GC sometimes calls gcCallback multiple times in the same runtime.alloc.
The gcCallback calls internal/task.GCStopWorldAndScan which locks internal/task.activeTaskLock.
The second call tries to lock it again, which causes a deadlock.
There is a check for this but it is performed after the gcMarkReachable and thus after the deadlock:
tinygo/src/runtime/gc_boehm.go
Lines 57 to 60 in bf61317
| if needsResumeWorld { | |
| // Should never happen, check for it anyway. | |
| runtimePanic("gc: world already stopped") | |
| } |