-
Bug
-
Resolution: Fixed
-
P2
-
11, 13
-
b24
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8225993 | 14 | Thomas Stuefe | P2 | Resolved | Fixed | team |
JDK-8249947 | 11.0.9 | Thomas Stuefe | P2 | Resolved | Fixed | b01 |
posix_spawn() does start a new child process with whatever method it likes - in case of glibc, with fork(), vfork() or clone() depending on the glibc version - then, in the child process, proceeds to exec() the target binary. In our case the target binary is always the jspawnhelper binary from the JDK.
The problem is that the glibc version of posix_spawn() does not report back an error if the exec() step fails. Instead, the child process will just quit with error code 127.
Strictly speaking that is no bug since POSIX allows that. But for us this situation is indistinguishable from a user program exiting with 127. If we fail to exec() the jspawnhelper, we need to raise an IOException. If a user program exits with 127, we do not care - user should handle this.
In our case this only affects the first exec() the child process does, execing the jspawnhelper. The jspawnhelper then will proceed to exec() the target binary, and we have error reporting for that in place.
But if the jspawnhelper cannot be exec()'ed - e.g. because its permissions are forbidding execution - currently, on glibc, we will not get an error. From the outside it looks like the child process quits immediately.
See also associated glibc discussion here:
https://sourceware.org/bugzilla/show_bug.cgi?id=18433
- backported by
-
JDK-8225993 In posix_spawn mode, failing to exec() jspawnhelper may not result in an error
- Resolved
-
JDK-8249947 In posix_spawn mode, failing to exec() jspawnhelper may not result in an error
- Resolved
- relates to
-
JDK-8224181 On child process spawn, child may write to random file descriptor instead of the fail pipe
- Resolved
-
JDK-8226192 sun/security/tools/jarsigner/PassType.java failed due to "Failed to exec spawn helper"
- Closed
-
JDK-8212828 (process) Provide a way for Runtime.exec to use posix_spawn on linux
- Resolved
-
JDK-8224180 Improve IOException message text on failed sub process spawns
- New