RFR: 8292695: SIGQUIT and jcmd attaching mechanism does not work with signal chaining library

David Holmes dholmes at openjdk.org
Sat Aug 27 21:07:11 UTC 2022


On Fri, 26 Aug 2022 21:48:06 GMT, Man Cao <manc at openjdk.org> wrote:

>> src/hotspot/os/posix/signals_posix.cpp line 1345:
>> 
>>> 1343:     // JVM_begin_signal_setting and JVM_end_signal_setting above, because the
>>> 1344:     // window is intended for signals that support chaining. Otherwise libjsig
>>> 1345:     // would prevent us from overwriting BREAK_SIGNAL's handler to UserHandler.
>> 
>> Okay but doesn't that also mean that libjsig will now allow application code to install its own BREAK_SIGNAL handler, when it should be prevented from doing so???
>
> Yes, this seems always the case regardless of this change. The application should use `-Xrs`/`-XX:+ReduceSignalUsage` if it needs to install its own handler for BREAK_SIGNAL.
> 
> This is also the reason why TestSigquit.java sets `-Xrs`, see test/hotspot/jtreg/runtime/signal/README:
>> SIGQUIT, SIGTERM, SIGINT, and SIGHUP signals cannot be chained.
>> If the application needs to handle these signals, the -Xrs option needs
>> to be specified. So, test these signals only with -Xrs flag.

My point is that this change seems to allow installation of a BREAK_SIGNAL handler even without -Xrs!

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

PR: https://git.openjdk.org/jdk/pull/9955


More information about the hotspot-runtime-dev mailing list