Java blocks SIGQUIT for all JavaThreads. The mask of blocked signals is inherited to the child processes. The ProcessBuilder.start executes the posix_spawn syscall in Java thread so the SIGQUIT is blocked in a child process.
This can be easily seen by cat /proc/<child_pid>/status.
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000004
SigIgn: 0000000000001000
SigCgt: 2000000180000604
The SigBlk: 0000000000000004 is a bitmask 0b100 the signal 3 (SIGQUIT) is blocked.
The JDK code blocking the signals for JavaThread and unblocking them for VMThread is here: https://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/9148fcba5de9/src/os/bsd/vm/os_bsd.cpp#l655
The workarund it to run the Java application starting the subprocess with -XX:+ReduceSignalUsage.
This can be easily seen by cat /proc/<child_pid>/status.
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000004
SigIgn: 0000000000001000
SigCgt: 2000000180000604
The SigBlk: 0000000000000004 is a bitmask 0b100 the signal 3 (SIGQUIT) is blocked.
The JDK code blocking the signals for JavaThread and unblocking them for VMThread is here: https://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/9148fcba5de9/src/os/bsd/vm/os_bsd.cpp#l655
The workarund it to run the Java application starting the subprocess with -XX:+ReduceSignalUsage.
- blocks
-
JDK-8293611 Add a test for SIGQUIT handling under -XX:+ReduceSignalUsage
-
- Closed
-