Skip to content

Conversation

@jbachorik
Copy link
Collaborator

@jbachorik jbachorik commented Jan 2, 2025

What does this PR do?:
Adds more defensive checks for JMX access for the purpose of initializing Heap usage access

Motivation:
When running against jlinked images without JMX the initilization code would crash with SIGSEG

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

Notes
Tested the locally built artifact with the dd-trace-java agent and it does solve the crash reported in the attached issue.

Unsure? Have a question? Request a review!

@github-actions
Copy link

github-actions bot commented Jan 2, 2025

🔧 Report generated by pr-comment-scanbuild

Scan-Build Report

User:runner@fv-az1055-43
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 18.1.3 (1ubuntu1)
Date:Thu Jan 2 15:32:26 2025

Bug Summary

Bug TypeQuantityDisplay?
All Bugs5
Logic error
Dereference of null pointer3
Suspicious operation
Bitwise shift1
Unused code
Dead nested assignment1

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Suspicious operationBitwise shiftvmStructs.cppfind87216
Unused codeDead nested assignmentvmStructs.cppcheckNativeBinding9771
Logic errorDereference of null pointersafeAccess.hload3318
Logic errorDereference of null pointersymbols_linux.hElfParser12928
Logic errorDereference of null pointerflightRecorder.cppflush15048

@github-actions
Copy link

github-actions bot commented Jan 2, 2025

🔧 Report generated by pr-comment-cppcheck

CppCheck Report

Warnings (7)

Style Violations (403)

@jbachorik jbachorik merged commit 0ab1216 into main Jan 2, 2025
38 checks passed
@jbachorik jbachorik deleted the jb/memusage_jni branch January 2, 2025 17:00
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