d-braun opened a new issue, #3549:
URL: https://github.com/apache/maven-surefire/issues/3549

   ### Affected version
   
   maven-surefire-plugin 3.6.1, OpenJDK 25.0.2, macOS (the fork is started via 
`/bin/sh -c "cd … && java …"`, so Linux should behave the same).
   
   ### Bug description
   
   ### Configuration
   ```xml
   <forkedProcessTimeoutInSeconds>20</forkedProcessTimeoutInSeconds>
   <forkedProcessTimeoutExtensionContext>
       <jstack.enabled>true</jstack.enabled>
   </forkedProcessTimeoutExtensionContext>
   ```
   
   ### What happens
   When the fork times out, the dump file only contains:
   ```
   24564: pid: 24564, state is not ready to participate in attach handshake!
   ```
   and Maven logs `[WARNING] JstackTimeoutExtension: jstack exited with code 1 
for fork 1 (pid=24564)`.
   
   ### Cause (measured during the same run)
   ```
   pid 24564, ppid 24405, exe: /bin/sh                ← PID passed to the 
extension
   pid 24565, ppid 24564, exe: …/openjdk-25.0.2/bin/java
   ```
   `jstack 24564` fails with the message above; `jstack 24565` prints a full 
thread dump. `ForkedProcessTimeoutContext#getPid()` seems to return the PID of 
the shell process started by the Commandline, not of the JVM it spawns.
   
   ### Expected
   The extension gets the PID of the forked JVM (e.g. the single child of the 
shell process via `ProcessHandle.children()`, or the PID the fork reports back 
to the plugin), so jstack can attach.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to