Skip to content

runtime: execLock might deadlock on darwin/ios #65587

@rsc

Description

@rsc

If you run

GOEXPERIMENT=staticlockranking go test strings

on a Mac, it fails badly, because the preemptM can be called while holding various locks that conflict with execLock.rlock, specifically this part:

// On Darwin, don't try to preempt threads during exec.
// Issue #41702.
if GOOS == "darwin" || GOOS == "ios" {
	execLock.rlock()
}

This is indicative of a real potential deadlock on macOS and iOS, though not one that seems to have been reported yet. So probably it's very rare if it can happen at all. Unclear how to fix that.

/cc @aclements

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Darwincompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions