Fix handling of hardware exceptions in native code on Unix #69685
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change fixes handling of hardware exceptions like sigsegv or
division by zero that happen in native code out of our runtime helpers
and that is enclosed in the PAL_TRY / PAL_EXCEPT or PAL_FINALLY.
The current implementation was working only for the DAC code. There is a
new need to use it in SuperPMI to ensure that a log is written even in case
an access violation occured in JIT.
It still requires the shared library that wants to use it to be compiled
with FEATURE_ENABLE_HARDWARE_EXCEPTIONS, so nothing has changed for
coreclr or JIT. It also requires the PAL of that shared library to be
initialized with PAL_INITIALIZE_REGISTER_SIGNALS on Linux. On macOS,
this is not needed.