runtime: start FP walks from a live caller frame#2151
Open
cpunion wants to merge 1 commit into
Open
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
This was referenced Jul 22, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
cpunion
marked this pull request as ready for review
July 22, 2026 08:16
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
20 tasks
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.
Fixes #2149.
Problem
A shallow unrecovered panic built with
-O0 -ldflags=-w=falsecan fall back to the raw clite address dump instead of LLGo's Go-style traceback. It was first noticed when a logging dependency graph and panic were combined in one probe, but the minimized trigger does not depend onlog.Without this PR, output can look like:
Root cause
llgo_framepointerreturned the C helper's own__builtin_frame_address(0). The Go walker dereferenced that stack address after the helper returned, so optimized layouts only worked while stale frame bytes happened to remain intact. In the failing O0/DWARF layout, the saved-FP slot was already overwritten and the walk stopped before collecting a frame.Change
Caller/Callersdepths remain unchanged.This is independent of #2115: that issue owns precise PCLN statement sites. It also does not rely on #2143; optimization can hide the stale-frame bug but is not the correctness fix.
Verification
macOS arm64, Go 1.26.5 / LLVM 19:
go test -vet=off ./... -count=1 -timeout=20mcd runtime && go test -vet=off ./... -count=1 -timeout=15mUbuntu amd64, Go 1.26.5 / LLVM 19.1.7, offline container limited to 2 CPUs, 15 GiB memory, and 512 PIDs: