runtime: classify recovered runtime panics#1904
Conversation
|
Pushed d49f9e4 to cpunion/codex/goroot-recover3-coverage. Root cause: the recover3 runtime panic changes intentionally lower failed type assertions to runtime.PanicTypeAssert (and nullable array pointer indexing to AssertNilDeref), but several source FileCheck golden comments still expected the old panic-string construction and old IR numbering. Updated the affected test/go coverage-backed IR checks under cl/_testgo, cl/_testrt, and cl/_testdata. Local verification:
|
|
Follow-up pushed: ef99d1c39e2a07908d1421390567a0b9f6eed4980 to cpunion/codex/goroot-recover3-coverage. The d49f9e4 CI failure in Go / test (ubuntu-latest, 19) was not an environment issue. Job 77407357733 failed in ssa/TestFromTestgo/genericembediface because that test arrived from current xgo-dev/main during PR merge testing and still expected the old type assertion panic string. I merged current xgo-dev/main into the branch and updated genericembediface to expect runtime.PanicTypeAssert. Local verification after the merge:
|
|
Follow-up pushed: 64cbd644a8f9965f0a92f9cb80a880e98f927e68 to cpunion/codex/goroot-recover3-coverage. The ef99d1c Ubuntu Go failure was not CI/environmental. Job 77411188389 failed in cl/TestRunAndTestFromTestgo/closureall with an undefined symbol for github.com/goplus/llgo/cl/_testgo/closureall.cSqrt. Root cause: the earlier regenerated CHECK-LINE comments sat between //go:linkname cSqrt C.sqrt and func cSqrt, so the Go directive was no longer adjacent to its declaration and linkname was ignored. Fix: moved the CHECK-LINE comments away from the directive/declaration pair and restored the IR expectation to @sqrt. Local verification:
|
|
Follow-up CI check for
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
recover3.goclassifies them asruntime.Errortest/gocoverage for divide-by-zero, nil pointer, bounds, and type assertion recover pathsrecover3.godarwin/arm64 xfail entryCoverage
This PR keeps the feature covered under
test/go, so it remains checked even when the slow GOROOT workflow is disabled.Tests
go test ./test/go -run 'TestRecoverRuntimeErrorClassification' -count=1go test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=10m -args -goroot "$(go env GOROOT)" -dirs . -case '^recover3\.go$' -xfail /tmp/llgo-empty-xfail.yaml -run-timeout=60s -build-timeout=3mgo test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=10m -args -goroot "$(go env GOROOT)" -dirs . -case '^recover3\.go$' -run-timeout=60s -build-timeout=3mgo test ./ssa -run 'TestTypeAssert|TestMakeInterface|TestBinOp' -count=1go run -tags=dev ./cmd/llgo test -run 'TestRecoverRuntimeErrorClassification' -count=1 ./test/go(cd runtime && go test ./internal/runtime -count=1)git diff --checkCI note
The GOROOT CI workflow is slow and currently disabled. The PR is draft so regular PR CI can run while review stays gated. Manual GOROOT
workflow_dispatchcannot resolve fork-only refs unless the branch exists inxgo-dev/llgo; this PR intentionally keeps the branch only incpunion/llgo.