runtime: attribute panic caller lines#1925
Draft
cpunion wants to merge 5 commits into
Draft
Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runtime.Caller(2)can report the panic sitetest/gocoverage for explicit panic, nil field panic, bounds panicCallersFrames, and deferred return caller linesbug347.go,bug348.go,issue14646.go,issue29504.go,issue4562.go, andissue5856.goScope
issue27201.goxfailed: it depends onruntime.Stackline output, which is covered by the separate lineinfo/runtime.Stack work.issue33724.goxfailed: it currently fails because the promoted-method nil access does not panic, which is nil/method semantics rather than caller-line attribution.Tests
go test ./test/go -run TestRuntimePanicCallerLineAttribution -count=1 -timeout=10mgo test ./test/go -run 'TestRuntime(Caller|Callers|PanicCaller)' -count=1 -timeout=10mgo test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=15m -args -goroot /opt/homebrew/Cellar/go@1.24/1.24.11/libexec -dirs fixedbugs -case '^(fixedbugs/(bug347|bug348|issue14646|issue29504|issue4562|issue5856)\\.go)$' -xfail /dev/null -run-timeout 2m -build-timeout 5mgo test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=15m -args -goroot /opt/homebrew/Cellar/go@1.24/1.24.11/libexec -dirs fixedbugs -case '^(fixedbugs/(bug347|bug348|issue14646|issue29504|issue4562|issue5856)\\.go)$' -run-timeout 2m -build-timeout 5mgo test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=15m -args -goroot /opt/homebrew/Cellar/go@1.24/1.24.11/libexec -dirs fixedbugs -case '^(fixedbugs/(bug347|bug348|issue14646|issue27201|issue29504|issue33724|issue4562|issue5856)\\.go)$' -run-timeout 2m -build-timeout 5mgo test ./ssa -count=1 -timeout=15mgo test ./cl -count=1 -timeout=15m(cd runtime && go test ./... -count=1 -timeout=15m)git diff --check