Skip to content

[Backtracing] Fix ARM64e build failure. #69859

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

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

al45tair
Copy link
Contributor

Accessing the thread context structures is complicated because their member variables change name depending on various macros. This caused a build failure for ARM64e.

rdar://118402226

Accessing the thread context structures is complicated because their
member variables change name depending on various macros.  This caused
a build failure for ARM64e.

rdar://118402226
@al45tair al45tair requested a review from mikeash as a code owner November 14, 2023 17:38
@al45tair
Copy link
Contributor Author

@swift-ci Please smoke test

#elif defined(__arm64__)
pc = (void *)(ctx->uc_mcontext->CTX_MEMBER(ss).CTX_MEMBER(pc));
pc = (void *)(ctx->uc_mcontext->CTX_MEMBER(ss).THREAD_STATE_MEMBER(pc));
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to strip this, since the signature bits won't be useful to us.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's really only a "we're doing a backtrace, here's the program counter in case it goes wrong" message, so I'm not too worried about it — we'll normally present it stripped very shortly afterwards anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact, thinking about it, it might be nice to keep the ptrauth bits here, because if we're interrupted while attempting to generate the backtrace, we aren't going to show a register dump (so we won't have any way to see what they were if we strip them, and if the failure happened for ptrauth reasons, we'd have no clue at that point).

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, that all makes sense to me.

@al45tair
Copy link
Contributor Author

@swift-ci Please smoke test macOS platform

@al45tair al45tair merged commit b693cce into swiftlang:main Nov 15, 2023
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