[ 
https://issues.apache.org/jira/browse/SUREFIRE-1541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16987791#comment-16987791
 ] 

Valerii Pekarskyi commented on SUREFIRE-1541:
---------------------------------------------

[~tibordigana] thanks for your attention. You are right that there can be many 
causes to the mentioned error message. However as I commented my case was 
specifically caused by excessive logging that Windows console cannot handle 
fast enough

My tests fail when I run them from Windows command line as "mvn verify". They 
however succeed when I try forkCount=0 or when I run "mvn verify >out.txt 
2>&1", and I found that redirectTestOutputToFile worked in my specific case.

That was definitely not an OOM, there was no hs_err files and Xmx setting did 
not help (and MaxPermSize has no effect for java 8). Upgrade from 2.22 to 
3.0.0-M4 did not help either. Funny enough when I tried remote debugging of the 
test code issue disappeared maybe because output buffers were successfully 
dumped when breakpoint hit caused some execution delays.

My intention was just to point to one more possible cause of the error message 
from the ticket description, and I hope it will help someone who found that OOM 
was not cause of their issue.

Also maybe this message helps surefire developers with the investigation. I am 
not familiar with the plugin source, but suggest to check the fork creation 
code on Windows and how output buffers flush there.

Here is the simple maven project with one test that prints some significant 
amount of text to stderr. On my environment it fails somewhere around 400's 
stack trace with junit 4.11 and around 350's with junit 5 (larger traces). Link 
to the repository: [https://github.com/Larry0ua/surefire-crash-report]

 

> SurefireBooterForkException: The forked VM terminated without properly saying 
> goodbye. VM crash or System.exit called?
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1541
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1541
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.22.0
>            Reporter: Anghel Botos
>            Assignee: Tibor Digana
>            Priority: Major
>         Attachments: hs_err_pid3584.log
>
>
> Attempting to run integration tests using maven-failsafe-plugin with 
> {{-Dmaven.failsafe.debug=false}} yields the following stacktrace:
>  
> {noformat}
> [ERROR] ExecutionException The forked VM terminated without properly saying 
> goodbye. VM crash or System.exit called?
> [ERROR] Command was cmd.exe /X /C ""C:\Program 
> Files\Java\jdk1.8.0_121\jre\bin\java" false -jar 
> C:\Users\ANGHEL~1.BOT\AppData\Local\Temp\surefire8539836821793811485\surefirebooter6734575521909210279.jar
>  C:\Users\anghel.botos\AppData\Local\Temp\surefire8539836821793811485 
> 2018-07-24T11-18-12_704-jvmRun1 surefire7184511894589995478tmp 
> surefire_411836142070426630764tmp"
> [ERROR] Error occurred in starting fork, check output in log
> [ERROR] Process Exit Code: 1
> [ERROR] at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.awaitResultsDone(ForkStarter.java:494)
> [ERROR] at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkPerTestSet(ForkStarter.java:441)
> [ERROR] at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:293)
> [ERROR] at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
> {noformat}
>  
> The issue is the "free-floating" {{false}} that appears in the command line 
> used to start a new JVM. I've traced down the issue to 
> {{org.apache.maven.plugin.surefire.AbstractSurefireMojo#getEffectiveDebugForkedProcess}}
>  where the following code can be found:
> {code:java}
>         String debugForkedProcess = getDebugForkedProcess();
>         if ( "true".equals( debugForkedProcess ) )
>         {
>             return "-Xdebug -Xnoagent -Djava.compiler=NONE"
>                 + " 
> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005";
>         }
>         return debugForkedProcess;
> {code}
> ...which is quite..."unexpected" to see that one can pass in a value of 
> {{true}}, but not a value of {{false}}.
> Please fix with a proper parsing of true/false values for the 
> {{maven.failsafe.debug}} property.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to