RFR(XXS): 8007312: null check signal semaphore in os::signal_notify windows
Markus Grönlund
markus.gronlund at oracle.com
Fri Feb 1 06:49:47 PST 2013
Thanks David,
Ok, so based on our discussions, we'll narrow this to only do a null check on the signal semaphore handle on Windows.
I have updated the webrev, here:
http://cr.openjdk.java.net/~mgronlun/8007312/webrev02/
Also I changed the bug description to reflect the updated information (to the updated subject in the mail above):
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8007312
With this change we don't trap on the assert when pressing ctrl-c if the hotspot signal handler is not setup.
Thanks a lot for your help David, have a great weekend.
Cheers
Markus
-----Original Message-----
From: David Holmes
Sent: den 1 februari 2013 14:41
To: Markus Grönlund
Cc: hotspot-dev at openjdk.java.net
Subject: Re: RFR(XXS): 8007312: Signal Dispatcher thread to start and register ctrl-break handler before TRACE_INITIALIZE
Which brings us back to simply checking for not being initialized.
David
>>>>
>>>>
>>>>
>>>> (windows analysis)
>>>>
>>>>
>>>>
>>>> Pressing ctrl-c before Hotspot signal/console handler has been registered actually asserts/stops the VM (which to the user appears like a crash) on non-product builds.
>>>>
>>>>
>>>>
>>>> Before Hotspot registers its own jvm!consoleHandler with kernel32!CtrlRoutine, the C runtime default msvcr100!ctrlevent_capture is implicitly used - this calls back into jvm!UserHandler, which forwards into os::signal_notify() which uses uninitialized variables.
>>>>
>>>>
>>>>
>>>> // on Windows this creates the following issue when closing a NULL
>>>> handle to a semaphore
>>>>
>>>>
>>>>
>>>> void os::signal_notify(int signal_number) {
>>>>
>>>> BOOL ret;
>>>>
>>>>
>>>> Atomic::inc(&pending_signals[signal_number]);
>>>>
>>>> ret = ::ReleaseSemaphore(sig_sem, 1, NULL);<<--- call
>>>> ReleaseSemaphore on global handle sig_sem which has not been
>>>> setup/created yet == is NULL (is created in os::signal_init_pd())
>>>>
>>>> assert(ret != 0, "ReleaseSemaphore() failed");<<-- assert
>>>> traps here (GetLastError() == 0xc0000008 - An invalid HANDLE was
>>>> specified)
>>>>
>>>>
>>>>
>>>> }
>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> Markus
More information about the hotspot-dev
mailing list