As discussed in JDK-8361462, static Semaphores are potentially unsafe if accessed during VM termination. The suspend/resume code (for event sampling) in signals_posix.cpp declares:
// suspend/resume support
#if defined(__APPLE__)
static OSXSemaphore sr_semaphore;
#else
static PosixSemaphore sr_semaphore;
#endif
It is very difficult to establish with certainty that we could not be utilising this semaphore around VM termination, so it is safest to fix the problem. The signal code already has another lazily initialization `Semaphore*` so we can easily change the `sr_semaphore` as well.
// suspend/resume support
#if defined(__APPLE__)
static OSXSemaphore sr_semaphore;
#else
static PosixSemaphore sr_semaphore;
#endif
It is very difficult to establish with certainty that we could not be utilising this semaphore around VM termination, so it is safest to fix the problem. The signal code already has another lazily initialization `Semaphore*` so we can easily change the `sr_semaphore` as well.
- causes
-
JDK-8370207 Test sun/misc/SunMiscSignalTest.java crashes after JDK-8369631
-
- New
-
- relates to
-
JDK-8361462 JVM crashed with assert(ret == 0) failed: Failed to wait on semaphore
-
- In Progress
-
- links to
-
Commit(master) openjdk/jdk/680414d0
-
Review(master) openjdk/jdk/27762