changeset 51506:308410473abe

8205925: Print correct and more information about secondary errors Reviewed-by: coleenp, dholmes
author stuefe
date Thu, 28 Jun 2018 11:32:32 +0200
parents d283a214f42b
children ce53844224b6
files src/hotspot/share/utilities/vmError.cpp
diffstat 1 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/utilities/vmError.cpp	Wed Jun 27 15:04:27 2018 +0200
+++ b/src/hotspot/share/utilities/vmError.cpp	Thu Jun 28 11:32:32 2018 +0200
@@ -1385,9 +1385,24 @@
         os::infinite_sleep();
       } else {
         // Crash or assert during error reporting. Lets continue reporting with the next step.
-        jio_snprintf(buffer, sizeof(buffer),
-           "[error occurred during error reporting (%s), id 0x%x]",
-                   _current_step_info, _id);
+        stringStream ss(buffer, sizeof(buffer));
+        // Note: this string does get parsed by a number of jtreg tests,
+        // see hotspot/jtreg/runtime/ErrorHandling.
+        ss.print("[error occurred during error reporting (%s), id 0x%x",
+                   _current_step_info, id);
+        char signal_name[64];
+        if (os::exception_name(id, signal_name, sizeof(signal_name))) {
+          ss.print(", %s (0x%x) at pc=" PTR_FORMAT, signal_name, id, p2i(pc));
+        } else {
+          if (should_report_bug(id)) {
+            ss.print(", Internal Error (%s:%d)",
+              filename == NULL ? "??" : filename, lineno);
+          } else {
+            ss.print(", Out of Memory Error (%s:%d)",
+              filename == NULL ? "??" : filename, lineno);
+          }
+        }
+        ss.print("]");
         st->print_raw_cr(buffer);
         st->cr();
       }