Skip to content

ref: Update to latest master - #3

Merged
Swatinem merged 8 commits into
masterfrom
ref/update
Feb 24, 2021
Merged

Swatinem merged 8 commits into
masterfrom
ref/update

Conversation

@Swatinem

@Swatinem Swatinem commented Feb 9, 2021 •

Copy link
Copy Markdown

I basically copy-pasted the latest code from https://android.googlesource.com/platform/system/unwinding/ applying some of the same cleanups that we did.

I tried to actually import the history/commits of that repo, but github refuses because they contain huge test fixtures that github refuses (~200M file), thats why I resorted to just copy-pasting the files in.

@Swatinem
Swatinem marked this pull request as ready for review February 16, 2021 11:16
@Swatinem
Swatinem merged commit abcfef9 into master Feb 24, 2021
@Swatinem
Swatinem deleted the ref/update branch February 24, 2021 09:23
jpnurmi added a commit that referenced this pull request Oct 29, 2026
`strip_pac()` only strips with a mask, and nothing sets one. The
`__bionic_clear_pac_bits()` fallback was compiled out because it is
not in the NDK, so a signed return address ended the unwind.

Strip with `xpaclri` like bionic does, spelled as `hint #7` for
assemblers without Armv8.3-A support. It is a NOP on older CPUs.

Pixel 8 Pro (Tensor G3, Android 17), `abort()` through two
`-mbranch-protection=pac-ret` functions, unwound from a SIGABRT
handler like sentry-native's inproc backend.

Before:
    #00 pc 000000000007fdc0  .../libc.so (abort+160)
    #1 pc 006e8cdf7ce216d0  <unknown>

After:
    #00 pc 000000000007fdc0  .../libc.so (abort+160)
    #1 pc 000000000002867c  .../pac_test (pac_crash()+12)
    #2 pc 000000000002868c  .../pac_test (pac_caller()+12)
    #3 pc 0000000000028708  .../pac_test (main+120)
    #4 pc 000000000007183c  .../libc.so (__libc_init+124)

Ref: getsentry/sentry-native#2258
jpnurmi added a commit that referenced this pull request Oct 29, 2026
`strip_pac()` only strips with a mask, and nothing sets one. The
`__bionic_clear_pac_bits()` fallback was compiled out because it is
not in the NDK, so a signed return address ended the unwind.

Strip with `xpaclri` like bionic does, spelled as `hint #7` for
assemblers without Armv8.3-A support. It is a NOP on older CPUs.

Pixel 8 Pro (Tensor G3, Android 17), `abort()` through two
`-mbranch-protection=pac-ret` functions, unwound from a SIGABRT
handler like sentry-native's inproc backend.

Before:
    #00 pc 000000000007fdc0  .../libc.so (abort+160)
    #1 pc 006e8cdf7ce216d0  <unknown>

After:
    #00 pc 000000000007fdc0  .../libc.so (abort+160)
    #1 pc 000000000002867c  .../pac_test (pac_crash()+12)
    #2 pc 000000000002868c  .../pac_test (pac_caller()+12)
    #3 pc 0000000000028708  .../pac_test (main+120)
    #4 pc 000000000007183c  .../libc.so (__libc_init+124)

Ref: getsentry/sentry-native#2258
jpnurmi added a commit that referenced this pull request Oct 30, 2026
* fix(arm64): unwind past PAC-signed return addresses

`strip_pac()` only strips with a mask, and nothing sets one. The
`__bionic_clear_pac_bits()` fallback was compiled out because it is
not in the NDK, so a signed return address ended the unwind.

Strip with `xpaclri` like bionic does, spelled as `hint #7` for
assemblers without Armv8.3-A support. It is a NOP on older CPUs.

Pixel 8 Pro (Tensor G3, Android 17), `abort()` through two
`-mbranch-protection=pac-ret` functions, unwound from a SIGABRT
handler like sentry-native's inproc backend.

Before:
    #00 pc 000000000007fdc0  .../libc.so (abort+160)
    #1 pc 006e8cdf7ce216d0  <unknown>

After:
    #00 pc 000000000007fdc0  .../libc.so (abort+160)
    #1 pc 000000000002867c  .../pac_test (pac_crash()+12)
    #2 pc 000000000002868c  .../pac_test (pac_caller()+12)
    #3 pc 0000000000028708  .../pac_test (main+120)
    #4 pc 000000000007183c  .../libc.so (__libc_init+124)

Ref: getsentry/sentry-native#2258

* link to arm developer docs
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