[8u] RFR: fix inconsistency of backport of 8219677: "-XX:OnOutOfMemoryError" uses fork instead of vfork

Yangfei (Felix) felix.yang at huawei.com
Fri Nov 15 07:04:32 UTC 2019


Hi,

  We found one inconsistency of backport of 8219677.
  The upstream patch set parameter use_vfork_if_available to true when call os::fork_and_exec in VM_ReportJavaOutOfMemory::doit().
  But looks like the 8u backport did something inconsistent: the change was not made in the correct place.
  The 8u backport patch: http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/rev/97d605522fcb

Patch for jdk8u-dev:

diff -r 775e2bf92114 src/share/vm/utilities/vmError.cpp
--- a/src/share/vm/utilities/vmError.cpp        Wed Aug 07 17:00:19 2019 +0800
+++ b/src/share/vm/utilities/vmError.cpp        Fri Nov 15 14:23:50 2019 +0800
@@ -1060,7 +1060,7 @@
       out.print_raw   (cmd);
       out.print_raw_cr("\" ...");

-      if (os::fork_and_exec(cmd, true) < 0) {
+      if (os::fork_and_exec(cmd) < 0) {
         out.print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno);
       }
     }
@@ -1147,7 +1147,7 @@
#endif
     tty->print_cr("\"%s\"...", cmd);

-    if (os::fork_and_exec(cmd) < 0) {
+    if (os::fork_and_exec(cmd, true) < 0) {
       tty->print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno);
     }
   }

Please confirm.

Thanks,
Felix


More information about the jdk8u-dev mailing list