Skip to content

internal/task: fix crash when a timer fires into a contended channel with -scheduler=cores - #6060

Open
davecheney wants to merge 1 commit into
tinygo-org:devfrom
davecheney:davecheney-investigate-issue-6047
Open

davecheney wants to merge 1 commit into
tinygo-org:devfrom
davecheney:davecheney-investigate-issue-6047

Conversation

@davecheney

Copy link
Copy Markdown
Contributor

Timer callbacks run on the scheduler stack with no current goroutine. If the channel lock is held by another core, the callback tried to sleep as a nil task, faulted while holding the global futex lock, and left the other core stalled. Spinning in that case lets the timer send complete once the other core releases the channel lock.

Updates #6047

@davecheney davecheney added this to the 0.45 milestone Oct 28, 2026
@davecheney
davecheney requested a review from dgryski October 28, 2026 02:01
…with -scheduler=cores

Timer callbacks run on the scheduler stack with no current goroutine. If the channel lock is held by another core, the callback tried to sleep as a nil task, faulted while holding the global futex lock, and left the other core stalled. Spinning in that case lets the timer send complete once the other core releases the channel lock.

Updates tinygo-org#6047
@davecheney
davecheney force-pushed the davecheney-investigate-issue-6047 branch from 296ff0b to 222b7c6 Compare October 28, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant