8074354: Make CreateMinidumpOnCrash a new name and available on all platforms
authorminqi
Wed, 15 Apr 2015 17:34:28 -0700
changeset 30240 a7ba42fa1df6
parent 30239 dc83236ebb28
child 30241 4cf8974e0d20
child 30242 5b15a65d4373
child 30244 d4e471395ff5
8074354: Make CreateMinidumpOnCrash a new name and available on all platforms Summary: Rename CreateMinidumpOnCrash which is used only for Windows as CreateCoredumpOnCrash and make it available for all platforms. Changed order for dumping core on Windows to be similar on other platforms. Also reviewed by thomas.stuefe@gmail.com Reviewed-by: dcubed Contributed-by: yumin.qi@oracle.com, thomas.stuefe@gmail.com
hotspot/src/os/aix/vm/os_aix.cpp
hotspot/src/os/bsd/vm/os_bsd.cpp
hotspot/src/os/linux/vm/os_linux.cpp
hotspot/src/os/posix/vm/os_posix.cpp
hotspot/src/os/solaris/vm/os_solaris.cpp
hotspot/src/os/windows/vm/os_windows.cpp
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/runtime/os.hpp
hotspot/src/share/vm/utilities/vmError.cpp
hotspot/src/share/vm/utilities/vmError.hpp
hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java
hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java
hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java
hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java
hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java
hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java
hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java
hotspot/test/runtime/Unsafe/RangeCheck.java
hotspot/test/runtime/memory/ReadFromNoaccessArea.java
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Wed Apr 15 17:34:28 2015 -0700
@@ -1211,6 +1211,10 @@
 // called from signal handler. Before adding something to os::abort(), make
 // sure it is async-safe and can handle partially initialized VM.
 void os::abort(bool dump_core) {
+  abort(dump_core, NULL, NULL);
+}
+
+void os::abort(bool dump_core, void* siginfo, void* context) {
   os::shutdown();
   if (dump_core) {
 #ifndef PRODUCT
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Apr 15 17:34:28 2015 -0700
@@ -1132,6 +1132,10 @@
 // called from signal handler. Before adding something to os::abort(), make
 // sure it is async-safe and can handle partially initialized VM.
 void os::abort(bool dump_core) {
+  abort(dump_core, NULL, NULL);
+}
+
+void os::abort(bool dump_core, void* siginfo, void* context) {
   os::shutdown();
   if (dump_core) {
 #ifndef PRODUCT
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Wed Apr 15 17:34:28 2015 -0700
@@ -1473,6 +1473,10 @@
 // called from signal handler. Before adding something to os::abort(), make
 // sure it is async-safe and can handle partially initialized VM.
 void os::abort(bool dump_core) {
+  abort(dump_core, NULL, NULL);
+}
+
+void os::abort(bool dump_core, void* siginfo, void* context) {
   os::shutdown();
   if (dump_core) {
 #ifndef PRODUCT
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Wed Apr 15 17:34:28 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
 #define IS_VALID_PID(p) (p > 0 && p < MAX_PID)
 
 // Check core dump limit and report possible place where core can be found
-void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) {
+void os::check_dump_limit(char* buffer, size_t bufferSize) {
   int n;
   struct rlimit rlim;
   bool success;
@@ -82,7 +82,7 @@
     }
   }
 
-  VMError::report_coredump_status(buffer, success);
+  VMError::record_coredump_status(buffer, success);
 }
 
 int os::get_native_stack(address* stack, int frames, int toSkip) {
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Apr 15 17:34:28 2015 -0700
@@ -1521,6 +1521,10 @@
 // called from signal handler. Before adding something to os::abort(), make
 // sure it is async-safe and can handle partially initialized VM.
 void os::abort(bool dump_core) {
+  abort(dump_core, NULL, NULL);
+}
+
+void os::abort(bool dump_core, void* siginfo, void* context) {
   os::shutdown();
   if (dump_core) {
 #ifndef PRODUCT
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Wed Apr 15 17:34:28 2015 -0700
@@ -987,7 +987,34 @@
                                          PMINIDUMP_USER_STREAM_INFORMATION,
                                          PMINIDUMP_CALLBACK_INFORMATION);
 
-void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) {
+static HANDLE dumpFile = NULL;
+
+// Check if dump file can be created.
+void os::check_dump_limit(char* buffer, size_t buffsz) {
+  bool status = true;
+  if (!FLAG_IS_DEFAULT(CreateCoredumpOnCrash) && !CreateCoredumpOnCrash) {
+    jio_snprintf(buffer, buffsz, "CreateCoredumpOnCrash is disabled from command line");
+    status = false;
+  } else {
+    const char* cwd = get_current_directory(NULL, 0);
+    int pid = current_process_id();
+    if (cwd != NULL) {
+      jio_snprintf(buffer, buffsz, "%s\\hs_err_pid%u.mdmp", cwd, pid);
+    } else {
+      jio_snprintf(buffer, buffsz, ".\\hs_err_pid%u.mdmp", pid);
+    }
+
+    if (dumpFile == NULL &&
+       (dumpFile = CreateFile(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL))
+                 == INVALID_HANDLE_VALUE) {
+      jio_snprintf(buffer, buffsz, "Failed to create minidump file (0x%x).", GetLastError());
+      status = false;
+    }
+  }
+  VMError::record_coredump_status(buffer, status);
+}
+
+void os::abort(bool dump_core, void* siginfo, void* context) {
   HINSTANCE dbghelp;
   EXCEPTION_POINTERS ep;
   MINIDUMP_EXCEPTION_INFORMATION mei;
@@ -995,33 +1022,22 @@
 
   HANDLE hProcess = GetCurrentProcess();
   DWORD processId = GetCurrentProcessId();
-  HANDLE dumpFile;
   MINIDUMP_TYPE dumpType;
-  static const char* cwd;
-
-// Default is to always create dump for debug builds, on product builds only dump on server versions of Windows.
-#ifndef ASSERT
-  // If running on a client version of Windows and user has not explicitly enabled dumping
-  if (!os::win32::is_windows_server() && !CreateMinidumpOnCrash) {
-    VMError::report_coredump_status("Minidumps are not enabled by default on client versions of Windows", false);
-    return;
-    // If running on a server version of Windows and user has explictly disabled dumping
-  } else if (os::win32::is_windows_server() && !FLAG_IS_DEFAULT(CreateMinidumpOnCrash) && !CreateMinidumpOnCrash) {
-    VMError::report_coredump_status("Minidump has been disabled from the command line", false);
-    return;
-  }
-#else
-  if (!FLAG_IS_DEFAULT(CreateMinidumpOnCrash) && !CreateMinidumpOnCrash) {
-    VMError::report_coredump_status("Minidump has been disabled from the command line", false);
-    return;
-  }
-#endif
+
+  shutdown();
+  if (!dump_core || dumpFile == NULL) {
+    if (dumpFile != NULL) {
+      CloseHandle(dumpFile);
+    }
+    win32::exit_process_or_thread(win32::EPT_PROCESS, 1);
+  }
 
   dbghelp = os::win32::load_Windows_dll("DBGHELP.DLL", NULL, 0);
 
   if (dbghelp == NULL) {
-    VMError::report_coredump_status("Failed to load dbghelp.dll", false);
-    return;
+    jio_fprintf(stderr, "Failed to load dbghelp.dll\n");
+    CloseHandle(dumpFile);
+    win32::exit_process_or_thread(win32::EPT_PROCESS, 1);
   }
 
   _MiniDumpWriteDump =
@@ -1033,30 +1049,23 @@
                                     "MiniDumpWriteDump"));
 
   if (_MiniDumpWriteDump == NULL) {
-    VMError::report_coredump_status("Failed to find MiniDumpWriteDump() in module dbghelp.dll", false);
-    return;
+    jio_fprintf(stderr, "Failed to find MiniDumpWriteDump() in module dbghelp.dll.\n");
+    CloseHandle(dumpFile);
+    win32::exit_process_or_thread(win32::EPT_PROCESS, 1);
   }
 
   dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData);
 
-// Older versions of dbghelp.h doesn't contain all the dumptypes we want, dbghelp.h with
-// API_VERSION_NUMBER 11 or higher contains the ones we want though
+  // Older versions of dbghelp.h do not contain all the dumptypes we want, dbghelp.h with
+  // API_VERSION_NUMBER 11 or higher contains the ones we want though
 #if API_VERSION_NUMBER >= 11
   dumpType = (MINIDUMP_TYPE)(dumpType | MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo |
                              MiniDumpWithUnloadedModules);
 #endif
 
-  cwd = get_current_directory(NULL, 0);
-  jio_snprintf(buffer, bufferSize, "%s\\hs_err_pid%u.mdmp", cwd, current_process_id());
-  dumpFile = CreateFile(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-
-  if (dumpFile == INVALID_HANDLE_VALUE) {
-    VMError::report_coredump_status("Failed to create file for dumping", false);
-    return;
-  }
-  if (exceptionRecord != NULL && contextRecord != NULL) {
-    ep.ContextRecord = (PCONTEXT) contextRecord;
-    ep.ExceptionRecord = (PEXCEPTION_RECORD) exceptionRecord;
+  if (siginfo != NULL && context != NULL) {
+    ep.ContextRecord = (PCONTEXT) context;
+    ep.ExceptionRecord = (PEXCEPTION_RECORD) siginfo;
 
     mei.ThreadId = GetCurrentThreadId();
     mei.ExceptionPointers = &ep;
@@ -1065,38 +1074,18 @@
     pmei = NULL;
   }
 
-
   // Older versions of dbghelp.dll (the one shipped with Win2003 for example) may not support all
   // the dump types we really want. If first call fails, lets fall back to just use MiniDumpWithFullMemory then.
   if (_MiniDumpWriteDump(hProcess, processId, dumpFile, dumpType, pmei, NULL, NULL) == false &&
       _MiniDumpWriteDump(hProcess, processId, dumpFile, (MINIDUMP_TYPE)MiniDumpWithFullMemory, pmei, NULL, NULL) == false) {
-    DWORD error = GetLastError();
-    LPTSTR msgbuf = NULL;
-
-    if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                      FORMAT_MESSAGE_FROM_SYSTEM |
-                      FORMAT_MESSAGE_IGNORE_INSERTS,
-                      NULL, error, 0, (LPTSTR)&msgbuf, 0, NULL) != 0) {
-
-      jio_snprintf(buffer, bufferSize, "Call to MiniDumpWriteDump() failed (Error 0x%x: %s)", error, msgbuf);
-      LocalFree(msgbuf);
-    } else {
-      // Call to FormatMessage failed, just include the result from GetLastError
-      jio_snprintf(buffer, bufferSize, "Call to MiniDumpWriteDump() failed (Error 0x%x)", error);
-    }
-    VMError::report_coredump_status(buffer, false);
-  } else {
-    VMError::report_coredump_status(buffer, true);
-  }
-
+    jio_fprintf(stderr, "Call to MiniDumpWriteDump() failed (Error 0x%x)\n", GetLastError());
+  }
   CloseHandle(dumpFile);
-}
-
+  win32::exit_process_or_thread(win32::EPT_PROCESS, 1);
+}
 
 void os::abort(bool dump_core) {
-  os::shutdown();
-  // no core dump on Windows
-  win32::exit_process_or_thread(win32::EPT_PROCESS, 1);
+  abort(dump_core, NULL, NULL);
 }
 
 // Die immediately, no exit hook, no abort hook, no cleanup.
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Apr 15 17:34:28 2015 -0700
@@ -3241,6 +3241,15 @@
           "ManagementServer is not supported in this VM.\n");
         return JNI_ERR;
 #endif // INCLUDE_MANAGEMENT
+    // CreateMinidumpOnCrash is removed, and replaced by CreateCoredumpOnCrash
+    } else if (match_option(option, "-XX:+CreateMinidumpOnCrash")) {
+      FLAG_SET_CMDLINE(bool, CreateCoredumpOnCrash, true);
+      jio_fprintf(defaultStream::output_stream(),
+          "CreateMinidumpOnCrash is replaced by CreateCoredumpOnCrash: CreateCoredumpOnCrash is on\n");
+    } else if (match_option(option, "-XX:-CreateMinidumpOnCrash")) {
+      FLAG_SET_CMDLINE(bool, CreateCoredumpOnCrash, false);
+      jio_fprintf(defaultStream::output_stream(),
+          "CreateMinidumpOnCrash is replaced by CreateCoredumpOnCrash: CreateCoredumpOnCrash is off\n");
     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
       // Skip -XX:Flags= since that case has already been handled
       if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Apr 15 17:34:28 2015 -0700
@@ -936,8 +936,8 @@
   product(bool, ShowMessageBoxOnError, false,                               \
           "Keep process alive on VM fatal error")                           \
                                                                             \
-  product(bool, CreateMinidumpOnCrash, false,                               \
-          "Create minidump on VM fatal error")                              \
+  product(bool, CreateCoredumpOnCrash, true,                                \
+          "Create core/mini dump on VM fatal error")                        \
                                                                             \
   product_pd(bool, UseOSErrorReporting,                                     \
           "Let VM fatal error propagate to the OS (ie. WER on Windows)")    \
--- a/hotspot/src/share/vm/runtime/os.hpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/share/vm/runtime/os.hpp	Wed Apr 15 17:34:28 2015 -0700
@@ -492,6 +492,7 @@
 
   // Terminate with an error.  Default is to generate a core file on platforms
   // that support such things.  This calls shutdown() and then aborts.
+  static void abort(bool dump_core, void *siginfo, void *context);
   static void abort(bool dump_core = true);
 
   // Die immediately, no exit hook, no abort hook, no cleanup.
@@ -716,8 +717,13 @@
   // Structured OS Exception support
   static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
 
-  // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits
-  static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize);
+  // On Posix compatible OS it will simply check core dump limits while on Windows
+  // it will check if dump file can be created. Check or prepare a core dump to be
+  // taken at a later point in the same thread in os::abort(). Use the caller
+  // provided buffer as a scratch buffer. The status message which will be written
+  // into the error log either is file location or a short error message, depending
+  // on the checking result.
+  static void check_dump_limit(char* buffer, size_t bufferSize);
 
   // Get the default path to the core file
   // Returns the length of the string
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Wed Apr 15 17:34:28 2015 -0700
@@ -217,7 +217,7 @@
 bool VMError::coredump_status;
 char VMError::coredump_message[O_BUFLEN];
 
-void VMError::report_coredump_status(const char* message, bool status) {
+void VMError::record_coredump_status(const char* message, bool status) {
   coredump_status = status;
   strncpy(coredump_message, message, sizeof(coredump_message));
   coredump_message[sizeof(coredump_message)-1] = 0;
@@ -525,10 +525,14 @@
      }
   STEP(63, "(printing core file information)")
     st->print("# ");
-    if (coredump_status) {
-      st->print("Core dump written. Default location: %s", coredump_message);
+    if (CreateCoredumpOnCrash) {
+      if (coredump_status) {
+        st->print("Core dump will be written. %s", coredump_message);
+      } else {
+        st->print("No core dump will be written. %s", coredump_message);
+      }
     } else {
-      st->print("Failed to write core dump. %s", coredump_message);
+      st->print("CreateCoredumpOnCrash turned off, no core file dumped");
     }
     st->cr();
     st->print_cr("#");
@@ -918,7 +922,7 @@
   static bool transmit_report_done = false; // done error reporting
 
   if (SuppressFatalErrorMessage) {
-      os::abort();
+      os::abort(CreateCoredumpOnCrash);
   }
   jlong mytid = os::current_thread_id();
   if (first_error == NULL &&
@@ -936,8 +940,7 @@
       ShowMessageBoxOnError = false;
     }
 
-    // Write a minidump on Windows, check core dump limits on Linux/Solaris
-    os::check_or_create_dump(_siginfo, _context, buffer, sizeof(buffer));
+    os::check_dump_limit(buffer, sizeof(buffer));
 
     // reset signal handlers or exception filter; make sure recursive crashes
     // are handled properly.
@@ -1108,7 +1111,7 @@
     if (!skip_os_abort) {
       skip_os_abort = true;
       bool dump_core = should_report_bug(first_error->_id);
-      os::abort(dump_core);
+      os::abort(dump_core && CreateCoredumpOnCrash, _siginfo, _context);
     }
 
     // if os::abort() doesn't abort, try os::die();
--- a/hotspot/src/share/vm/utilities/vmError.hpp	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.hpp	Wed Apr 15 17:34:28 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -117,8 +117,8 @@
   // return a string to describe the error
   char *error_string(char* buf, int buflen);
 
-  // Report status of core/minidump
-  static void report_coredump_status(const char* message, bool status);
+  // Record status of core/minidump
+  static void record_coredump_status(const char* message, bool status);
 
   // main error reporting function
   void report_and_die();
--- a/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java	Wed Apr 15 17:34:28 2015 -0700
@@ -48,7 +48,7 @@
 
     public static void main(String[] args) throws Exception {
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-            "-Xmx64m", "-XX:-TransmitErrorReport", "-XX:-CreateMinidumpOnCrash", Crasher.class.getName());
+            "-Xmx64m", "-XX:-TransmitErrorReport", "-XX:-CreateCoredumpOnCrash", Crasher.class.getName());
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         output.shouldNotMatch("error occurred during error reporting \\(printing problematic frame\\)");
     }
--- a/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java	Wed Apr 15 17:34:28 2015 -0700
@@ -53,6 +53,7 @@
         "-Xmx100M",
         "-XX:ErrorHandlerTest=14",
         "-XX:+TestSafeFetchInErrorHandler",
+        "-XX:-CreateCoredumpOnCrash",
         "-version");
 
     OutputAnalyzer output_detail = new OutputAnalyzer(pb.start());
--- a/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java	Wed Apr 15 17:34:28 2015 -0700
@@ -1,12 +1,26 @@
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-import java.util.regex.Pattern;
+/*
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
 
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
 
 /*
  * @test
@@ -18,6 +32,16 @@
  *          java.management
  */
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.util.regex.Pattern;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.Platform;
+import com.oracle.java.testlibrary.ProcessTools;
+
 public class SecondaryErrorTest {
 
 
@@ -35,6 +59,7 @@
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
         "-XX:+UnlockDiagnosticVMOptions",
         "-Xmx100M",
+        "-XX:-CreateCoredumpOnCrash",
         "-XX:ErrorHandlerTest=15",
         "-XX:TestCrashInErrorHandler=14",
         "-version");
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java	Wed Apr 15 17:34:28 2015 -0700
@@ -49,7 +49,7 @@
                   "-XX:+UnlockDiagnosticVMOptions",
                   "-XX:+WhiteBoxAPI",
                   "-XX:-TransmitErrorReport",
-                  "-XX:-CreateMinidumpOnCrash",
+                  "-XX:-CreateCoredumpOnCrash",
                   "-Xmx32m",
                   "AssertSafepointCheckConsistency1",
                   "test");
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java	Wed Apr 15 17:34:28 2015 -0700
@@ -49,7 +49,7 @@
                   "-XX:+UnlockDiagnosticVMOptions",
                   "-XX:+WhiteBoxAPI",
                   "-XX:-TransmitErrorReport",
-                  "-XX:-CreateMinidumpOnCrash",
+                  "-XX:-CreateCoredumpOnCrash",
                   "-Xmx32m",
                   "AssertSafepointCheckConsistency2",
                   "test");
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java	Wed Apr 15 17:34:28 2015 -0700
@@ -49,7 +49,7 @@
                   "-XX:+UnlockDiagnosticVMOptions",
                   "-XX:+WhiteBoxAPI",
                   "-XX:-TransmitErrorReport",
-                  "-XX:-CreateMinidumpOnCrash",
+                  "-XX:-CreateCoredumpOnCrash",
                   "-Xmx32m",
                   "AssertSafepointCheckConsistency3",
                   "test");
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java	Wed Apr 15 17:34:28 2015 -0700
@@ -49,7 +49,7 @@
                "-XX:+UnlockDiagnosticVMOptions",
                "-XX:+WhiteBoxAPI",
                "-XX:-TransmitErrorReport",
-               "-XX:-CreateMinidumpOnCrash",
+               "-XX:-CreateCoredumpOnCrash",
                "-Xmx32m",
                "AssertSafepointCheckConsistency4",
                "test");
--- a/hotspot/test/runtime/Unsafe/RangeCheck.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/Unsafe/RangeCheck.java	Wed Apr 15 17:34:28 2015 -0700
@@ -45,6 +45,7 @@
                 true,
                 "-Xmx32m",
                 "-XX:-TransmitErrorReport",
+                "-XX:-CreateCoredumpOnCrash",
                 "-XX:-InlineUnsafeOps", // The compiler intrinsics doesn't have the assert
                 DummyClassWithMainRangeCheck.class.getName());
 
--- a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java	Wed Apr 15 09:34:46 2015 +0200
+++ b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java	Wed Apr 15 17:34:28 2015 -0700
@@ -50,6 +50,7 @@
           "-XX:+WhiteBoxAPI",
           "-XX:+UseCompressedOops",
           "-XX:HeapBaseMinAddress=33G",
+          "-XX:-CreateCoredumpOnCrash",
           "-Xmx32m",
           DummyClassWithMainTryingToReadFromNoaccessArea.class.getName());