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

Crash handler registration does not work correctly #150

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

jbachorik
Copy link
Collaborator

@jbachorik jbachorik commented Nov 8, 2024

What does this PR do?:
Fixes the crash handler registration routine by:

  • making the java version detection more robust
  • guard crash handler setup by JVM being hotspot or J9 instead of relying on Java version
  • use a dedicated crash handler initialization flag instead of relying on JVMTI not having been initialized

Motivation:
Avoid spurious crashes due to not working safe access mechanism

How to test the change?:

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-10866

Unsure? Have a question? Request a review!

Copy link

github-actions bot commented Nov 8, 2024

🔧 Report generated by pr-comment-cppcheck

CppCheck Report

Warnings (6)

Style Violations (168)

Copy link

github-actions bot commented Nov 8, 2024

🔧 Report generated by pr-comment-scanbuild

Scan-Build Report

User:runner@fv-az1383-5
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:Fri Nov 8 07:31:22 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

@jbachorik jbachorik merged commit 7aee91d into main Nov 8, 2024
31 checks passed
@jbachorik jbachorik deleted the jb/safeacess_fix branch November 8, 2024 08:57
@github-actions github-actions bot added this to the 1.17.0 milestone Nov 8, 2024
jbachorik added a commit to DataDog/dd-trace-java that referenced this pull request Nov 8, 2024
jbachorik added a commit to DataDog/dd-trace-java that referenced this pull request Nov 8, 2024
Required to pull in DataDog/java-profiler#150

(cherry picked from commit 49067b0)
jbachorik added a commit to DataDog/dd-trace-java that referenced this pull request Nov 8, 2024
jbachorik added a commit to DataDog/dd-trace-java that referenced this pull request Nov 8, 2024
Required to pull in DataDog/java-profiler#150

(cherry picked from commit 49067b0)
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.

2 participants