--- old/src/hotspot/share/utilities/vmError.cpp 2018-09-27 17:31:00.213583943 +0530 +++ new/src/hotspot/share/utilities/vmError.cpp 2018-09-27 17:31:00.089583943 +0530 @@ -58,6 +58,10 @@ #include #endif // PRODUCT +bool VMError::_vfork_mode = false; + +bool VMError::is_forkmode_vfork() { return _vfork_mode; } + bool VMError::_error_reported = false; // call this when the VM is dying--it might loosen some asserts @@ -1565,11 +1569,15 @@ #endif tty->print_cr("\"%s\"...", cmd); + VMError::_vfork_mode = true; + if (os::fork_and_exec(cmd) < 0) { tty->print_cr("os::fork_and_exec failed: %s (%s=%d)", os::strerror(errno), os::errno_name(errno), errno); } } + + VMError::_vfork_mode = false; } void VMError::report_java_out_of_memory(const char* message) {