8155639: Remove STEP numbers from error reporting

Reviewed-by: coleenp, twisti
This commit is contained in:
Thomas Stuefe 2016-04-28 15:40:45 +02:00
parent c7d1cae645
commit af168abecc

View file

@ -290,8 +290,8 @@ const char* VMError::_current_step_info;
void VMError::report(outputStream* st, bool _verbose) { void VMError::report(outputStream* st, bool _verbose) {
# define BEGIN if (_current_step == 0) { _current_step = 1; # define BEGIN if (_current_step == 0) { _current_step = __LINE__;
# define STEP(n, s) } if (_current_step < n) { _current_step = n; _current_step_info = s; # define STEP(s) } if (_current_step < __LINE__) { _current_step = __LINE__; _current_step_info = s;
# define END } # define END }
// don't allocate large buffer on stack // don't allocate large buffer on stack
@ -299,7 +299,7 @@ void VMError::report(outputStream* st, bool _verbose) {
BEGIN BEGIN
STEP(10, "(printing fatal error message)") STEP("printing fatal error message")
st->print_cr("#"); st->print_cr("#");
if (should_report_bug(_id)) { if (should_report_bug(_id)) {
@ -314,21 +314,21 @@ void VMError::report(outputStream* st, bool _verbose) {
// test secondary error handling. Test it twice, to test that resetting // test secondary error handling. Test it twice, to test that resetting
// error handler after a secondary crash works. // error handler after a secondary crash works.
STEP(20, "(test secondary crash 1)") STEP("test secondary crash 1")
if (_verbose && TestCrashInErrorHandler != 0) { if (_verbose && TestCrashInErrorHandler != 0) {
st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...", st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
TestCrashInErrorHandler); TestCrashInErrorHandler);
controlled_crash(TestCrashInErrorHandler); controlled_crash(TestCrashInErrorHandler);
} }
STEP(30, "(test secondary crash 2)") STEP("test secondary crash 2")
if (_verbose && TestCrashInErrorHandler != 0) { if (_verbose && TestCrashInErrorHandler != 0) {
st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...", st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
TestCrashInErrorHandler); TestCrashInErrorHandler);
controlled_crash(TestCrashInErrorHandler); controlled_crash(TestCrashInErrorHandler);
} }
STEP(40, "(test safefetch in error handler)") STEP("test safefetch in error handler")
// test whether it is safe to use SafeFetch32 in Crash Handler. Test twice // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice
// to test that resetting the signal handler works correctly. // to test that resetting the signal handler works correctly.
if (_verbose && TestSafeFetchInErrorHandler) { if (_verbose && TestSafeFetchInErrorHandler) {
@ -349,7 +349,7 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
#endif // PRODUCT #endif // PRODUCT
STEP(50, "(printing type of error)") STEP("printing type of error")
switch(_id) { switch(_id) {
case OOM_MALLOC_ERROR: case OOM_MALLOC_ERROR:
@ -384,7 +384,7 @@ void VMError::report(outputStream* st, bool _verbose) {
break; break;
} }
STEP(60, "(printing exception/signal name)") STEP("printing exception/signal name")
st->print_cr("#"); st->print_cr("#");
st->print("# "); st->print("# ");
@ -414,14 +414,14 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
} }
STEP(70, "(printing current thread and pid)") STEP("printing current thread and pid")
// process id, thread id // process id, thread id
st->print(", pid=%d", os::current_process_id()); st->print(", pid=%d", os::current_process_id());
st->print(", tid=" UINTX_FORMAT, os::current_thread_id()); st->print(", tid=" UINTX_FORMAT, os::current_thread_id());
st->cr(); st->cr();
STEP(80, "(printing error message)") STEP("printing error message")
if (should_report_bug(_id)) { // already printed the message. if (should_report_bug(_id)) { // already printed the message.
// error message // error message
@ -432,11 +432,11 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
} }
STEP(90, "(printing Java version string)") STEP("printing Java version string")
report_vm_version(st, buf, sizeof(buf)); report_vm_version(st, buf, sizeof(buf));
STEP(100, "(printing problematic frame)") STEP("printing problematic frame")
// Print current frame if we have a context (i.e. it's a crash) // Print current frame if we have a context (i.e. it's a crash)
if (_context) { if (_context) {
@ -448,7 +448,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->print_cr("#"); st->print_cr("#");
} }
STEP(110, "(printing core file information)") STEP("printing core file information")
st->print("# "); st->print("# ");
if (CreateCoredumpOnCrash) { if (CreateCoredumpOnCrash) {
if (coredump_status) { if (coredump_status) {
@ -462,13 +462,13 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
st->print_cr("#"); st->print_cr("#");
STEP(120, "(printing bug submit message)") STEP("printing bug submit message")
if (should_report_bug(_id) && _verbose) { if (should_report_bug(_id) && _verbose) {
print_bug_submit_message(st, _thread); print_bug_submit_message(st, _thread);
} }
STEP(130, "(printing summary)" ) STEP("printing summary")
if (_verbose) { if (_verbose) {
st->cr(); st->cr();
@ -476,7 +476,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(140, "(printing VM option summary)" ) STEP("printing VM option summary")
if (_verbose) { if (_verbose) {
// VM options // VM options
@ -484,20 +484,20 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(150, "(printing summary machine and OS info)") STEP("printing summary machine and OS info")
if (_verbose) { if (_verbose) {
os::print_summary_info(st, buf, sizeof(buf)); os::print_summary_info(st, buf, sizeof(buf));
} }
STEP(160, "(printing date and time)" ) STEP("printing date and time")
if (_verbose) { if (_verbose) {
os::print_date_and_time(st, buf, sizeof(buf)); os::print_date_and_time(st, buf, sizeof(buf));
} }
STEP(170, "(printing thread)" ) STEP("printing thread")
if (_verbose) { if (_verbose) {
st->cr(); st->cr();
@ -505,7 +505,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(180, "(printing current thread)" ) STEP("printing current thread")
// current thread // current thread
if (_verbose) { if (_verbose) {
@ -519,7 +519,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(190, "(printing current compile task)" ) STEP("printing current compile task")
if (_verbose && _thread && _thread->is_Compiler_thread()) { if (_verbose && _thread && _thread->is_Compiler_thread()) {
CompilerThread* t = (CompilerThread*)_thread; CompilerThread* t = (CompilerThread*)_thread;
@ -532,7 +532,7 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
STEP(200, "(printing stack bounds)" ) STEP("printing stack bounds")
if (_verbose) { if (_verbose) {
st->print("Stack: "); st->print("Stack: ");
@ -563,7 +563,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(210, "(printing native stack)" ) STEP("printing native stack")
if (_verbose) { if (_verbose) {
if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) { if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) {
@ -577,13 +577,13 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
} }
STEP(220, "(printing Java stack)" ) STEP("printing Java stack")
if (_verbose && _thread && _thread->is_Java_thread()) { if (_verbose && _thread && _thread->is_Java_thread()) {
print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf)); print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf));
} }
STEP(230, "(printing target Java thread stack)" ) STEP("printing target Java thread stack")
// printing Java thread stack trace if it is involved in GC crash // printing Java thread stack trace if it is involved in GC crash
if (_verbose && _thread && (_thread->is_Named_thread())) { if (_verbose && _thread && (_thread->is_Named_thread())) {
@ -594,7 +594,7 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
} }
STEP(240, "(printing siginfo)" ) STEP("printing siginfo")
// signal no, signal code, address that caused the fault // signal no, signal code, address that caused the fault
if (_verbose && _siginfo) { if (_verbose && _siginfo) {
@ -603,7 +603,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(245, "(CDS archive access warning)" ) STEP("CDS archive access warning")
// Print an explicit hint if we crashed on access to the CDS archive. // Print an explicit hint if we crashed on access to the CDS archive.
if (_verbose && _siginfo) { if (_verbose && _siginfo) {
@ -611,7 +611,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(250, "(printing register info)") STEP("printing register info")
// decode register contents if possible // decode register contents if possible
if (_verbose && _context && Universe::is_fully_initialized()) { if (_verbose && _context && Universe::is_fully_initialized()) {
@ -619,7 +619,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(260, "(printing registers, top of stack, instructions near pc)") STEP("printing registers, top of stack, instructions near pc")
// registers, top of stack, instructions near pc // registers, top of stack, instructions near pc
if (_verbose && _context) { if (_verbose && _context) {
@ -627,7 +627,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(265, "(printing code blob if possible)") STEP("printing code blob if possible")
if (_verbose && _context) { if (_verbose && _context) {
CodeBlob* cb = CodeCache::find_blob(_pc); CodeBlob* cb = CodeCache::find_blob(_pc);
@ -652,7 +652,7 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
} }
STEP(270, "(printing VM operation)" ) STEP("printing VM operation")
if (_verbose && _thread && _thread->is_VM_thread()) { if (_verbose && _thread && _thread->is_VM_thread()) {
VMThread* t = (VMThread*)_thread; VMThread* t = (VMThread*)_thread;
@ -664,7 +664,7 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
} }
STEP(280, "(printing process)" ) STEP("printing process")
if (_verbose) { if (_verbose) {
st->cr(); st->cr();
@ -672,7 +672,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(290, "(printing all threads)" ) STEP("printing all threads")
// all threads // all threads
if (_verbose && _thread) { if (_verbose && _thread) {
@ -680,7 +680,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(300, "(printing VM state)" ) STEP("printing VM state")
if (_verbose) { if (_verbose) {
// Safepoint state // Safepoint state
@ -702,7 +702,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(310, "(printing owned locks on error)" ) STEP("printing owned locks on error")
// mutexes/monitors that currently have an owner // mutexes/monitors that currently have an owner
if (_verbose) { if (_verbose) {
@ -710,7 +710,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(320, "(printing number of OutOfMemoryError and StackOverflow exceptions)") STEP("printing number of OutOfMemoryError and StackOverflow exceptions")
if (_verbose && Exceptions::has_exception_counts()) { if (_verbose && Exceptions::has_exception_counts()) {
st->print_cr("OutOfMemory and StackOverflow Exception counts:"); st->print_cr("OutOfMemory and StackOverflow Exception counts:");
@ -718,7 +718,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(330, "(printing compressed oops mode") STEP("printing compressed oops mode")
if (_verbose && UseCompressedOops) { if (_verbose && UseCompressedOops) {
Universe::print_compressed_oops_mode(st); Universe::print_compressed_oops_mode(st);
@ -728,7 +728,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(340, "(printing heap information)" ) STEP("printing heap information")
if (_verbose && Universe::is_fully_initialized()) { if (_verbose && Universe::is_fully_initialized()) {
Universe::heap()->print_on_error(st); Universe::heap()->print_on_error(st);
@ -737,7 +737,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(350, "(printing code cache information)" ) STEP("printing code cache information")
if (_verbose && Universe::is_fully_initialized()) { if (_verbose && Universe::is_fully_initialized()) {
// print code cache information before vm abort // print code cache information before vm abort
@ -745,14 +745,14 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(360, "(printing ring buffers)" ) STEP("printing ring buffers")
if (_verbose) { if (_verbose) {
Events::print_all(st); Events::print_all(st);
st->cr(); st->cr();
} }
STEP(370, "(printing dynamic libraries)" ) STEP("printing dynamic libraries")
if (_verbose) { if (_verbose) {
// dynamic libraries, or memory map // dynamic libraries, or memory map
@ -760,7 +760,7 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(380, "(printing VM options)" ) STEP("printing VM options")
if (_verbose) { if (_verbose) {
// VM options // VM options
@ -768,40 +768,40 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(390, "(printing warning if internal testing API used)" ) STEP("printing warning if internal testing API used")
if (WhiteBox::used()) { if (WhiteBox::used()) {
st->print_cr("Unsupported internal testing APIs have been used."); st->print_cr("Unsupported internal testing APIs have been used.");
st->cr(); st->cr();
} }
STEP(395, "(printing log configuration)") STEP("printing log configuration")
if (_verbose){ if (_verbose){
st->print_cr("Logging:"); st->print_cr("Logging:");
LogConfiguration::describe_current_configuration(st); LogConfiguration::describe_current_configuration(st);
st->cr(); st->cr();
} }
STEP(400, "(printing all environment variables)" ) STEP("printing all environment variables")
if (_verbose) { if (_verbose) {
os::print_environment_variables(st, env_list); os::print_environment_variables(st, env_list);
st->cr(); st->cr();
} }
STEP(410, "(printing signal handlers)" ) STEP("printing signal handlers")
if (_verbose) { if (_verbose) {
os::print_signal_handlers(st, buf, sizeof(buf)); os::print_signal_handlers(st, buf, sizeof(buf));
st->cr(); st->cr();
} }
STEP(420, "(Native Memory Tracking)" ) STEP("Native Memory Tracking")
if (_verbose) { if (_verbose) {
MemTracker::error_report(st); MemTracker::error_report(st);
} }
STEP(430, "(printing system)" ) STEP("printing system")
if (_verbose) { if (_verbose) {
st->cr(); st->cr();
@ -809,27 +809,27 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP(440, "(printing OS information)" ) STEP("printing OS information")
if (_verbose) { if (_verbose) {
os::print_os_info(st); os::print_os_info(st);
st->cr(); st->cr();
} }
STEP(450, "(printing CPU info)" ) STEP("printing CPU info")
if (_verbose) { if (_verbose) {
os::print_cpu_info(st, buf, sizeof(buf)); os::print_cpu_info(st, buf, sizeof(buf));
st->cr(); st->cr();
} }
STEP(460, "(printing memory info)" ) STEP("printing memory info")
if (_verbose) { if (_verbose) {
os::print_memory_info(st); os::print_memory_info(st);
st->cr(); st->cr();
} }
STEP(470, "(printing internal vm info)" ) STEP("printing internal vm info")
if (_verbose) { if (_verbose) {
st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string()); st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
@ -837,7 +837,7 @@ void VMError::report(outputStream* st, bool _verbose) {
} }
// print a defined marker to show that error handling finished correctly. // print a defined marker to show that error handling finished correctly.
STEP(480, "(printing end marker)" ) STEP("printing end marker")
if (_verbose) { if (_verbose) {
st->print_cr("END."); st->print_cr("END.");
@ -858,35 +858,35 @@ void VMError::print_vm_info(outputStream* st) {
char buf[O_BUFLEN]; char buf[O_BUFLEN];
report_vm_version(st, buf, sizeof(buf)); report_vm_version(st, buf, sizeof(buf));
// STEP("(printing summary)") // STEP("printing summary")
st->cr(); st->cr();
st->print_cr("--------------- S U M M A R Y ------------"); st->print_cr("--------------- S U M M A R Y ------------");
st->cr(); st->cr();
// STEP("(printing VM option summary)") // STEP("printing VM option summary")
// VM options // VM options
Arguments::print_summary_on(st); Arguments::print_summary_on(st);
st->cr(); st->cr();
// STEP("(printing summary machine and OS info)") // STEP("printing summary machine and OS info")
os::print_summary_info(st, buf, sizeof(buf)); os::print_summary_info(st, buf, sizeof(buf));
// STEP("(printing date and time)") // STEP("printing date and time")
os::print_date_and_time(st, buf, sizeof(buf)); os::print_date_and_time(st, buf, sizeof(buf));
// Skip: STEP("(printing thread)") // Skip: STEP("printing thread")
// STEP("(printing process)") // STEP("printing process")
st->cr(); st->cr();
st->print_cr("--------------- P R O C E S S ---------------"); st->print_cr("--------------- P R O C E S S ---------------");
st->cr(); st->cr();
// STEP("(printing number of OutOfMemoryError and StackOverflow exceptions)") // STEP("printing number of OutOfMemoryError and StackOverflow exceptions")
if (Exceptions::has_exception_counts()) { if (Exceptions::has_exception_counts()) {
st->print_cr("OutOfMemory and StackOverflow Exception counts:"); st->print_cr("OutOfMemory and StackOverflow Exception counts:");
@ -894,7 +894,7 @@ void VMError::print_vm_info(outputStream* st) {
st->cr(); st->cr();
} }
// STEP("(printing compressed oops mode") // STEP("printing compressed oops mode")
if (UseCompressedOops) { if (UseCompressedOops) {
Universe::print_compressed_oops_mode(st); Universe::print_compressed_oops_mode(st);
@ -904,7 +904,7 @@ void VMError::print_vm_info(outputStream* st) {
st->cr(); st->cr();
} }
// STEP("(printing heap information)") // STEP("printing heap information")
if (Universe::is_fully_initialized()) { if (Universe::is_fully_initialized()) {
Universe::heap()->print_on_error(st); Universe::heap()->print_on_error(st);
@ -913,7 +913,7 @@ void VMError::print_vm_info(outputStream* st) {
st->cr(); st->cr();
} }
// STEP("(printing code cache information)") // STEP("printing code cache information")
if (Universe::is_fully_initialized()) { if (Universe::is_fully_initialized()) {
// print code cache information before vm abort // print code cache information before vm abort
@ -921,77 +921,77 @@ void VMError::print_vm_info(outputStream* st) {
st->cr(); st->cr();
} }
// STEP("(printing ring buffers)") // STEP("printing ring buffers")
Events::print_all(st); Events::print_all(st);
st->cr(); st->cr();
// STEP("(printing dynamic libraries)") // STEP("printing dynamic libraries")
// dynamic libraries, or memory map // dynamic libraries, or memory map
os::print_dll_info(st); os::print_dll_info(st);
st->cr(); st->cr();
// STEP("(printing VM options)") // STEP("printing VM options")
// VM options // VM options
Arguments::print_on(st); Arguments::print_on(st);
st->cr(); st->cr();
// STEP("(printing warning if internal testing API used)") // STEP("printing warning if internal testing API used")
if (WhiteBox::used()) { if (WhiteBox::used()) {
st->print_cr("Unsupported internal testing APIs have been used."); st->print_cr("Unsupported internal testing APIs have been used.");
st->cr(); st->cr();
} }
// STEP("(printing log configuration)") // STEP("printing log configuration")
st->print_cr("Logging:"); st->print_cr("Logging:");
LogConfiguration::describe(st); LogConfiguration::describe(st);
st->cr(); st->cr();
// STEP("(printing all environment variables)") // STEP("printing all environment variables")
os::print_environment_variables(st, env_list); os::print_environment_variables(st, env_list);
st->cr(); st->cr();
// STEP("(printing signal handlers)") // STEP("printing signal handlers")
os::print_signal_handlers(st, buf, sizeof(buf)); os::print_signal_handlers(st, buf, sizeof(buf));
st->cr(); st->cr();
// STEP("(Native Memory Tracking)") // STEP("Native Memory Tracking")
MemTracker::error_report(st); MemTracker::error_report(st);
// STEP("(printing system)") // STEP("printing system")
st->cr(); st->cr();
st->print_cr("--------------- S Y S T E M ---------------"); st->print_cr("--------------- S Y S T E M ---------------");
st->cr(); st->cr();
// STEP("(printing OS information)") // STEP("printing OS information")
os::print_os_info(st); os::print_os_info(st);
st->cr(); st->cr();
// STEP("(printing CPU info)") // STEP("printing CPU info")
os::print_cpu_info(st, buf, sizeof(buf)); os::print_cpu_info(st, buf, sizeof(buf));
st->cr(); st->cr();
// STEP("(printing memory info)") // STEP("printing memory info")
os::print_memory_info(st); os::print_memory_info(st);
st->cr(); st->cr();
// STEP("(printing internal vm info)") // STEP("printing internal vm info")
st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string()); st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
st->cr(); st->cr();
// print a defined marker to show that error handling finished correctly. // print a defined marker to show that error handling finished correctly.
// STEP("(printing end marker)") // STEP("printing end marker")
st->print_cr("END."); st->print_cr("END.");
} }
@ -1190,7 +1190,7 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt
} }
jio_snprintf(buffer, sizeof(buffer), jio_snprintf(buffer, sizeof(buffer),
"[error occurred during error reporting %s, id 0x%x]", "[error occurred during error reporting (%s), id 0x%x]",
_current_step_info, _id); _current_step_info, _id);
if (log.is_open()) { if (log.is_open()) {
log.cr(); log.cr();