Preserve existing SIGPROF signal handler on passenger start #2496
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.
What does this PR do?
This PR tweaks the list of trappable signals (
Signal.list_trappable
inruby_core_enhancements.rb
) to considerSIGPROF
a non-trappable signal.This fixes the issue reported in #2489 where a profiler (or other application) installed a
SIGPROF
handler, and then the handler was reset and thus the application would crash upon receiving it.As requested in this comment I've also gone ahead and filled/submitted the contributor agreement form.
How to test the change?
The following
config.ru
reproducer is able to show the problem:Before this change:
(Every request fails because the worker crashes, and then gets replaced with another one that crashes when it gets the next request, and so on)
After this change:
I've also checked with the dd-trace-rb, it no longer needs a workaround when run under passenger (this workaround reduces the accuracy of profiling data, hence my interest in not having it).
Once this fix gets released, I plan to add newer versions of passenger to the allow-list, so dd-trace-rb will not apply the workaround for them.
Fixes #2489