Skip to content

GC stop-the-world callback triggered multiple times #5084

@niaow

Description

@niaow

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:

if needsResumeWorld {
// Should never happen, check for it anyway.
runtimePanic("gc: world already stopped")
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcore

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions