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

[Backtracing][Linux] Add Linux crash handler to the runtime. #66334

Merged
merged 5 commits into from Jun 7, 2023

Conversation

al45tair
Copy link
Contributor

@al45tair al45tair commented Jun 5, 2023

This also adds a function to demangle a symbol, and a way for the backtracing code to report warning messages to the same place as the main runtime.

I'd like to rename the _swift_isThunkFunction() SPI also, but we can't do that until we've made the changes to the _Backtracing library, so we'll do that there instead.

rdar://110261430

This also adds a function to demangle a symbol, and a way for the
backtracing code to report warning messages to the same place as
the main runtime.

I'd like to rename the _swift_isThunkFunction() SPI also, but we
can't do that until we've made the changes to the _Backtracing
library, so we'll do that there instead.

rdar://110261430
@al45tair
Copy link
Contributor Author

al45tair commented Jun 5, 2023

@swift-ci Please smoke test

This was added to a later PR, but not to this one, though we need
it here.

rdar://110261430
@al45tair
Copy link
Contributor Author

al45tair commented Jun 5, 2023

@swift-ci Please smoke test

This should have been disabled until apple#66338.

rdar://110261430
@al45tair
Copy link
Contributor Author

al45tair commented Jun 5, 2023

@swift-ci Please smoke test

@al45tair al45tair requested a review from mikeash June 6, 2023 10:06
@al45tair
Copy link
Contributor Author

al45tair commented Jun 6, 2023

If you're wondering where the tests are, I left them until the last PR (#66338) so everything was enabled and they'd actually work.

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

A few little comments, but LGTM.

include/swift/Runtime/CrashInfo.h Show resolved Hide resolved
stdlib/public/runtime/Backtrace.cpp Show resolved Hide resolved
stdlib/public/runtime/Backtrace.cpp Show resolved Hide resolved
stdlib/public/runtime/Backtrace.cpp Show resolved Hide resolved
stdlib/public/runtime/Backtrace.cpp Show resolved Hide resolved
stdlib/public/runtime/CrashHandlerLinux.cpp Outdated Show resolved Hide resolved
stdlib/public/runtime/CrashHandlerLinux.cpp Show resolved Hide resolved
stdlib/public/runtime/CrashHandlerLinux.cpp Show resolved Hide resolved
stdlib/public/runtime/CrashHandlerLinux.cpp Show resolved Hide resolved
stdlib/public/runtime/CrashHandlerLinux.cpp Show resolved Hide resolved
Mike and Max made various helpful suggestions, so I've added and updated
various comments and amended the code to cope with partial reads and
writes.

rdar://110261430
Moved the comment for `_swift_backtrace_demangle` into the header file
instead of it being in the implementation.

rdar://110261430
@al45tair
Copy link
Contributor Author

al45tair commented Jun 6, 2023

@swift-ci Please smoke test

Copy link
Member

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

None yet

3 participants