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

improper use of OSX semaphore_t from signal handlers

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • CPU:
      generic
    • OS:
      os_x

      Description

      In os_bsd.cpp there are two semaphores that are posted to from signal handlers. One is a raw OS-specific semaphore (sem_t or Apple semaphore_t), while the other is a wrapper around such.

      Some documentation for OSX semaphore_t indicates that it should not be used from signal handlers, e.g.

      https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/synchronization/synchronization.html

        Semaphores can be used any place where mutexes can occur. This
        precludes their use in interrupt handlers or within the context of
        the scheduler, and makes it strongly discouraged in the VM system.

      If that's correct, then we should not be using OSX semaphore_t for the purpose it is being used for in os_bsd.cpp. Note that this decision to use OSX semaphore_t goes all the way back to the original BSD port integration:

      http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/diff/f08d439fab8c/src/os/bsd/vm/os_bsd.cpp

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kbarrett Kim Barrett
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: