-
Enhancement
-
Resolution: Fixed
-
P3
-
6u10
-
b20
-
x86
-
linux_redhat_3.0
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8009085 | 8 | Harold Seigel | P3 | Closed | Fixed | b79 |
A licensee and their customer think signal handlers in JVM should save and
restore errno. Otherwise, errno might be overwritten by signal handler.
A native method in customer application call msgrcv().
When the return value of msgrcv() is -1, errno is set to ECHILD.
The OS team in the licensee says,
"When some signal interruption occurs and the signal handler re-writes errno,
such situation might occur."
They look into the source code of signal handler in JVM and find out the following
portion.
=====
.......
JVM_handle_linux_signal(int sig,
siginfo_t* info,
void* ucVoid,
int abort_if_unrecognized)
{
ucontext_t* uc = (ucontext_t*) ucVoid;
if (sig == SIGCHLD) {
// cleanup zombie pid for child thread
::waitpid(-1, 0, WNOHANG);
return 1;
}
.....
======
There seems a possibility that errno is replaced by ECHILD in waitpid.
Our customer believes that signal handlers should save errno and restore
on return.
The above example is waitpid/ECHILD case.
They think also errno may be overwritten in other system calls.
(Please read comment section also. There are more specific resuests from the licensee.)
restore errno. Otherwise, errno might be overwritten by signal handler.
A native method in customer application call msgrcv().
When the return value of msgrcv() is -1, errno is set to ECHILD.
The OS team in the licensee says,
"When some signal interruption occurs and the signal handler re-writes errno,
such situation might occur."
They look into the source code of signal handler in JVM and find out the following
portion.
=====
.......
JVM_handle_linux_signal(int sig,
siginfo_t* info,
void* ucVoid,
int abort_if_unrecognized)
{
ucontext_t* uc = (ucontext_t*) ucVoid;
if (sig == SIGCHLD) {
// cleanup zombie pid for child thread
::waitpid(-1, 0, WNOHANG);
return 1;
}
.....
======
There seems a possibility that errno is replaced by ECHILD in waitpid.
Our customer believes that signal handlers should save errno and restore
on return.
The above example is waitpid/ECHILD case.
They think also errno may be overwritten in other system calls.
(Please read comment section also. There are more specific resuests from the licensee.)
- backported by
-
JDK-8009085 Signal handler should save/restore errno
-
- Closed
-