Skip to content

starboard: Symbolize the call, not the return address - #12977

Merged
andrewsavage1 merged 1 commit into
youtube:mainfrom
hferreiro:arm64-unwind
Sep 30, 2026
Merged

andrewsavage1 merged 1 commit into
youtube:mainfrom
hferreiro:arm64-unwind

Conversation

@hferreiro

Copy link
Copy Markdown
Collaborator

SbSystemGetStack reports return addresses, and a call that is the last instruction of a function leaves one pointing into the next function, so a dumped stack names the wrong function.

Look up the byte before instead, which is always inside the call. //base does the same in stack_trace_posix.cc.

Bug: 495203133

`SbSystemGetStack` reports return addresses, and a call that is the last
instruction of a function leaves one pointing into the next function, so a
dumped stack names the wrong function.

Look up the byte before instead, which is always inside the call. //base
does the same in stack_trace_posix.cc.

Bug: 495203133
@hferreiro
hferreiro requested a review from a team as a code owner September 29, 2026 14:15
@hferreiro
hferreiro requested a review from johnxwork September 29, 2026 14:15
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


starboard: Symbolize call, not return address

SbSystemGetStack reports return addresses. When a call is the last
instruction of a function, the return address can point into the
subsequent function, causing stack traces to attribute the call
incorrectly. This is common with functions annotated as noreturn.

Subtracting one byte from the return address ensures that the address
being symbolized resides within the calling function. This matches
the behavior used in Chromium's base library.

Bug: 495203133

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ✅ PASS All checks passed
CI / android ✅ PASS Passed
CI / evergreen ✅ PASS Passed
CI / linux ✅ PASS Passed
CI / tvos ✅ PASS Passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adjusts stack frame symbolization by subtracting one from the return address to correctly identify functions annotated as noreturn, and adds a corresponding death test. Feedback from the review highlights style guide violations, recommending the use of <cstdlib> and std::abort() instead of their C equivalents. Additionally, the reviewer points out potential undefined behavior from pointer arithmetic on null pointers, suggesting null checks before subtracting from stack addresses.

Comment thread starboard/common/log.cc Resolved
Comment thread starboard/common/log.cc Resolved
@andrewsavage1
andrewsavage1 merged commit 1fda5f8 into youtube:main Sep 30, 2026
838 of 842 checks passed
@github-actions github-actions Bot added the cp-27.lts Cherry Pick to the 27.lts branch label Sep 30, 2026
@hferreiro
hferreiro deleted the arm64-unwind branch September 30, 2026 21:04
briantting pushed a commit that referenced this pull request Sep 30, 2026
…address

Refer to original PR: #12977

`SbSystemGetStack` reports return addresses, and a call that is the last
instruction of a function leaves one pointing into the next function, so
a dumped stack names the wrong function.

Look up the byte before instead, which is always inside the call. //base
does the same in stack_trace_posix.cc.

Bug: 495203133

(cherry picked from commit 1fda5f8)
@oxve oxve removed the cp-27.lts Cherry Pick to the 27.lts branch label Oct 5, 2026
briantting pushed a commit that referenced this pull request Oct 16, 2026
…address

Refer to original PR: #12977

`SbSystemGetStack` reports return addresses, and a call that is the last
instruction of a function leaves one pointing into the next function, so
a dumped stack names the wrong function.

Look up the byte before instead, which is always inside the call. //base
does the same in stack_trace_posix.cc.

Bug: 495203133

(cherry picked from commit 1fda5f8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants