My application has started to non-deterministically fail after upgrading to Java 8. It doesn't throw an exception or print an error message. The only sign of its failure is the exit code -559038737. Has anyone encountered this?
JVM 8 exit code -559038737 (0xDEADBEEF)
That exit code probably comes from Apache Commons Exec:
public interface Executor {
/** Invalid exit code. */
int INVALID_EXITVALUE = 0xdeadbeef;
...
There are some changes in Java 8 that might have introduced a bug.
But without knowing your classpath and code, this is just an educated guess.
Maybe you are using the asynchronous way to use Commons Exec:
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
Executor executor = new DefaultExecutor();
executor.execute(cmdLine, resultHandler);
int exitValue = resultHandler.waitFor();
return exitValue;
So the exception is only captured in the resultHandler, but not print on stderr automatically?
I use Commons Exec to launch a JVM process. Do you think a JVM crash would cause Exec to return this exit code but not capture the error output that the JVM prints out? I have seen a similar issue in Java 8 where the stderr output is not recorded when the called java app uses System.Exit(). Output of a stack trace of an unhandled exception, though, seems to get recorded. –
Dextrose
I edited the answer to address that question, maybe you are using the non-blocking way to use that library, which doesn't print the stacktrace automatically. –
Barbey
Not seeing (some)
stderr
output (or stdout
for that matter) wouldn't be at all surprising on System.exit()
since the output buffers won't get flushed, or might not on some JVMs. –
Corelli © 2022 - 2024 — McMap. All rights reserved.
System.exit(0xDEADBEEF)
somewhere inside 3rd party code. – Juni0xDEADBEEF
as an exit code in either JDK or HotSpot sources. This might be a library. Place a breakpoint onjava.lang.Runtime.exit
and onjava.lang.Runtime.halt
if possible. If it isn't possible to place a breakpoint on the production system, you may want to recompleRuntime.java
class to print the stack trace onexit
andhalt
. – Erlkingjava/lang/Runtime.java
fromsrc.zip
included in JDK, modify it as you wish, compile with javac, and finally include in the bootstrap classpath when running your application using-Xbootclasspath/p:/path/to/alt/classes
command line option. – Erlkingsrc/main/java/java/lang/Runtime.java
in my Maven project and build the jar, what JVM flag should I use? – Dextrose-Xbootclasspath/p:/path/to/project.jar
– Erlkingdead beef
occurs. – Calumetexit
return code, so either the exit is due to an unskilled programmer or there has indeed been some sort of "wild" reference. – Longitude