From e0574a5fa79d97efe2e262229a5377534d4b7acb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Jul 2026 22:44:14 +0000 Subject: [PATCH 1/2] Add -XX:+EnableDynamicAgentLoading to test argLine (all reactor modules) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Silences the JDK 21 'A Java agent has been loaded dynamically' warning emitted when a test-time agent self-attaches at runtime with no static -javaagent configured — in the core srcmorph module the Lincheck instrumentation agent (AiGenerationKindLincheckTest runs in the default surefire run), plus the jcstress/vmlens agents under their opt-in profiles. That warning is written to the native stderr, outside Surefire's wrapped System.err, and can intermittently corrupt the encoded fork channel — surfacing as 'Corrupted channel by directly writing to native stream' followed by a bogus 'There was a timeout in the fork' even though every test passed. Applied identically to all three module poms to keep the reactor's surefire argLine uniform; mirrors the same guard added to the sibling BitcoinAddressFinder repo (there triggered by Mockito's inline mock maker self-attaching byte-buddy). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Y84TKMNfhbFGi7EoCEvP99 --- srcmorph-cli/pom.xml | 13 ++++++++++++- srcmorph-maven-plugin/pom.xml | 14 +++++++++++++- srcmorph/pom.xml | 17 ++++++++++++++++- 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/srcmorph-cli/pom.xml b/srcmorph-cli/pom.xml index 467c39a..543dca0 100644 --- a/srcmorph-cli/pom.xml +++ b/srcmorph-cli/pom.xml @@ -210,7 +210,18 @@ SPDX-License-Identifier: Apache-2.0 a 2 GB heap cap, a heap dump on OutOfMemoryError into the working directory, and a JVM fatal-error log named per crashing PID. --> - @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log + + @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log -XX:+EnableDynamicAgentLoading - @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log + + @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log -XX:+EnableDynamicAgentLoading - @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log + + @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log -XX:+EnableDynamicAgentLoading - + @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log -XX:+EnableDynamicAgentLoading - + @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log -XX:+EnableDynamicAgentLoading - + @{argLine} -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=. -XX:ErrorFile=hs_err_pid%p.log -XX:+EnableDynamicAgentLoading