Repository navigation
Description
There are some cases when Java modules are running unit test on Windows server and finished with errors (i.e https://github.com/apache/arrow/actions/runs/3191692688/jobs/5208306317).
[INFO] Arrow Memory - Netty ............................... FAILURE [ 9.975 s]
820
[INFO] ------------------------------------------------------------------------
835[INFO] BUILD FAILURE
836[INFO] ------------------------------------------------------------------------
837[INFO] Total time: 45.950 s (Wall Clock)
838[INFO] Finished at: 2022-10-05T18:25:21Z
839[INFO] ------------------------------------------------------------------------
840Error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test) on project arrow-memory-netty:
841Error:
842Error: Please refer to D:\a\arrow\arrow\java\memory\memory-netty\target\surefire-reports for the individual test results.
843Error: Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
844Error: ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
845Error: Command was cmd.exe /X /C "C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.16-101\x64\bin\java --add-opens=java.base/java.nio=ALL-UNNAMED -jar C:\Users\runneradmin\AppData\Local\Temp\surefire10687308957494794092\surefirebooter-20221005182515867_28.jar C:\Users\runneradmin\AppData\Local\Temp\surefire10687308957494794092 2022-10-05T18-25-03_889-jvmRun2 surefire-20221005182515867_26tmp surefire_2-20221005182515867_27tmp"
846Error: Error occurred in starting fork, check output in log
847Error: Process Exit Code: -1073740940
848Error: org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
849Error: Command was cmd.exe /X /C "C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.16-101\x64\bin\java --add-opens=java.base/java.nio=ALL-UNNAMED -jar C:\Users\runneradmin\AppData\Local\Temp\surefire10687308957494794092\surefirebooter-20221005182515867_28.jar C:\Users\runneradmin\AppData\Local\Temp\surefire10687308957494794092 2022-10-05T18-25-03_889-jvmRun2 surefire-20221005182515867_26tmp surefire_2-20221005182515867_27tmp"
850Error: Error occurred in starting fork, check output in log
851Error: Process Exit Code: -1073740940
852Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.awaitResultsDone(ForkStarter.java:513)
853Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkOnceMultiple(ForkStarter.java:397)
854Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:326)
855Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:269)
856Error: at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1334)
857Error: at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1167)
858Error: at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:931)
859Error: at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
860Error: at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:370)
861Error: at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:351)
862Error: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215)
863Error: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:171)
864Error: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:163)
865Error: at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
866Error: at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:210)
867Error: at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:195)
868Error: at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
869Error: at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
870Error: at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
871Error: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
872Error: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
873Error: at java.base/java.lang.Thread.run(Thread.java:829)
874Error: Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
875Error: Command was cmd.exe /X /C "C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.16-101\x64\bin\java --add-opens=java.base/java.nio=ALL-UNNAMED -jar C:\Users\runneradmin\AppData\Local\Temp\surefire10687308957494794092\surefirebooter-20221005182515867_28.jar C:\Users\runneradmin\AppData\Local\Temp\surefire10687308957494794092 2022-10-05T18-25-03_889-jvmRun2 surefire-20221005182515867_26tmp surefire_2-20221005182515867_27tmp"
876Error: Error occurred in starting fork, check output in log
877Error: Process Exit Code: -1073740940
878Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:714)
879Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.lambda$runSuitesForkOnceMultiple$3(ForkStarter.java:388)
880Error: ... 4 more
881Error: -> [Help 1]
882Error:
883Error: To see the full stack trace of the errors, re-run Maven with the -e switch.
884Error: Re-run Maven using the -X switch to enable full debug logging.
885Error:
886Error: For more information about the errors and possible solutions, please read the following articles:
887Error: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
888Error:
889Error: After correcting the problems, you can resume the build with the command
890Error: mvn <args> -rf :arrow-memory-netty
891Error: Process completed with exit code 1. Reporter: David Dali Susanibar Arce / @davisusanibar
Note: This issue was originally created as ARROW-17947. Please see the migration documentation for further details.
Activity
andygrove commentedon Oct 31, 2026
This still happens in the current Windows CI job, and I think the cause is
TestEmptyArrowBuf.testEmptyArrowBuf, which writes past the end of a native allocation.From 2026-08-25 to 2026-10-31 it caused 21 of the 38 failures of "AMD64 Windows Server 2022 Java JDK 17" (about 7% of runs in October), on
main, on Dependabot PRs and on unrelated PRs. All 20 tests inarrow-memory-nettypass, and then surefire reports:Example on
main: https://github.com/apache/arrow-java/actions/runs/41178662172/job/124471369915The exit code in the original report, -1073740940, is
0xC0000374(STATUS_HEAP_CORRUPTION), so Windows is killing the test JVM because its native heap is corrupt. On Windows, surefire now runs each test class in its own JVM (reuseForks=false). The crash therefore happens when that JVM exits, and this error path does not print the exit code. The JVM that dies is the one runningTestEmptyArrowBuf. When the Develocity extension logsConnection reset, it does so right after that class finishes, after the other concurrent fork has already exited.testEmptyArrowBufbuilds a 1024-byteArrowBufovernew PooledByteBufAllocatorL().empty.memoryAddress()and writes 10 bytes through it. That address belongs to Netty'sEmptyByteBuf, which is backed byByteBuffer.allocateDirect(0). The JDK satisfies that with an 8-bytemalloc, becauseUnsafe.allocateMemoryrounds up to 8. So the test writes 2 bytes past the end of the allocation. On 64-bit Windows an 8-byte heap block has no slack, so those bytes land on the next block's header.The overrun reproduces on macOS if
mallocis interposed so that 8-byte allocations end at a guard page.testEmptyArrowBufthen fails withjava.lang.InternalError: a fault occurred in a recent unsafe memory access operation. Backing the buffer with real memory from the test's own allocator fixes it.GH-238: Stop TestNettyAllocator wrapping Netty's empty buffer in a 10…
apacheGH-238: Stop TestEmptyArrowBuf writing past the end of a native…