RFR: 8254824: SignalHandlerMark have no purpose

Thomas Stuefe stuefe at openjdk.java.net
Thu Oct 15 17:35:15 UTC 2020


On Thu, 15 Oct 2020 11:45:28 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> SignalHandlerMark increase and decrease _num_nested_signal, but it is never read.
>> We have no caller to is_inside_signal_handler().
>> 
>> Testing T1.
>
> Changes requested by dholmes (Reviewer).

> As much as I like seeing old code removed, wouldn't this be something that would be useful? Should Mutex::lock with
> safepoint check for instance check for this?

Maybe. But as it is, beside being unused it is pretty inconsistent: only the main signal hndler uses this, not the
SR_handler nor the secondary error handler. So, Thread::_num_nested_signal would only ever be >1 if a second signal
happened right inside the signal handling but before fatal error handling kicks in, which as its first step installs
the secondary error handler.

BTW one thing I wondered about is that all the JVM_handle_xxx_signal() functions return an int; but we return anything
out of {true, false, 0, 1.} And the return value is then ignored at the caller. For example, the
"abort_if_unrecognized" option does not seem to do anything - can probably be removed.

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

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


More information about the hotspot-runtime-dev mailing list