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

Hohensee, Paul hohensee at amazon.com
Fri Nov 15 16:47:59 UTC 2019


https://bugs.openjdk.java.net/browse/JDK-8234264

On 11/15/19, 8:33 AM, "jdk8u-dev on behalf of Hohensee, Paul" <jdk8u-dev-bounces at openjdk.java.net on behalf of hohensee at amazon.com> wrote:

    You are correct. I'll file an issue to fix it.
    
    Thanks,
    
    Paul
    
    On 11/14/19, 11:05 PM, "jdk8u-dev on behalf of Yangfei (Felix)" <jdk8u-dev-bounces at openjdk.java.net on behalf of felix.yang at huawei.com> wrote:
    
        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