src/share/vm/utilities/vmError.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8026324.01 Cdiff src/share/vm/utilities/vmError.cpp

src/share/vm/utilities/vmError.cpp

Print this page

        

*** 304,313 **** --- 304,337 ---- } } #endif // ZERO } + void VMError::print_oom_reasons(outputStream* st) { + st->print_cr("# Possible reasons:"); + st->print_cr("# The system is out of physical RAM or swap space"); + st->print_cr("# In 32 bit mode, the process size limit was hit"); + st->print_cr("# Possible solutions:"); + st->print_cr("# Reduce memory load on the system"); + st->print_cr("# Increase physical memory or swap space"); + st->print_cr("# Check if swap backing store is full"); + st->print_cr("# Use 64 bit Java on a 64 bit OS"); + st->print_cr("# Decrease Java heap size (-Xmx/-Xms)"); + st->print_cr("# Decrease number of Java threads"); + st->print_cr("# Decrease Java thread stack sizes (-Xss)"); + st->print_cr("# Set larger code cache with -XX:ReservedCodeCacheSize="); + st->print_cr("# This output file may be truncated or incomplete."); + } + + const char* VMError::gc_mode() { + if (UseG1GC) return "g1 gc"; + if (UseParallelGC) return "parallel gc"; + if (UseConcMarkSweepGC) return "concurrent mark sweep gc"; + if (UseSerialGC) return "serial gc"; + return "ERROR in GC mode"; + } + // This is the main function to report a fatal error. Only one thread can // call this function, so we don't need to worry about MT-safety. But it's // possible that the error handler itself may crash or die on an internal // error, for example, when the stack/heap is badly damaged. We must be // able to handle recursive errors that happen inside error handler.
*** 356,380 **** #ifndef PRODUCT // Error handler self tests // test secondary error handling. Test it twice, to test that resetting // error handler after a secondary crash works. ! STEP(11, "(test secondary crash 1)") if (_verbose && TestCrashInErrorHandler != 0) { st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...", TestCrashInErrorHandler); controlled_crash(TestCrashInErrorHandler); } ! STEP(12, "(test secondary crash 2)") if (_verbose && TestCrashInErrorHandler != 0) { st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...", TestCrashInErrorHandler); controlled_crash(TestCrashInErrorHandler); } ! STEP(13, "(test safefetch in error handler)") // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice // to test that resetting the signal handler works correctly. if (_verbose && TestSafeFetchInErrorHandler) { st->print_cr("Will test SafeFetch..."); if (CanUseSafeFetch32()) { --- 380,404 ---- #ifndef PRODUCT // Error handler self tests // test secondary error handling. Test it twice, to test that resetting // error handler after a secondary crash works. ! STEP(20, "(test secondary crash 1)") if (_verbose && TestCrashInErrorHandler != 0) { st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...", TestCrashInErrorHandler); controlled_crash(TestCrashInErrorHandler); } ! STEP(30, "(test secondary crash 2)") if (_verbose && TestCrashInErrorHandler != 0) { st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...", TestCrashInErrorHandler); controlled_crash(TestCrashInErrorHandler); } ! STEP(40, "(test safefetch in error handler)") // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice // to test that resetting the signal handler works correctly. if (_verbose && TestSafeFetchInErrorHandler) { st->print_cr("Will test SafeFetch..."); if (CanUseSafeFetch32()) {
*** 391,401 **** st->print_cr("not possible; skipped."); } } #endif // PRODUCT ! STEP(15, "(printing type of error)") switch(_id) { case OOM_MALLOC_ERROR: case OOM_MMAP_ERROR: if (_size) { --- 415,425 ---- st->print_cr("not possible; skipped."); } } #endif // PRODUCT ! STEP(50, "(printing type of error)") switch(_id) { case OOM_MALLOC_ERROR: case OOM_MMAP_ERROR: if (_size) {
*** 416,448 **** st->print_cr("%s", _message); } } // In error file give some solutions if (_verbose) { ! st->print_cr("# Possible reasons:"); ! st->print_cr("# The system is out of physical RAM or swap space"); ! st->print_cr("# In 32 bit mode, the process size limit was hit"); ! st->print_cr("# Possible solutions:"); ! st->print_cr("# Reduce memory load on the system"); ! st->print_cr("# Increase physical memory or swap space"); ! st->print_cr("# Check if swap backing store is full"); ! st->print_cr("# Use 64 bit Java on a 64 bit OS"); ! st->print_cr("# Decrease Java heap size (-Xmx/-Xms)"); ! st->print_cr("# Decrease number of Java threads"); ! st->print_cr("# Decrease Java thread stack sizes (-Xss)"); ! st->print_cr("# Set larger code cache with -XX:ReservedCodeCacheSize="); ! st->print_cr("# This output file may be truncated or incomplete."); } else { return; // that's enough for the screen } break; case INTERNAL_ERROR: default: break; } ! STEP(20, "(printing exception/signal name)") st->print_cr("#"); st->print("# "); // Is it an OS exception/signal? if (os::exception_name(_id, buf, sizeof(buf))) { --- 440,460 ---- st->print_cr("%s", _message); } } // In error file give some solutions if (_verbose) { ! print_oom_reasons(st); } else { return; // that's enough for the screen } break; case INTERNAL_ERROR: default: break; } ! STEP(60, "(printing exception/signal name)") st->print_cr("#"); st->print("# "); // Is it an OS exception/signal? if (os::exception_name(_id, buf, sizeof(buf))) {
*** 468,525 **** } else { st->print(" (0x%x)", _id); } } ! STEP(30, "(printing current thread and pid)") // process id, thread id st->print(", pid=%d", os::current_process_id()); st->print(", tid=" INTPTR_FORMAT, os::current_thread_id()); st->cr(); ! STEP(40, "(printing error message)") if (should_report_bug(_id)) { // already printed the message. // error message if (_detail_msg) { st->print_cr("# %s: %s", _message ? _message : "Error", _detail_msg); } else if (_message) { st->print_cr("# Error: %s", _message); } } ! STEP(50, "(printing Java version string)") // VM version st->print_cr("#"); JDK_Version::current().to_string(buf, sizeof(buf)); const char* runtime_name = JDK_Version::runtime_name() != NULL ? JDK_Version::runtime_name() : ""; const char* runtime_version = JDK_Version::runtime_version() != NULL ? JDK_Version::runtime_version() : ""; st->print_cr("# JRE version: %s (%s) (build %s)", runtime_name, buf, runtime_version); ! st->print_cr("# Java VM: %s (%s %s %s %s)", Abstract_VM_Version::vm_name(), Abstract_VM_Version::vm_release(), Abstract_VM_Version::vm_info_string(), ! Abstract_VM_Version::vm_platform_string(), ! UseCompressedOops ? "compressed oops" : "" ); ! STEP(60, "(printing problematic frame)") // Print current frame if we have a context (i.e. it's a crash) if (_context) { st->print_cr("# Problematic frame:"); st->print("# "); frame fr = os::fetch_frame_from_context(_context); fr.print_on_error(st, buf, sizeof(buf)); st->cr(); st->print_cr("#"); } ! STEP(63, "(printing core file information)") st->print("# "); if (CreateCoredumpOnCrash) { if (coredump_status) { st->print("Core dump will be written. Default location: %s", coredump_message); } else { --- 480,541 ---- } else { st->print(" (0x%x)", _id); } } ! STEP(70, "(printing current thread and pid)") // process id, thread id st->print(", pid=%d", os::current_process_id()); st->print(", tid=" INTPTR_FORMAT, os::current_thread_id()); st->cr(); ! STEP(80, "(printing error message)") if (should_report_bug(_id)) { // already printed the message. // error message if (_detail_msg) { st->print_cr("# %s: %s", _message ? _message : "Error", _detail_msg); } else if (_message) { st->print_cr("# Error: %s", _message); } } ! STEP(90, "(printing Java version string)") // VM version st->print_cr("#"); JDK_Version::current().to_string(buf, sizeof(buf)); const char* runtime_name = JDK_Version::runtime_name() != NULL ? JDK_Version::runtime_name() : ""; const char* runtime_version = JDK_Version::runtime_version() != NULL ? JDK_Version::runtime_version() : ""; st->print_cr("# JRE version: %s (%s) (build %s)", runtime_name, buf, runtime_version); ! // This is the long version with some default settings added ! st->print_cr("# Java VM: %s (%s, %s%s%s, %s, %s)", Abstract_VM_Version::vm_name(), Abstract_VM_Version::vm_release(), Abstract_VM_Version::vm_info_string(), ! TieredCompilation ? ", tiered" : "", ! UseCompressedOops ? ", compressed oops" : "", ! gc_mode(), ! Abstract_VM_Version::vm_platform_string() ); ! STEP(100, "(printing problematic frame)") // Print current frame if we have a context (i.e. it's a crash) if (_context) { st->print_cr("# Problematic frame:"); st->print("# "); frame fr = os::fetch_frame_from_context(_context); fr.print_on_error(st, buf, sizeof(buf)); st->cr(); st->print_cr("#"); } ! ! STEP(110, "(printing core file information)") st->print("# "); if (CreateCoredumpOnCrash) { if (coredump_status) { st->print("Core dump will be written. Default location: %s", coredump_message); } else {
*** 529,553 **** st->print("CreateCoredumpOnCrash turned off, no core file dumped"); } st->cr(); st->print_cr("#"); ! STEP(65, "(printing bug submit message)") if (should_report_bug(_id) && _verbose) { print_bug_submit_message(st, _thread); } ! STEP(70, "(printing thread)" ) if (_verbose) { st->cr(); st->print_cr("--------------- T H R E A D ---------------"); st->cr(); } ! STEP(80, "(printing current thread)" ) // current thread if (_verbose) { if (_thread) { st->print("Current thread (" PTR_FORMAT "): ", _thread); --- 545,598 ---- st->print("CreateCoredumpOnCrash turned off, no core file dumped"); } st->cr(); st->print_cr("#"); ! STEP(120, "(printing bug submit message)") if (should_report_bug(_id) && _verbose) { print_bug_submit_message(st, _thread); } ! STEP(130, "(printing summary)" ) ! ! if (_verbose) { ! st->cr(); ! st->print_cr("--------------- S U M M A R Y ------------"); ! st->cr(); ! } ! ! STEP(140, "(printing VM options)" ) ! ! if (_verbose) { ! // VM options ! Arguments::print_summary_on(st); ! st->cr(); ! } ! ! STEP(150, "(printing summary machine and OS info)") ! ! if (_verbose) { ! os::print_summary_info(st, buf, sizeof(buf)); ! } ! ! ! STEP(160, "(printing date and time)" ) ! ! if (_verbose) { ! os::print_date_and_time(st, buf, sizeof(buf)); ! } ! ! STEP(170, "(printing thread)" ) if (_verbose) { st->cr(); st->print_cr("--------------- T H R E A D ---------------"); st->cr(); } ! STEP(180, "(printing current thread)" ) // current thread if (_verbose) { if (_thread) { st->print("Current thread (" PTR_FORMAT "): ", _thread);
*** 557,591 **** st->print_cr("Current thread is native thread"); } st->cr(); } ! STEP(90, "(printing siginfo)" ) ! // signal no, signal code, address that caused the fault ! if (_verbose && _siginfo) { ! os::print_siginfo(st, _siginfo); st->cr(); ! } ! ! STEP(100, "(printing registers, top of stack, instructions near pc)") ! ! // registers, top of stack, instructions near pc ! if (_verbose && _context) { ! os::print_context(st, _context); st->cr(); } - - STEP(105, "(printing register info)") - - // decode register contents if possible - if (_verbose && _context && Universe::is_fully_initialized()) { - os::print_register_info(st, _context); - st->cr(); } ! STEP(110, "(printing stack bounds)" ) if (_verbose) { st->print("Stack: "); address stack_top; --- 602,625 ---- st->print_cr("Current thread is native thread"); } st->cr(); } ! STEP(190, "(printing current compile task)" ) ! if (_verbose && _thread && _thread->is_Compiler_thread()) { ! CompilerThread* t = (CompilerThread*)_thread; ! if (t->task()) { st->cr(); ! st->print_cr("Current CompileTask:"); ! t->task()->print_line_on_error(st, buf, sizeof(buf)); st->cr(); } } ! ! STEP(200, "(printing stack bounds)" ) if (_verbose) { st->print("Stack: "); address stack_top;
*** 612,622 **** } st->cr(); } ! STEP(120, "(printing native stack)" ) if (_verbose) { if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) { // We have printed the native stack in platform-specific code // Windows/x64 needs special handling. --- 646,656 ---- } st->cr(); } ! STEP(210, "(printing native stack)" ) if (_verbose) { if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) { // We have printed the native stack in platform-specific code // Windows/x64 needs special handling.
*** 626,693 **** print_native_stack(st, fr, _thread, buf, sizeof(buf)); } } ! STEP(130, "(printing Java stack)" ) if (_verbose && _thread && _thread->is_Java_thread()) { print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf)); } ! STEP(135, "(printing target Java thread stack)" ) // printing Java thread stack trace if it is involved in GC crash if (_verbose && _thread && (_thread->is_Named_thread())) { JavaThread* jt = ((NamedThread *)_thread)->processed_thread(); if (jt != NULL) { st->print_cr("JavaThread " PTR_FORMAT " (nid = " UINTX_FORMAT ") was being processed", jt, jt->osthread()->thread_id()); print_stack_trace(st, jt, buf, sizeof(buf), true); } } ! STEP(140, "(printing VM operation)" ) ! if (_verbose && _thread && _thread->is_VM_thread()) { ! VMThread* t = (VMThread*)_thread; ! VM_Operation* op = t->vm_operation(); ! if (op) { ! op->print_on_error(st); st->cr(); st->cr(); } } ! STEP(150, "(printing current compile task)" ) ! if (_verbose && _thread && _thread->is_Compiler_thread()) { ! CompilerThread* t = (CompilerThread*)_thread; ! if (t->task()) { st->cr(); - st->print_cr("Current CompileTask:"); - t->task()->print_line_on_error(st, buf, sizeof(buf)); st->cr(); } } ! STEP(160, "(printing process)" ) if (_verbose) { st->cr(); st->print_cr("--------------- P R O C E S S ---------------"); st->cr(); } ! STEP(170, "(printing all threads)" ) // all threads if (_verbose && _thread) { Threads::print_on_error(st, _thread, buf, sizeof(buf)); st->cr(); } ! STEP(175, "(printing VM state)" ) if (_verbose) { // Safepoint state st->print("VM state:"); --- 660,740 ---- print_native_stack(st, fr, _thread, buf, sizeof(buf)); } } ! STEP(220, "(printing Java stack)" ) if (_verbose && _thread && _thread->is_Java_thread()) { print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf)); } ! STEP(230, "(printing target Java thread stack)" ) // printing Java thread stack trace if it is involved in GC crash if (_verbose && _thread && (_thread->is_Named_thread())) { JavaThread* jt = ((NamedThread *)_thread)->processed_thread(); if (jt != NULL) { st->print_cr("JavaThread " PTR_FORMAT " (nid = " UINTX_FORMAT ") was being processed", jt, jt->osthread()->thread_id()); print_stack_trace(st, jt, buf, sizeof(buf), true); } } ! STEP(240, "(printing siginfo)" ) ! // signal no, signal code, address that caused the fault ! if (_verbose && _siginfo) { st->cr(); + os::print_siginfo(st, _siginfo); st->cr(); } + + STEP(250, "(printing register info)") + + // decode register contents if possible + if (_verbose && _context && Universe::is_fully_initialized()) { + os::print_register_info(st, _context); + st->cr(); } ! STEP(260, "(printing registers, top of stack, instructions near pc)") ! // registers, top of stack, instructions near pc ! if (_verbose && _context) { ! os::print_context(st, _context); ! st->cr(); ! } ! ! STEP(270, "(printing VM operation)" ) ! ! if (_verbose && _thread && _thread->is_VM_thread()) { ! VMThread* t = (VMThread*)_thread; ! VM_Operation* op = t->vm_operation(); ! if (op) { ! op->print_on_error(st); st->cr(); st->cr(); } } ! STEP(280, "(printing process)" ) if (_verbose) { st->cr(); st->print_cr("--------------- P R O C E S S ---------------"); st->cr(); } ! STEP(290, "(printing all threads)" ) // all threads if (_verbose && _thread) { Threads::print_on_error(st, _thread, buf, sizeof(buf)); st->cr(); } ! STEP(300, "(printing VM state)" ) if (_verbose) { // Safepoint state st->print("VM state:");
*** 705,857 **** } st->cr(); st->cr(); } ! STEP(180, "(printing owned locks on error)" ) // mutexes/monitors that currently have an owner if (_verbose) { print_owned_locks_on_error(st); st->cr(); } ! STEP(182, "(printing number of OutOfMemoryError and StackOverflow exceptions)") if (_verbose && Exceptions::has_exception_counts()) { st->print_cr("OutOfMemory and StackOverflow Exception counts:"); Exceptions::print_exception_counts_on_error(st); st->cr(); } ! STEP(185, "(printing compressed oops mode") if (_verbose && UseCompressedOops) { Universe::print_compressed_oops_mode(st); if (UseCompressedClassPointers) { Metaspace::print_compressed_class_space(st); } st->cr(); } ! STEP(190, "(printing heap information)" ) if (_verbose && Universe::is_fully_initialized()) { Universe::heap()->print_on_error(st); st->cr(); st->print_cr("Polling page: " INTPTR_FORMAT, os::get_polling_page()); st->cr(); } ! STEP(195, "(printing code cache information)" ) if (_verbose && Universe::is_fully_initialized()) { // print code cache information before vm abort CodeCache::print_summary(st); st->cr(); } ! STEP(200, "(printing ring buffers)" ) if (_verbose) { Events::print_all(st); st->cr(); } ! STEP(205, "(printing dynamic libraries)" ) if (_verbose) { // dynamic libraries, or memory map os::print_dll_info(st); st->cr(); } ! STEP(210, "(printing VM options)" ) if (_verbose) { // VM options Arguments::print_on(st); st->cr(); } ! STEP(215, "(printing warning if internal testing API used)" ) if (WhiteBox::used()) { st->print_cr("Unsupported internal testing APIs have been used."); st->cr(); } ! STEP(220, "(printing environment variables)" ) if (_verbose) { os::print_environment_variables(st, env_list); st->cr(); } ! STEP(225, "(printing signal handlers)" ) if (_verbose) { os::print_signal_handlers(st, buf, sizeof(buf)); st->cr(); } ! STEP(228, "(Native Memory Tracking)" ) if (_verbose) { MemTracker::error_report(st); } ! STEP(230, "" ) if (_verbose) { st->cr(); st->print_cr("--------------- S Y S T E M ---------------"); st->cr(); } ! STEP(240, "(printing OS information)" ) if (_verbose) { os::print_os_info(st); st->cr(); } ! STEP(250, "(printing CPU info)" ) if (_verbose) { os::print_cpu_info(st, buf, sizeof(buf)); st->cr(); } ! STEP(260, "(printing memory info)" ) if (_verbose) { os::print_memory_info(st); st->cr(); } ! STEP(270, "(printing internal vm info)" ) if (_verbose) { st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string()); st->cr(); } - STEP(280, "(printing date and time)" ) - - if (_verbose) { - os::print_date_and_time(st, buf, sizeof(buf)); - st->cr(); - } - - #ifndef PRODUCT // print a defined marker to show that error handling finished correctly. ! STEP(290, "(printing end marker)" ) if (_verbose) { st->print_cr("END."); } - #endif END # undef BEGIN # undef STEP --- 752,896 ---- } st->cr(); st->cr(); } ! STEP(310, "(printing owned locks on error)" ) // mutexes/monitors that currently have an owner if (_verbose) { print_owned_locks_on_error(st); st->cr(); } ! STEP(320, "(printing number of OutOfMemoryError and StackOverflow exceptions)") if (_verbose && Exceptions::has_exception_counts()) { st->print_cr("OutOfMemory and StackOverflow Exception counts:"); Exceptions::print_exception_counts_on_error(st); st->cr(); } ! STEP(330, "(printing compressed oops mode") if (_verbose && UseCompressedOops) { Universe::print_compressed_oops_mode(st); if (UseCompressedClassPointers) { Metaspace::print_compressed_class_space(st); } st->cr(); } ! STEP(340, "(printing heap information)" ) if (_verbose && Universe::is_fully_initialized()) { Universe::heap()->print_on_error(st); st->cr(); st->print_cr("Polling page: " INTPTR_FORMAT, os::get_polling_page()); st->cr(); } ! STEP(350, "(printing code cache information)" ) if (_verbose && Universe::is_fully_initialized()) { // print code cache information before vm abort CodeCache::print_summary(st); st->cr(); } ! STEP(360, "(printing ring buffers)" ) if (_verbose) { Events::print_all(st); st->cr(); } ! STEP(370, "(printing dynamic libraries)" ) if (_verbose) { // dynamic libraries, or memory map os::print_dll_info(st); st->cr(); } ! STEP(380, "(printing VM options)" ) if (_verbose) { // VM options Arguments::print_on(st); st->cr(); } ! ! STEP(390, "(printing warning if internal testing API used)" ) if (WhiteBox::used()) { st->print_cr("Unsupported internal testing APIs have been used."); st->cr(); } ! STEP(400, "(printing all environment variables)" ) if (_verbose) { os::print_environment_variables(st, env_list); st->cr(); } ! STEP(410, "(printing signal handlers)" ) if (_verbose) { os::print_signal_handlers(st, buf, sizeof(buf)); st->cr(); } ! STEP(420, "(Native Memory Tracking)" ) if (_verbose) { MemTracker::error_report(st); } ! STEP(430, "(printing system)" ) if (_verbose) { st->cr(); st->print_cr("--------------- S Y S T E M ---------------"); st->cr(); } ! STEP(440, "(printing OS information)" ) if (_verbose) { os::print_os_info(st); st->cr(); } ! STEP(450, "(printing CPU info)" ) if (_verbose) { os::print_cpu_info(st, buf, sizeof(buf)); st->cr(); } ! STEP(460, "(printing memory info)" ) if (_verbose) { os::print_memory_info(st); st->cr(); } ! STEP(470, "(printing internal vm info)" ) if (_verbose) { st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string()); st->cr(); } // print a defined marker to show that error handling finished correctly. ! STEP(480, "(printing end marker)" ) if (_verbose) { st->print_cr("END."); } END # undef BEGIN # undef STEP
src/share/vm/utilities/vmError.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File