Skip to content

Commit 53dcef9

Browse files
authored
Disable byte-buddy's Nexus mechanism (we don't need it, and it triggers use of Unsafe) (#9569)
1 parent 418fb39 commit 53dcef9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dd-java-agent/agent-builder/src/main/java/datadog/trace/agent/tooling/AgentInstaller.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public class AgentInstaller {
5555

5656
static {
5757
addByteBuddyRawSetting();
58+
disableByteBuddyNexus();
5859
// register weak map supplier as early as possible
5960
WeakMaps.registerAsSupplier();
6061
circularityErrorWorkaround();
@@ -335,6 +336,11 @@ private static void addByteBuddyRawSetting() {
335336
}
336337
}
337338

339+
private static void disableByteBuddyNexus() {
340+
// disable byte-buddy's Nexus mechanism (we don't need it, and it triggers use of Unsafe)
341+
SystemProperties.set("net.bytebuddy.nexus.disabled", "true");
342+
}
343+
338344
private static AgentBuilder.RedefinitionStrategy.Listener redefinitionStrategyListener(
339345
final Set<InstrumenterModule.TargetSystem> enabledSystems) {
340346
if (enabledSystems.contains(InstrumenterModule.TargetSystem.IAST)) {

0 commit comments

Comments
 (0)