KEMBAR78
set stubs sections in CodeCache for macOS by Baraa-Hasheesh · Pull Request #1450 · async-profiler/async-profiler · GitHub
Skip to content

Conversation

Baraa-Hasheesh
Copy link
Contributor

Description

While working on #1418, I found that it's possible for the library to have no unwind information (always use FP) or to have some symbols that don't have unwind information.

While checking which symbols don't have unwind information I did observe that it were the stub symbols, which means that implement the unwinding in macOS won't solve all unwinding issues.

For stubs the general recommendation is to recover from the link() register (From the resources I managed to find regarding the subject)

By setting the plt section information inside the code cache, it would result in the FrameDesc being resolved as FrameDesc::empty_frame for stubs, which emulates the mentioned behavior above

This change is safe as it would keep the FP unwinding for all symbols other than the stub symbols,

=> Please note as FP are mandatory in macOS ARM, this should be sufficient for correct unwinding on ARM for macOS

Related issues

#1418

Motivation and context

allow correct unwinding for macOS from stubs

How has this been tested?

manual testing on both ARM & X86 using the jninativestacks.c file & tests


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@apangin apangin merged commit d651a7a into async-profiler:master Aug 26, 2025
20 checks passed
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