Skip to content

Conversation

@pablogsal
Copy link
Member

Signed-off-by: Pablo Galindo [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 69.90291% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.97%. Comparing base (64c0e81) to head (ea497f3).

Files with missing lines Patch % Lines
src/memray/_memray/ghost_stack/src/ghost_stack.cpp 60.95% 57 Missing ⚠️
src/memray/commands/run.py 40.00% 3 Missing ⚠️
src/memray/_memray/tracking_api.cpp 75.00% 1 Missing ⚠️
tests/integration/test_native_tracking.py 97.67% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #859      +/-   ##
==========================================
- Coverage   92.50%   91.97%   -0.53%     
==========================================
  Files          99      100       +1     
  Lines       11697    11877     +180     
  Branches      426      429       +3     
==========================================
+ Hits        10820    10924     +104     
- Misses        877      953      +76     
Flag Coverage Δ
cpp 91.97% <69.90%> (-0.53%) ⬇️
python_and_cython 91.97% <69.90%> (-0.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Pablo Galindo <[email protected]>
@pablogsal pablogsal force-pushed the fast_unwind branch 2 times, most recently from 6f8291b to 09b458b Compare November 28, 2025 14:56
  On ARM64, the first frame(s) returned by libunwind's cursor iteration
  could have invalid ret_loc values pointing into our own active stack
  frame. Writing the trampoline address to these locations corrupted our
  execution state, causing crashes.

  Root cause: On ARM64, unw_get_save_loc() for the link register (X30)
  returns the location where LR was saved by the function prologue. For
  our internal frames (capture_and_install, ghost_stack_backtrace), these
  locations were still being used during execution.

  Additionally, fixed the expected_sp calculation for ARM64 longjmp
  detection. On x86_64, RET pops the return address so SP = ret_loc + 8.
  On ARM64, RET doesn't touch SP - the epilogue restores it beforehand.
  The trampoline receives the actual SP value, not ret_loc + 8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants