I think this is the only way that can happen if your JVM shuts down before System.exit(1) is executed. Do you think this is possible on your system?
Either the code with System.exit(1) is executed in the daemon thread, and therefore, when all other live (non-daemon) threads finish working, the JVM crashes (or not cleanly, since you can still get the exit code 0, if you program an exception!)
Alternatively, as @Erick Robertson suggested, it is possible that something changes the exit status from the hook or something like that, although I'm not sure how this is possible.
Note: please ignore my previous comment. A call to System.exit(1) will terminate all currently running daemon / non-daemon threads.
source share