JDK-8161360 : Deprecated vfork() should not be used on Solaris
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris,solaris_11,solaris_12
  • CPU: x86,sparc
  • Submitted: 2016-07-14
  • Updated: 2016-09-09
  • Resolved: 2016-09-06
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 9
9 b135Fixed
Related Reports
Relates :  
Description
The Solaris manpage for vfork() says:

The  vfork()  and vforkx() functions are deprecated. Their sole legiti-
mate use as a prelude to an immediate call to a function from the  exec
family can be achieved safely by posix_spawn(3C) or posix_spawnp(3C).

and use of vfork() generates compilation warnings:

warning:  "vfork" is deprecated, declared in : "/usr/include/unistd.h", line 535

and when Java is built with warnings-as-errors (the default), the build fails as a result.

Code that uses vfork() on Solaris should therefore be removed.

Comments
Note that in its current form the patch seems to cause test failures in JPRT target solaris_x64_5.11-product-c2-jdk_net: FAILED: java/net/MulticastSocket/SetLoopbackMode.java FAILED: java/net/MulticastSocket/Test.java TEST STATS: name=jdk_net run=535 pass=533 fail=2 More investigation needed...
21-07-2016

Suggested patch attached
14-07-2016