Skip to content

fix unbuffered channel range close race#1886

Draft
cpunion wants to merge 1 commit into
xgo-dev:mainfrom
cpunion:codex/goroot-range-coverage
Draft

fix unbuffered channel range close race#1886
cpunion wants to merge 1 commit into
xgo-dev:mainfrom
cpunion:codex/goroot-range-coverage

Conversation

@cpunion
Copy link
Copy Markdown
Collaborator

@cpunion cpunion commented May 22, 2026

Summary

  • Fix unbuffered channel receive comma-ok results when a sender closes immediately after completing the rendezvous.
  • Add focused test/go coverage for unbuffered channel range and direct comma-ok receive.
  • Remove the now-passing range.go GOROOT xfail entries.

Testing

  • go test ./test/go -run 'Test(RangeUnbufferedChanReceivesFinalValueBeforeClose|UnbufferedChanReceiveOKAfterSenderCloses)$' -count=1
  • go run ./cmd/llgo test -run 'Test(RangeUnbufferedChanReceivesFinalValueBeforeClose|UnbufferedChanReceiveOKAfterSenderCloses)$' -count=1 ./test/go/range_channel_close_test.go
  • go test ./test/go -run 'TestRangeAssignmentConversions$' -count=1
  • go run ./cmd/llgo test -run 'TestRangeAssignmentConversions$' -count=1 ./test/go/range_assignment_conversion_test.go
  • go test ./cl -run 'TestSkipUnusedArrayDeref|TestRangeFuncDeferAnalysisHelpers|TestCompileRangeFuncDeferModule|TestRangeFuncDeferHelperNilAndCachePaths|TestNestedRangeFuncDeferAnalysisCombinations' -count=1
  • (cd runtime && go test ./internal/runtime -count=1)
  • go test ./test/goroot -count=1 -args -goroot /opt/homebrew/Cellar/go@1.24/1.24.11/libexec -dirs . -case '^range.go$' -xfail /tmp/llgo-no-xfail.yaml
  • go test ./test/goroot -count=1 -args -goroot /opt/homebrew/Cellar/go@1.24/1.24.11/libexec -dirs . -case '^range.go$'

Notes

  • GOROOT CI is slow/disabled for broad runs; this PR adds stable test/go coverage for the fixed behavior.
  • Normal PR CI should run from the cpunion fork branch; no branch was pushed to xgo-dev/llgo.
  • Nearby typeparam/chans.go still times out with xfail disabled on this machine, so that xfail remains unchanged.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants