JDK-8283337 : Posix signal handler modification warning triggering incorrectly
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2022-03-17
  • Updated: 2022-11-03
  • Resolved: 2022-03-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 19
17.0.6Fixed 19 b17Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The signal handler modification check is showing a signal handler change when there is none.

jcmd PID VM.info and hs_err reports contain this info. e.g.

$ jdk-19/bin/jcmd 17446 VM.info
...
Signal Handlers:
   SIGSEGV: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
    SIGBUS: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
    SIGFPE: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
   SIGPIPE: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
   SIGXFSZ: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
    SIGILL: javaSignalHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
   SIGUSR2: SR_handler in libjvm.so, mask=00000000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO
    SIGHUP: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
    SIGINT: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
   SIGTERM: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
   SIGQUIT: UserHandler in libjvm.so, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO
  *** Handler was modified!
  *** Expected: javaSignalHandler in libjvm.so, mask=11100100110111111111111111111110, flags=SA_RESTART|SA_SIGINFO
   SIGTRAP: SIG_DFL, mask=00000000000000000000000000000000, flags=none

NOT in jdk-19-ea+6
IS  in jdk-19-ea+7 and later

This is happending after:
8279124: VM does not handle SIGQUIT during initialization

In src/hotspot/os/posix/signals_posix.cpp

PosixSignals::print_signal_handler() prints the "Handler was modified!" text.
It checks if the saved expected action is non-null, not whether we have 
do_check_signal_periodically[sig] == true

But although set_signal_handler has a parameter do_check, we always populate the SavedSignalHandlers vm_handlers even when this is false.


Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/834 Date: 2022-10-25 11:51:38 +0000
25-10-2022

Changeset: 45d4d7da Author: Kevin Walls <kevinw@openjdk.org> Date: 2022-03-31 08:37:50 +0000 URL: https://git.openjdk.java.net/jdk/commit/45d4d7da23f1d56c9bc7d4327892b902ce677764
31-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7858 Date: 2022-03-17 19:23:10 +0000
17-03-2022

Thanks Dan yes was meaning to add the link. Marked as Linux specific.
17-03-2022

[~kevinw] - I've linked to JDK-8279124 and added '19' as the "Affects Version/s" value. Should this also be marked as Linux specific?
17-03-2022