Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8293580

HotSpot's SIGQUIT handler does not honor -XX:+AllowUserSignalHandlers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 8, 11, 17, 20
    • hotspot

      As found out during review for JDK-8292695, HotSpot installs SIGQUIT handler even if -XX:+AllowUserSignalHandlers is set.

      This is because HotSpot installs SIGQUIT handler in a different code path via os::signal(). For other signals, their handlers are installed by set_signal_handler(int sig), which respects -XX:+AllowUserSignalHandlers:

        // Check for overwrite.
        struct sigaction oldAct;
        sigaction(sig, (struct sigaction*)NULL, &oldAct);

        // Query the current signal handler. Needs to be a separate operation
        // from installing a new handler since we need to honor AllowUserSignalHandlers.
        void* oldhand = get_signal_handler(&oldAct);
        if (!HANDLER_IS_IGN_OR_DFL(oldhand) &&
            !HANDLER_IS(oldhand, javaSignalHandler)) {
          if (AllowUserSignalHandlers) {
            // Do not overwrite; user takes responsibility to forward to us.
            return;
          }
      ...

            dholmes David Holmes
            manc Man Cao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: