What does this PR do?:
It fixes an omission from the migration to the vanilla upstream stackwalker implementations.
Our stackwalker was providing a callback to reset the crash handler recursion protection when it needed to longjump to recover. Without that, it is easier to get into an inconsistent state when sooner or later the segfaults won't get handled because the protection thinks we are recursing too deeply.
Motivation:
Fix up the omission from the migration. Fix the problems we are seeing in some services.
Additional Notes:
How to test the change?:
Testing is rather cumbersome. We would have to simulate segfault in the vm stackwalking code and make sure we are properly resetting the tracking.
I did this manually by patching VMMethod:id() to dereference a nullptr. Without this patch I will get an immediate crash - with this patch everything works as expected.
For Datadog employees:
- If this PR touches code that signs or publishes builds or packages, or handles
credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
- This PR doesn't touch any of that.
- JIRA: PROF-11839
Unsure? Have a question? Request a review!