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

os::signal should be os specific

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • b22

      The second argument for os::signal is a void* handler function.

      The posix implementation of os::signal expects that handler argument to be a sigaction handler, taking 3 arguments.

      The Windows implementation of os::signal expects that handler argument to be a signal handler, taking 1 argument. It's not a sigaction handler like POSIX because Windows seemingly doesn't support the sigaction stuff.

      This all makes os::signal a quite questionable portability API. And it turns out all calls to os::signal are in posix-specific or windows-specific files. So it seems like we don't even need this portability API. Probably os::signal should be removed entirely, and windows and posix code should each have their own signal handler manipulation functions, and never the twain shall meet.

      There are also some problematic uses. For example, in os_windows.cpp there is a call to os::signal with the handler being UserHandler, a function of 3 arguments (though only the first is used), which will be called with only one argument. All the other uses need to be examined.

            dholmes David Holmes
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: