RFR: 8279124: VirtualMachineImpl should check signal handler has installed before sending SIGQUIT [v2]

Xin Liu xliu at openjdk.java.net
Wed Jan 19 08:02:27 UTC 2022


On Wed, 19 Jan 2022 06:47:12 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Intercept SIGQUIT in the early stage of HotSpot.
>
> src/hotspot/os/posix/signals_posix.cpp line 1291:
> 
>> 1289:   // that an attach client accidentally forces HotSpot to quit prematurely.
>> 1290:   set_signal_handler(BREAK_SIGNAL);
>> 1291: 
> 
> I would do this only if ReduceSignalHandling is inactive, since in that case we must not overwrite a SIGQUIT handler the app may have installed before us. We should have parsed arguments already at this point, no?

Arguments have been parsed right here(os::init_2()), so ReduceSignalUsage is evaluated. 
Previous revision actually covers java with -Xrs. Attach won't send SIGQUIT until the SIGQUIT bit has been set. 
if we install JVM_HANDLE_XXX_SIGNAL conditionally, it will leave java processes with -Xrs unprotected.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7003


More information about the serviceability-dev mailing list