You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
preserve the caller-frame snapshot captured at panic time so deferred runtime.Caller(2) can report the panic site
add LLGo-run test/go coverage for explicit panic, nil field panic, bounds panic CallersFrames, and deferred return caller lines
remove verified darwin/arm64 xfails for bug347.go, bug348.go, issue14646.go, issue29504.go, issue4562.go, and issue5856.go
Scope
Left issue27201.go xfailed: it depends on runtime.Stack line output, which is covered by the separate lineinfo/runtime.Stack work.
Left issue33724.go xfailed: it currently fails because the promoted-method nil access does not panic, which is nil/method semantics rather than caller-line attribution.
Added focused package-level coverage for the panic caller-line instrumentation paths.
Changes:
Added cl tests for caller-frame tracking guards, runtime caller import forms, frame name normalization, and compiled IR insertion of PushCallerFrame / SetCallerLine / PopCallerFrame for panic-line operations.
Added an ssa test for the exported RuntimeFunc wrapper used by the compiler instrumentation.
Local verification:
go test -timeout 30m -coverprofile=/tmp/pr1925-cl-ssa-current.cover ./cl ./ssa
cl: 94.1% statements
ssa: 87.9% statements
Local patch-coverage estimate for the previously reported source files: 190/195 executable added lines covered (97.4%).
go test ./test/go -run TestRuntimePanicCallerLineAttribution -count=1
go test ./test/goroot -run TestGoRoot -goroot "$(go env GOROOT)" -dirs=fixedbugs -case="fixedbugs/(bug347|bug348|issue14646|issue29504|issue4562|issue5856)\\.go$" -count=1 -timeout=30m
Merged latest xgo-dev/main and fixed the CI build failure from duplicate runtime.Func.FileLine definitions in runtime/internal/lib/runtime/symtab.go.
The single remaining FileLine implementation keeps the panic/caller-line rtdebug.FrameForPC path first, preserves the main-branch clitedebug.Addrinfo file fallback, and removes the duplicate method body. No print/exponent changes were made.
Local verification:
go test ./cl ./ssa -run 'Test.*Caller|Test.*Panic|Test.*FileLine|TestDoesNotExist' -count=1
go test ./test/go -run TestRuntimePanicCallerLineAttribution -count=1
go 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 5m
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
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