Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect stack trace for stripped binaries #1092

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

xppt
Copy link
Contributor

@xppt xppt commented Apr 1, 2024

If the executable is stripped, I expect the FailureSignalHandler to dump module+offset for each stack frame, but the output is always (unknown).
Seems like this is because of a typo in OpenObjectFileContainingPcAndGetStartAddress.

Code to reproduce:
repro.zip
Just extract and run ./run_test.py on the host (docker and python3 are required).

Expected output

    @     0x7fa3c2b86699 __cxa_throw
    @     0x55a4ed24f389 (/build/testbin-stripped+0x2388)
    @     0x55a4ed24f3c6 main

Actual output

    @     0x7f81b4790699 __cxa_throw
    @     0x5645b9032389 (unknown)
    @     0x5645b90323c6 main

Copy link

google-cla bot commented Apr 1, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov-commenter
Copy link

codecov-commenter commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.41%. Comparing base (c0813f9) to head (78484ce).
Report is 38 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1092      +/-   ##
==========================================
+ Coverage   63.56%   64.41%   +0.85%     
==========================================
  Files          19       19              
  Lines        2566     2563       -3     
  Branches      910      909       -1     
==========================================
+ Hits         1631     1651      +20     
+ Misses        676      647      -29     
- Partials      259      265       +6     
Files with missing lines Coverage Δ
src/symbolize.cc 63.75% <100.00%> (+7.22%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Collaborator

@sergiud sergiud left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I have one minor remark.

Also, what's the output with your changes?

src/symbolize.cc Outdated Show resolved Hide resolved
@xppt
Copy link
Contributor Author

xppt commented Apr 2, 2024

Also, what's the output with your changes?

The stack trace contains module+offset line after patching:

    @     0x7fde6810f699 __cxa_throw
    @     0x55ce95d3d389 (/build/testbin-stripped+0x2388)
    @     0x55ce95d3d3c6 main

@xppt xppt requested a review from sergiud April 3, 2024 09:01
@sergiud sergiud added the bug label Apr 22, 2024
@sergiud sergiud added this to the 0.7.1 milestone Apr 22, 2024
@sergiud
Copy link
Collaborator

sergiud commented Apr 22, 2024

Thank you!

@sergiud sergiud merged commit cd4ef77 into google:master Apr 22, 2024
136 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants