Skip to content

runtime: runqputbatch does not protect its call to globrunqputbatch #40457

@mknyszek

Description

@mknyszek

As part of https://go-review.googlesource.com/c/go/+/216198 which landed in the Go 1.15 cycle, the new function runqputbatch documents that it may acquire sched.lock because it needs to call globrunqputbatch, but it never does.

Not protecting globrunqputbatch can lead to very bad things, since manipulating the global runq is protected by sched.lock. In particular, we've seen nil g pointers in the global runq as well as general corruption of the global runq field in production.

The fix is straightforward and I'll upload it shortly. This problem is new in Go 1.15.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions