Unset ld_preload and dyld_insert_libraries for crashtracker child JVM#11041
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ld_preload and dyld_insert_libraries for crashtracker child JVM
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
This PR is rejected because it was updated |
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
gyuheon.oh@datadoghq.com unqueued this merge request |
|
/merge -c |
|
View all feedbacks in Devflow UI.
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
ld_preload and dyld_insert_libraries for crashtracker child JVMld_preload and dyld_insert_libraries for crashtracker child JVM

What Does This Do
Clears
LD_PRELOADandDYLD_INSERT_LIBRARIESin the OOME notifier and crash uploader shell scripts to prevent the Datadog instrumentation injector from re-injecting the agent into the diagnostic child JVMMotivation
Previous iteration: Unset inherited JVM env vars in crashtracking scripts
Raised here: #10819 (comment)
Additional Notes
The earlier change to clear
JDK_JAVA_OPTIONS,JAVA_TOOL_OPTIONS, and_JAVA_OPTIONScan be bypassed when the Datadog instrumentation injector is active viaLD_PRELOAD. The injector's native library executes atexec()time which is after the script clears the Java option variables but before the child JVM reads them then and re-setsJAVA_TOOL_OPTIONSwith-javaagent:dd-java-agent.jar, undoing the fix.This causes the child JVM to double-load the agent (once as its main jar, once as a javaagent), reintroducing the same port conflicts, memory contention, and lost diagnostics the original change wanted to prevent.
This change adds
unset LD_PRELOADandunset DYLD_INSERT_LIBRARIESwith the existing Java option clearing innotify_oome.shand both code paths ofupload_crash.sh.The
.batvariants are not affected byLD_PRELOAD.Windows has a separate kernel-driver-based DLL injection mechanism that cannot be addressed from the scripts and will need a coordinated fix in the injector itself (respecting a sentinel environment variable set by the crash uploader maybe?).
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.