Skip to content

Crash handler recursion protection - Fix - #139

Merged
jbachorik merged 4 commits into
mainfrom
r1viollet/fix_crash_handler_protection
Oct 24, 2024
Merged

jbachorik merged 4 commits into
mainfrom
r1viollet/fix_crash_handler_protection

Conversation

@r1viollet

@r1viollet r1viollet commented Oct 16, 2024 •

Copy link
Copy Markdown
Contributor

What does this PR do?:

When exiting through the longjmp path, we should reset the depth instead of decrementing.

There were a lot of warnings in the CI. I fixed the most obvious ones.
The PR can be reviewed with separate commits.

Motivation:

Jaroslav witnessed a crash in the safe access function (meaning we were not preventing the safe access crashes).

Additional Notes:

How to test the change?:

I have not been able to reproduce as of now.

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: [JIRA-XXXX]

Unsure? Have a question? Request a review!

@github-actions

github-actions Bot commented Oct 16, 2024 •

Copy link
Copy Markdown
Contributor

🔧 Report generated by pr-comment-cppcheck

CppCheck Report

Warnings (6)

Style Violations (161)

When exiting through the longjmp path, we should reset the depth instead of decrementing.
@r1viollet
r1viollet force-pushed the r1viollet/fix_crash_handler_protection branch from d3311d2 to 567af10 Compare October 16, 2024 08:08
if (vm_thread != NULL && sameStack(vm_thread->exception(), &vm_thread)) {
if (thrd) {
thrd->exitCrashHandler();
thrd->resetCrashHandler();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is the main change

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you add a comment here about why the reset needs to be done here?

@github-actions

github-actions Bot commented Oct 16, 2024 •

Copy link
Copy Markdown
Contributor

🔧 Report generated by pr-comment-scanbuild

Scan-Build Report

User:runner@fv-az1759-83
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 clean all
Clang Version:Ubuntu clang version 14.0.0-1ubuntu1.1
Date:Thu Oct 24 09:05:26 2024

Bug Summary

Bug TypeQuantityDisplay?
All Bugs5
Logic error
Assigned value is garbage or undefined1
Dereference of null pointer3
Unused code
Dead nested assignment1

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Logic errorAssigned value is garbage or undefineddwarf.cppparseInstructions24420
Unused codeDead nested assignmentvmStructs.cppcheckNativeBinding8791
Logic errorDereference of null pointersafeAccess.hload3318
Logic errorDereference of null pointersymbols_linux.hElfParser12932
Logic errorDereference of null pointerflightRecorder.cppflush15048

@r1viollet
r1viollet requested a review from jbachorik October 18, 2024 13:57
@jbachorik
jbachorik merged commit 947c513 into main Oct 24, 2024
@jbachorik
jbachorik deleted the r1viollet/fix_crash_handler_protection branch October 24, 2024 10:56
@github-actions github-actions Bot added this to the 1.16.0 milestone Oct 24, 2024
@jbachorik jbachorik mentioned this pull request Nov 1, 2024
4 of 5 tasks
@zhengyu123 zhengyu123 added the fixed_version: v_1.16.0 Version this PR's fix shipped in label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed_version: v_1.16.0 Version this PR's fix shipped in

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants