Skip to content

Commit cd5b227

Browse files
authored
unset ld_preload and dyld_insert_librares (#11041)
unset ld_preload and dyld_insert_librares Merge branch 'master' into gyuheon0h/jvm-ldpreload-reset Co-authored-by: gyuheon.oh <gyuheon.oh@datadoghq.com>
1 parent 0d472a1 commit cd5b227

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

dd-java-agent/agent-crashtracking/src/main/resources/datadog/crashtracking/notify_oome.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ echo "PID: $PID"
5454
unset JDK_JAVA_OPTIONS
5555
unset JAVA_TOOL_OPTIONS
5656
unset _JAVA_OPTIONS
57+
# Prevent the instrumentation injector from re-injecting the agent into the child JVM
58+
unset LD_PRELOAD
59+
unset DYLD_INSERT_LIBRARIES
5760

5861
# Execute the Java command with the loaded values
5962
"$config_java_home/bin/java" -Ddd.dogstatsd.start-delay=0 -jar "$config_agent" sendOomeEvent "$config_tags"

dd-java-agent/agent-crashtracking/src/main/resources/datadog/crashtracking/upload_crash.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ if [ -z "$1" ]; then
1111
unset JDK_JAVA_OPTIONS
1212
unset JAVA_TOOL_OPTIONS
1313
unset _JAVA_OPTIONS
14+
# Prevent the instrumentation injector from re-injecting the agent into the child JVM
15+
unset LD_PRELOAD
16+
unset DYLD_INSERT_LIBRARIES
1417

1518
"!JAVA_HOME!/bin/java" -jar "!AGENT_JAR!" uploadCrash "!JAVA_ERROR_FILE!"
1619
if [ $? -eq 0 ]; then
@@ -129,6 +132,9 @@ echo "PID: $PID"
129132
unset JDK_JAVA_OPTIONS
130133
unset JAVA_TOOL_OPTIONS
131134
unset _JAVA_OPTIONS
135+
# Prevent the instrumentation injector from re-injecting the agent into the child JVM
136+
unset LD_PRELOAD
137+
unset DYLD_INSERT_LIBRARIES
132138

133139
# Execute the Java command with the loaded values
134140
"$config_java_home/bin/java" -jar "$config_agent" uploadCrash -c "$configFile" "$config_hs_err"

0 commit comments

Comments
 (0)