JDK-8078470 : [Linux] Replace syscall use in os::fork_and_exec with glibc fork() and execve()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,8u60,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2015-04-23
  • Updated: 2015-09-29
  • Resolved: 2015-05-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b67Fixed
Description
For historical reasons, dating back to LinuxThreads, os::fork_and_exec uses direct syscalls to perform fork and execve functions. The fork syscall has been deprecated on linux for quite some time and some distributions are now shipping with deprecated syscalls removed - this results in a ENOSYS error and the "OnError" commands that utilize os::fork_and_exec no longer work.

The problem was discussed here:

http://mail.openjdk.java.net/pipermail/hotspot-dev/2015-April/017916.html

It seems the concerns surrounding direct use of glibc fork() and exec() are no longer legitimate and Martin Buchholz reports that Google replaced the syscalls with glibc call some time ago and have not had any problems. So we propose to apply the same change uniformly on Linux.
Comments
Moving rule: RULE heapdump/OnOOMRun Crash java.lang.OutOfMemoryError: Requested array size exceeds VM limit RULE heapdump/OnOOMRun Crash java.lang.OutOfMemoryError: Java heap space
30-04-2015