United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8007312 : null check signal semaphore in os::signal_notify windows

Details
Type:
Bug
Submit Date:
2013-01-31
Status:
Resolved
Updated Date:
2013-04-30
Project Name:
JDK
Resolved Date:
2013-02-13
Component:
hotspot
OS:
Sub-Component:
svc
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs25
Fixed Versions:
hs25 (b20)

Related Reports
Backport:
Backport:
Backport:

Sub Tasks

Description
tracing adds to the startup of the vm, if a user presses ctrl-c during that initialization, the signal dispatcher thread and the ctrl-break handler is not yet setup.

On windows, this asserts on debug builds:

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=\os_windows.cpp:1963
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (..\..\src\os\windows\vm\os_windows.cpp:1963), pid=612, tid=35
76
#  assert(ret != 0) failed: ReleaseSemaphore() failed
#
# JRE version: Java(TM) SE Runtime Environment (7.0_14) (build 1.7.0_14-ea-n
ightly-h3022-20130125-b01-b00)
# Java VM: Java HotSpot(TM) Server VM (24.0-b32-internal-debug mixed mode window
s-x86 )
# Failed to write core dump. Minidumps are not enabled by default on client vers
ions of Windows
#
# An error report file with more information is saved as:
# D:\temp\SPECjbb2005_kitv1.07\SPECjbb2005\hs_err_pid612.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

The ReleaseSemaphore is performed on an non-initialized global Handle, this causes the assert to trap

                                    

Comments
Fix in progress
                                     
2013-01-31
There are probably a few windows during startup where ctrl-c can't work correctly. Be cautious about simply changing the initialization sequence - move TRACE_INITIALIZE if possible rather than the starting of the signal dispatcher thread. The initialization sequence is fragile and most issues don't become apparent until using specific VM flags with specific features on a specific VM (ie fastdebug).
                                     
2013-02-01
suggest to remove the asserts in os::signal_notify() for solaris and windows (no asserts exist on bsd and linux) - behaviour is more in line with product builds
                                     
2013-02-01
The UserHandler() signal handler is installed via Terminator.setup() during Threads::create_vm  call_initializeSystemClass() . This causes us to end up in os::signal_notify() even though the signalling subsystem is not yet setup. Do explicit initialization check on sig_sem before calling ::ReleaseSemaphore on Windows.
                                     
2013-02-01
URL:   http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/7adae9244bc8
User:  sla
Date:  2013-02-13 15:22:15 +0000

                                     
2013-02-13
URL:   http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/7adae9244bc8
User:  amurillo
Date:  2013-02-22 20:02:50 +0000

                                     
2013-02-22



Hardware and Software, Engineered to Work Together