hotspot/src/share/vm/utilities/vmError.cpp
changeset 38215 fe1677e95252
parent 37994 1a816b464178
child 39274 940f0e8e9ec2
equal deleted inserted replaced
38214:67e9ed945358 38215:fe1677e95252
   288 int          VMError::_current_step;
   288 int          VMError::_current_step;
   289 const char*  VMError::_current_step_info;
   289 const char*  VMError::_current_step_info;
   290 
   290 
   291 void VMError::report(outputStream* st, bool _verbose) {
   291 void VMError::report(outputStream* st, bool _verbose) {
   292 
   292 
   293 # define BEGIN if (_current_step == 0) { _current_step = 1;
   293 # define BEGIN if (_current_step == 0) { _current_step = __LINE__;
   294 # define STEP(n, s) } if (_current_step < n) { _current_step = n; _current_step_info = s;
   294 # define STEP(s) } if (_current_step < __LINE__) { _current_step = __LINE__; _current_step_info = s;
   295 # define END }
   295 # define END }
   296 
   296 
   297   // don't allocate large buffer on stack
   297   // don't allocate large buffer on stack
   298   static char buf[O_BUFLEN];
   298   static char buf[O_BUFLEN];
   299 
   299 
   300   BEGIN
   300   BEGIN
   301 
   301 
   302   STEP(10, "(printing fatal error message)")
   302   STEP("printing fatal error message")
   303 
   303 
   304     st->print_cr("#");
   304     st->print_cr("#");
   305     if (should_report_bug(_id)) {
   305     if (should_report_bug(_id)) {
   306       st->print_cr("# A fatal error has been detected by the Java Runtime Environment:");
   306       st->print_cr("# A fatal error has been detected by the Java Runtime Environment:");
   307     } else {
   307     } else {
   312 #ifndef PRODUCT
   312 #ifndef PRODUCT
   313   // Error handler self tests
   313   // Error handler self tests
   314 
   314 
   315   // test secondary error handling. Test it twice, to test that resetting
   315   // test secondary error handling. Test it twice, to test that resetting
   316   // error handler after a secondary crash works.
   316   // error handler after a secondary crash works.
   317   STEP(20, "(test secondary crash 1)")
   317   STEP("test secondary crash 1")
   318     if (_verbose && TestCrashInErrorHandler != 0) {
   318     if (_verbose && TestCrashInErrorHandler != 0) {
   319       st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
   319       st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
   320         TestCrashInErrorHandler);
   320         TestCrashInErrorHandler);
   321       controlled_crash(TestCrashInErrorHandler);
   321       controlled_crash(TestCrashInErrorHandler);
   322     }
   322     }
   323 
   323 
   324   STEP(30, "(test secondary crash 2)")
   324   STEP("test secondary crash 2")
   325     if (_verbose && TestCrashInErrorHandler != 0) {
   325     if (_verbose && TestCrashInErrorHandler != 0) {
   326       st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
   326       st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
   327         TestCrashInErrorHandler);
   327         TestCrashInErrorHandler);
   328       controlled_crash(TestCrashInErrorHandler);
   328       controlled_crash(TestCrashInErrorHandler);
   329     }
   329     }
   330 
   330 
   331   STEP(40, "(test safefetch in error handler)")
   331   STEP("test safefetch in error handler")
   332     // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice
   332     // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice
   333     // to test that resetting the signal handler works correctly.
   333     // to test that resetting the signal handler works correctly.
   334     if (_verbose && TestSafeFetchInErrorHandler) {
   334     if (_verbose && TestSafeFetchInErrorHandler) {
   335       st->print_cr("Will test SafeFetch...");
   335       st->print_cr("Will test SafeFetch...");
   336       if (CanUseSafeFetch32()) {
   336       if (CanUseSafeFetch32()) {
   347         st->print_cr("not possible; skipped.");
   347         st->print_cr("not possible; skipped.");
   348       }
   348       }
   349     }
   349     }
   350 #endif // PRODUCT
   350 #endif // PRODUCT
   351 
   351 
   352   STEP(50, "(printing type of error)")
   352   STEP("printing type of error")
   353 
   353 
   354      switch(_id) {
   354      switch(_id) {
   355        case OOM_MALLOC_ERROR:
   355        case OOM_MALLOC_ERROR:
   356        case OOM_MMAP_ERROR:
   356        case OOM_MMAP_ERROR:
   357          if (_size) {
   357          if (_size) {
   382        case INTERNAL_ERROR:
   382        case INTERNAL_ERROR:
   383        default:
   383        default:
   384          break;
   384          break;
   385      }
   385      }
   386 
   386 
   387   STEP(60, "(printing exception/signal name)")
   387   STEP("printing exception/signal name")
   388 
   388 
   389      st->print_cr("#");
   389      st->print_cr("#");
   390      st->print("#  ");
   390      st->print("#  ");
   391      // Is it an OS exception/signal?
   391      // Is it an OS exception/signal?
   392      if (os::exception_name(_id, buf, sizeof(buf))) {
   392      if (os::exception_name(_id, buf, sizeof(buf))) {
   412        } else {
   412        } else {
   413          st->print(" (0x%x)", _id);
   413          st->print(" (0x%x)", _id);
   414        }
   414        }
   415      }
   415      }
   416 
   416 
   417   STEP(70, "(printing current thread and pid)")
   417   STEP("printing current thread and pid")
   418 
   418 
   419      // process id, thread id
   419      // process id, thread id
   420      st->print(", pid=%d", os::current_process_id());
   420      st->print(", pid=%d", os::current_process_id());
   421      st->print(", tid=" UINTX_FORMAT, os::current_thread_id());
   421      st->print(", tid=" UINTX_FORMAT, os::current_thread_id());
   422      st->cr();
   422      st->cr();
   423 
   423 
   424   STEP(80, "(printing error message)")
   424   STEP("printing error message")
   425 
   425 
   426      if (should_report_bug(_id)) {  // already printed the message.
   426      if (should_report_bug(_id)) {  // already printed the message.
   427        // error message
   427        // error message
   428        if (strlen(_detail_msg) > 0) {
   428        if (strlen(_detail_msg) > 0) {
   429          st->print_cr("#  %s: %s", _message ? _message : "Error", _detail_msg);
   429          st->print_cr("#  %s: %s", _message ? _message : "Error", _detail_msg);
   430        } else if (_message) {
   430        } else if (_message) {
   431          st->print_cr("#  Error: %s", _message);
   431          st->print_cr("#  Error: %s", _message);
   432        }
   432        }
   433      }
   433      }
   434 
   434 
   435   STEP(90, "(printing Java version string)")
   435   STEP("printing Java version string")
   436 
   436 
   437      report_vm_version(st, buf, sizeof(buf));
   437      report_vm_version(st, buf, sizeof(buf));
   438 
   438 
   439   STEP(100, "(printing problematic frame)")
   439   STEP("printing problematic frame")
   440 
   440 
   441      // Print current frame if we have a context (i.e. it's a crash)
   441      // Print current frame if we have a context (i.e. it's a crash)
   442      if (_context) {
   442      if (_context) {
   443        st->print_cr("# Problematic frame:");
   443        st->print_cr("# Problematic frame:");
   444        st->print("# ");
   444        st->print("# ");
   446        fr.print_on_error(st, buf, sizeof(buf));
   446        fr.print_on_error(st, buf, sizeof(buf));
   447        st->cr();
   447        st->cr();
   448        st->print_cr("#");
   448        st->print_cr("#");
   449      }
   449      }
   450 
   450 
   451   STEP(110, "(printing core file information)")
   451   STEP("printing core file information")
   452     st->print("# ");
   452     st->print("# ");
   453     if (CreateCoredumpOnCrash) {
   453     if (CreateCoredumpOnCrash) {
   454       if (coredump_status) {
   454       if (coredump_status) {
   455         st->print("Core dump will be written. Default location: %s", coredump_message);
   455         st->print("Core dump will be written. Default location: %s", coredump_message);
   456       } else {
   456       } else {
   460       st->print("CreateCoredumpOnCrash turned off, no core file dumped");
   460       st->print("CreateCoredumpOnCrash turned off, no core file dumped");
   461     }
   461     }
   462     st->cr();
   462     st->cr();
   463     st->print_cr("#");
   463     st->print_cr("#");
   464 
   464 
   465   STEP(120, "(printing bug submit message)")
   465   STEP("printing bug submit message")
   466 
   466 
   467      if (should_report_bug(_id) && _verbose) {
   467      if (should_report_bug(_id) && _verbose) {
   468        print_bug_submit_message(st, _thread);
   468        print_bug_submit_message(st, _thread);
   469      }
   469      }
   470 
   470 
   471   STEP(130, "(printing summary)" )
   471   STEP("printing summary")
   472 
   472 
   473      if (_verbose) {
   473      if (_verbose) {
   474        st->cr();
   474        st->cr();
   475        st->print_cr("---------------  S U M M A R Y ------------");
   475        st->print_cr("---------------  S U M M A R Y ------------");
   476        st->cr();
   476        st->cr();
   477      }
   477      }
   478 
   478 
   479   STEP(140, "(printing VM option summary)" )
   479   STEP("printing VM option summary")
   480 
   480 
   481      if (_verbose) {
   481      if (_verbose) {
   482        // VM options
   482        // VM options
   483        Arguments::print_summary_on(st);
   483        Arguments::print_summary_on(st);
   484        st->cr();
   484        st->cr();
   485      }
   485      }
   486 
   486 
   487   STEP(150, "(printing summary machine and OS info)")
   487   STEP("printing summary machine and OS info")
   488 
   488 
   489      if (_verbose) {
   489      if (_verbose) {
   490        os::print_summary_info(st, buf, sizeof(buf));
   490        os::print_summary_info(st, buf, sizeof(buf));
   491      }
   491      }
   492 
   492 
   493 
   493 
   494   STEP(160, "(printing date and time)" )
   494   STEP("printing date and time")
   495 
   495 
   496      if (_verbose) {
   496      if (_verbose) {
   497        os::print_date_and_time(st, buf, sizeof(buf));
   497        os::print_date_and_time(st, buf, sizeof(buf));
   498      }
   498      }
   499 
   499 
   500   STEP(170, "(printing thread)" )
   500   STEP("printing thread")
   501 
   501 
   502      if (_verbose) {
   502      if (_verbose) {
   503        st->cr();
   503        st->cr();
   504        st->print_cr("---------------  T H R E A D  ---------------");
   504        st->print_cr("---------------  T H R E A D  ---------------");
   505        st->cr();
   505        st->cr();
   506      }
   506      }
   507 
   507 
   508   STEP(180, "(printing current thread)" )
   508   STEP("printing current thread")
   509 
   509 
   510      // current thread
   510      // current thread
   511      if (_verbose) {
   511      if (_verbose) {
   512        if (_thread) {
   512        if (_thread) {
   513          st->print("Current thread (" PTR_FORMAT "):  ", p2i(_thread));
   513          st->print("Current thread (" PTR_FORMAT "):  ", p2i(_thread));
   517          st->print_cr("Current thread is native thread");
   517          st->print_cr("Current thread is native thread");
   518        }
   518        }
   519        st->cr();
   519        st->cr();
   520      }
   520      }
   521 
   521 
   522   STEP(190, "(printing current compile task)" )
   522   STEP("printing current compile task")
   523 
   523 
   524      if (_verbose && _thread && _thread->is_Compiler_thread()) {
   524      if (_verbose && _thread && _thread->is_Compiler_thread()) {
   525         CompilerThread* t = (CompilerThread*)_thread;
   525         CompilerThread* t = (CompilerThread*)_thread;
   526         if (t->task()) {
   526         if (t->task()) {
   527            st->cr();
   527            st->cr();
   530            st->cr();
   530            st->cr();
   531         }
   531         }
   532      }
   532      }
   533 
   533 
   534 
   534 
   535   STEP(200, "(printing stack bounds)" )
   535   STEP("printing stack bounds")
   536 
   536 
   537      if (_verbose) {
   537      if (_verbose) {
   538        st->print("Stack: ");
   538        st->print("Stack: ");
   539 
   539 
   540        address stack_top;
   540        address stack_top;
   561        }
   561        }
   562 
   562 
   563        st->cr();
   563        st->cr();
   564      }
   564      }
   565 
   565 
   566   STEP(210, "(printing native stack)" )
   566   STEP("printing native stack")
   567 
   567 
   568    if (_verbose) {
   568    if (_verbose) {
   569      if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) {
   569      if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) {
   570        // We have printed the native stack in platform-specific code
   570        // We have printed the native stack in platform-specific code
   571        // Windows/x64 needs special handling.
   571        // Windows/x64 needs special handling.
   575 
   575 
   576        print_native_stack(st, fr, _thread, buf, sizeof(buf));
   576        print_native_stack(st, fr, _thread, buf, sizeof(buf));
   577      }
   577      }
   578    }
   578    }
   579 
   579 
   580   STEP(220, "(printing Java stack)" )
   580   STEP("printing Java stack")
   581 
   581 
   582      if (_verbose && _thread && _thread->is_Java_thread()) {
   582      if (_verbose && _thread && _thread->is_Java_thread()) {
   583        print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf));
   583        print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf));
   584      }
   584      }
   585 
   585 
   586   STEP(230, "(printing target Java thread stack)" )
   586   STEP("printing target Java thread stack")
   587 
   587 
   588      // printing Java thread stack trace if it is involved in GC crash
   588      // printing Java thread stack trace if it is involved in GC crash
   589      if (_verbose && _thread && (_thread->is_Named_thread())) {
   589      if (_verbose && _thread && (_thread->is_Named_thread())) {
   590        JavaThread*  jt = ((NamedThread *)_thread)->processed_thread();
   590        JavaThread*  jt = ((NamedThread *)_thread)->processed_thread();
   591        if (jt != NULL) {
   591        if (jt != NULL) {
   592          st->print_cr("JavaThread " PTR_FORMAT " (nid = %d) was being processed", p2i(jt), jt->osthread()->thread_id());
   592          st->print_cr("JavaThread " PTR_FORMAT " (nid = %d) was being processed", p2i(jt), jt->osthread()->thread_id());
   593          print_stack_trace(st, jt, buf, sizeof(buf), true);
   593          print_stack_trace(st, jt, buf, sizeof(buf), true);
   594        }
   594        }
   595      }
   595      }
   596 
   596 
   597   STEP(240, "(printing siginfo)" )
   597   STEP("printing siginfo")
   598 
   598 
   599      // signal no, signal code, address that caused the fault
   599      // signal no, signal code, address that caused the fault
   600      if (_verbose && _siginfo) {
   600      if (_verbose && _siginfo) {
   601        st->cr();
   601        st->cr();
   602        os::print_siginfo(st, _siginfo);
   602        os::print_siginfo(st, _siginfo);
   603        st->cr();
   603        st->cr();
   604      }
   604      }
   605 
   605 
   606   STEP(245, "(CDS archive access warning)" )
   606   STEP("CDS archive access warning")
   607 
   607 
   608      // Print an explicit hint if we crashed on access to the CDS archive.
   608      // Print an explicit hint if we crashed on access to the CDS archive.
   609      if (_verbose && _siginfo) {
   609      if (_verbose && _siginfo) {
   610        check_failing_cds_access(st, _siginfo);
   610        check_failing_cds_access(st, _siginfo);
   611        st->cr();
   611        st->cr();
   612      }
   612      }
   613 
   613 
   614   STEP(250, "(printing register info)")
   614   STEP("printing register info")
   615 
   615 
   616      // decode register contents if possible
   616      // decode register contents if possible
   617      if (_verbose && _context && Universe::is_fully_initialized()) {
   617      if (_verbose && _context && Universe::is_fully_initialized()) {
   618        os::print_register_info(st, _context);
   618        os::print_register_info(st, _context);
   619        st->cr();
   619        st->cr();
   620      }
   620      }
   621 
   621 
   622   STEP(260, "(printing registers, top of stack, instructions near pc)")
   622   STEP("printing registers, top of stack, instructions near pc")
   623 
   623 
   624      // registers, top of stack, instructions near pc
   624      // registers, top of stack, instructions near pc
   625      if (_verbose && _context) {
   625      if (_verbose && _context) {
   626        os::print_context(st, _context);
   626        os::print_context(st, _context);
   627        st->cr();
   627        st->cr();
   628      }
   628      }
   629 
   629 
   630   STEP(265, "(printing code blob if possible)")
   630   STEP("printing code blob if possible")
   631 
   631 
   632      if (_verbose && _context) {
   632      if (_verbose && _context) {
   633        CodeBlob* cb = CodeCache::find_blob(_pc);
   633        CodeBlob* cb = CodeCache::find_blob(_pc);
   634        if (cb != NULL) {
   634        if (cb != NULL) {
   635          if (Interpreter::contains(_pc)) {
   635          if (Interpreter::contains(_pc)) {
   650            }
   650            }
   651          }
   651          }
   652        }
   652        }
   653      }
   653      }
   654 
   654 
   655   STEP(270, "(printing VM operation)" )
   655   STEP("printing VM operation")
   656 
   656 
   657      if (_verbose && _thread && _thread->is_VM_thread()) {
   657      if (_verbose && _thread && _thread->is_VM_thread()) {
   658         VMThread* t = (VMThread*)_thread;
   658         VMThread* t = (VMThread*)_thread;
   659         VM_Operation* op = t->vm_operation();
   659         VM_Operation* op = t->vm_operation();
   660         if (op) {
   660         if (op) {
   662           st->cr();
   662           st->cr();
   663           st->cr();
   663           st->cr();
   664         }
   664         }
   665      }
   665      }
   666 
   666 
   667   STEP(280, "(printing process)" )
   667   STEP("printing process")
   668 
   668 
   669      if (_verbose) {
   669      if (_verbose) {
   670        st->cr();
   670        st->cr();
   671        st->print_cr("---------------  P R O C E S S  ---------------");
   671        st->print_cr("---------------  P R O C E S S  ---------------");
   672        st->cr();
   672        st->cr();
   673      }
   673      }
   674 
   674 
   675   STEP(290, "(printing all threads)" )
   675   STEP("printing all threads")
   676 
   676 
   677      // all threads
   677      // all threads
   678      if (_verbose && _thread) {
   678      if (_verbose && _thread) {
   679        Threads::print_on_error(st, _thread, buf, sizeof(buf));
   679        Threads::print_on_error(st, _thread, buf, sizeof(buf));
   680        st->cr();
   680        st->cr();
   681      }
   681      }
   682 
   682 
   683   STEP(300, "(printing VM state)" )
   683   STEP("printing VM state")
   684 
   684 
   685      if (_verbose) {
   685      if (_verbose) {
   686        // Safepoint state
   686        // Safepoint state
   687        st->print("VM state:");
   687        st->print("VM state:");
   688 
   688 
   700        }
   700        }
   701        st->cr();
   701        st->cr();
   702        st->cr();
   702        st->cr();
   703      }
   703      }
   704 
   704 
   705   STEP(310, "(printing owned locks on error)" )
   705   STEP("printing owned locks on error")
   706 
   706 
   707      // mutexes/monitors that currently have an owner
   707      // mutexes/monitors that currently have an owner
   708      if (_verbose) {
   708      if (_verbose) {
   709        print_owned_locks_on_error(st);
   709        print_owned_locks_on_error(st);
   710        st->cr();
   710        st->cr();
   711      }
   711      }
   712 
   712 
   713   STEP(320, "(printing number of OutOfMemoryError and StackOverflow exceptions)")
   713   STEP("printing number of OutOfMemoryError and StackOverflow exceptions")
   714 
   714 
   715      if (_verbose && Exceptions::has_exception_counts()) {
   715      if (_verbose && Exceptions::has_exception_counts()) {
   716        st->print_cr("OutOfMemory and StackOverflow Exception counts:");
   716        st->print_cr("OutOfMemory and StackOverflow Exception counts:");
   717        Exceptions::print_exception_counts_on_error(st);
   717        Exceptions::print_exception_counts_on_error(st);
   718        st->cr();
   718        st->cr();
   719      }
   719      }
   720 
   720 
   721   STEP(330, "(printing compressed oops mode")
   721   STEP("printing compressed oops mode")
   722 
   722 
   723      if (_verbose && UseCompressedOops) {
   723      if (_verbose && UseCompressedOops) {
   724        Universe::print_compressed_oops_mode(st);
   724        Universe::print_compressed_oops_mode(st);
   725        if (UseCompressedClassPointers) {
   725        if (UseCompressedClassPointers) {
   726          Metaspace::print_compressed_class_space(st);
   726          Metaspace::print_compressed_class_space(st);
   727        }
   727        }
   728        st->cr();
   728        st->cr();
   729      }
   729      }
   730 
   730 
   731   STEP(340, "(printing heap information)" )
   731   STEP("printing heap information")
   732 
   732 
   733      if (_verbose && Universe::is_fully_initialized()) {
   733      if (_verbose && Universe::is_fully_initialized()) {
   734        Universe::heap()->print_on_error(st);
   734        Universe::heap()->print_on_error(st);
   735        st->cr();
   735        st->cr();
   736        st->print_cr("Polling page: " INTPTR_FORMAT, p2i(os::get_polling_page()));
   736        st->print_cr("Polling page: " INTPTR_FORMAT, p2i(os::get_polling_page()));
   737        st->cr();
   737        st->cr();
   738      }
   738      }
   739 
   739 
   740   STEP(350, "(printing code cache information)" )
   740   STEP("printing code cache information")
   741 
   741 
   742      if (_verbose && Universe::is_fully_initialized()) {
   742      if (_verbose && Universe::is_fully_initialized()) {
   743        // print code cache information before vm abort
   743        // print code cache information before vm abort
   744        CodeCache::print_summary(st);
   744        CodeCache::print_summary(st);
   745        st->cr();
   745        st->cr();
   746      }
   746      }
   747 
   747 
   748   STEP(360, "(printing ring buffers)" )
   748   STEP("printing ring buffers")
   749 
   749 
   750      if (_verbose) {
   750      if (_verbose) {
   751        Events::print_all(st);
   751        Events::print_all(st);
   752        st->cr();
   752        st->cr();
   753      }
   753      }
   754 
   754 
   755   STEP(370, "(printing dynamic libraries)" )
   755   STEP("printing dynamic libraries")
   756 
   756 
   757      if (_verbose) {
   757      if (_verbose) {
   758        // dynamic libraries, or memory map
   758        // dynamic libraries, or memory map
   759        os::print_dll_info(st);
   759        os::print_dll_info(st);
   760        st->cr();
   760        st->cr();
   761      }
   761      }
   762 
   762 
   763   STEP(380, "(printing VM options)" )
   763   STEP("printing VM options")
   764 
   764 
   765      if (_verbose) {
   765      if (_verbose) {
   766        // VM options
   766        // VM options
   767        Arguments::print_on(st);
   767        Arguments::print_on(st);
   768        st->cr();
   768        st->cr();
   769      }
   769      }
   770 
   770 
   771   STEP(390, "(printing warning if internal testing API used)" )
   771   STEP("printing warning if internal testing API used")
   772 
   772 
   773      if (WhiteBox::used()) {
   773      if (WhiteBox::used()) {
   774        st->print_cr("Unsupported internal testing APIs have been used.");
   774        st->print_cr("Unsupported internal testing APIs have been used.");
   775        st->cr();
   775        st->cr();
   776      }
   776      }
   777 
   777 
   778   STEP(395, "(printing log configuration)")
   778   STEP("printing log configuration")
   779     if (_verbose){
   779     if (_verbose){
   780       st->print_cr("Logging:");
   780       st->print_cr("Logging:");
   781       LogConfiguration::describe_current_configuration(st);
   781       LogConfiguration::describe_current_configuration(st);
   782       st->cr();
   782       st->cr();
   783     }
   783     }
   784 
   784 
   785   STEP(400, "(printing all environment variables)" )
   785   STEP("printing all environment variables")
   786 
   786 
   787      if (_verbose) {
   787      if (_verbose) {
   788        os::print_environment_variables(st, env_list);
   788        os::print_environment_variables(st, env_list);
   789        st->cr();
   789        st->cr();
   790      }
   790      }
   791 
   791 
   792   STEP(410, "(printing signal handlers)" )
   792   STEP("printing signal handlers")
   793 
   793 
   794      if (_verbose) {
   794      if (_verbose) {
   795        os::print_signal_handlers(st, buf, sizeof(buf));
   795        os::print_signal_handlers(st, buf, sizeof(buf));
   796        st->cr();
   796        st->cr();
   797      }
   797      }
   798 
   798 
   799   STEP(420, "(Native Memory Tracking)" )
   799   STEP("Native Memory Tracking")
   800      if (_verbose) {
   800      if (_verbose) {
   801        MemTracker::error_report(st);
   801        MemTracker::error_report(st);
   802      }
   802      }
   803 
   803 
   804   STEP(430, "(printing system)" )
   804   STEP("printing system")
   805 
   805 
   806      if (_verbose) {
   806      if (_verbose) {
   807        st->cr();
   807        st->cr();
   808        st->print_cr("---------------  S Y S T E M  ---------------");
   808        st->print_cr("---------------  S Y S T E M  ---------------");
   809        st->cr();
   809        st->cr();
   810      }
   810      }
   811 
   811 
   812   STEP(440, "(printing OS information)" )
   812   STEP("printing OS information")
   813 
   813 
   814      if (_verbose) {
   814      if (_verbose) {
   815        os::print_os_info(st);
   815        os::print_os_info(st);
   816        st->cr();
   816        st->cr();
   817      }
   817      }
   818 
   818 
   819   STEP(450, "(printing CPU info)" )
   819   STEP("printing CPU info")
   820      if (_verbose) {
   820      if (_verbose) {
   821        os::print_cpu_info(st, buf, sizeof(buf));
   821        os::print_cpu_info(st, buf, sizeof(buf));
   822        st->cr();
   822        st->cr();
   823      }
   823      }
   824 
   824 
   825   STEP(460, "(printing memory info)" )
   825   STEP("printing memory info")
   826 
   826 
   827      if (_verbose) {
   827      if (_verbose) {
   828        os::print_memory_info(st);
   828        os::print_memory_info(st);
   829        st->cr();
   829        st->cr();
   830      }
   830      }
   831 
   831 
   832   STEP(470, "(printing internal vm info)" )
   832   STEP("printing internal vm info")
   833 
   833 
   834      if (_verbose) {
   834      if (_verbose) {
   835        st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
   835        st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
   836        st->cr();
   836        st->cr();
   837      }
   837      }
   838 
   838 
   839   // print a defined marker to show that error handling finished correctly.
   839   // print a defined marker to show that error handling finished correctly.
   840   STEP(480, "(printing end marker)" )
   840   STEP("printing end marker")
   841 
   841 
   842      if (_verbose) {
   842      if (_verbose) {
   843        st->print_cr("END.");
   843        st->print_cr("END.");
   844      }
   844      }
   845 
   845 
   856 void VMError::print_vm_info(outputStream* st) {
   856 void VMError::print_vm_info(outputStream* st) {
   857 
   857 
   858   char buf[O_BUFLEN];
   858   char buf[O_BUFLEN];
   859   report_vm_version(st, buf, sizeof(buf));
   859   report_vm_version(st, buf, sizeof(buf));
   860 
   860 
   861   // STEP("(printing summary)")
   861   // STEP("printing summary")
   862 
   862 
   863   st->cr();
   863   st->cr();
   864   st->print_cr("---------------  S U M M A R Y ------------");
   864   st->print_cr("---------------  S U M M A R Y ------------");
   865   st->cr();
   865   st->cr();
   866 
   866 
   867   // STEP("(printing VM option summary)")
   867   // STEP("printing VM option summary")
   868 
   868 
   869   // VM options
   869   // VM options
   870   Arguments::print_summary_on(st);
   870   Arguments::print_summary_on(st);
   871   st->cr();
   871   st->cr();
   872 
   872 
   873   // STEP("(printing summary machine and OS info)")
   873   // STEP("printing summary machine and OS info")
   874 
   874 
   875   os::print_summary_info(st, buf, sizeof(buf));
   875   os::print_summary_info(st, buf, sizeof(buf));
   876 
   876 
   877   // STEP("(printing date and time)")
   877   // STEP("printing date and time")
   878 
   878 
   879   os::print_date_and_time(st, buf, sizeof(buf));
   879   os::print_date_and_time(st, buf, sizeof(buf));
   880 
   880 
   881   // Skip: STEP("(printing thread)")
   881   // Skip: STEP("printing thread")
   882 
   882 
   883   // STEP("(printing process)")
   883   // STEP("printing process")
   884 
   884 
   885   st->cr();
   885   st->cr();
   886   st->print_cr("---------------  P R O C E S S  ---------------");
   886   st->print_cr("---------------  P R O C E S S  ---------------");
   887   st->cr();
   887   st->cr();
   888 
   888 
   889   // STEP("(printing number of OutOfMemoryError and StackOverflow exceptions)")
   889   // STEP("printing number of OutOfMemoryError and StackOverflow exceptions")
   890 
   890 
   891   if (Exceptions::has_exception_counts()) {
   891   if (Exceptions::has_exception_counts()) {
   892     st->print_cr("OutOfMemory and StackOverflow Exception counts:");
   892     st->print_cr("OutOfMemory and StackOverflow Exception counts:");
   893     Exceptions::print_exception_counts_on_error(st);
   893     Exceptions::print_exception_counts_on_error(st);
   894     st->cr();
   894     st->cr();
   895   }
   895   }
   896 
   896 
   897   // STEP("(printing compressed oops mode")
   897   // STEP("printing compressed oops mode")
   898 
   898 
   899   if (UseCompressedOops) {
   899   if (UseCompressedOops) {
   900     Universe::print_compressed_oops_mode(st);
   900     Universe::print_compressed_oops_mode(st);
   901     if (UseCompressedClassPointers) {
   901     if (UseCompressedClassPointers) {
   902       Metaspace::print_compressed_class_space(st);
   902       Metaspace::print_compressed_class_space(st);
   903     }
   903     }
   904     st->cr();
   904     st->cr();
   905   }
   905   }
   906 
   906 
   907   // STEP("(printing heap information)")
   907   // STEP("printing heap information")
   908 
   908 
   909   if (Universe::is_fully_initialized()) {
   909   if (Universe::is_fully_initialized()) {
   910     Universe::heap()->print_on_error(st);
   910     Universe::heap()->print_on_error(st);
   911     st->cr();
   911     st->cr();
   912     st->print_cr("Polling page: " INTPTR_FORMAT, p2i(os::get_polling_page()));
   912     st->print_cr("Polling page: " INTPTR_FORMAT, p2i(os::get_polling_page()));
   913     st->cr();
   913     st->cr();
   914   }
   914   }
   915 
   915 
   916   // STEP("(printing code cache information)")
   916   // STEP("printing code cache information")
   917 
   917 
   918   if (Universe::is_fully_initialized()) {
   918   if (Universe::is_fully_initialized()) {
   919     // print code cache information before vm abort
   919     // print code cache information before vm abort
   920     CodeCache::print_summary(st);
   920     CodeCache::print_summary(st);
   921     st->cr();
   921     st->cr();
   922   }
   922   }
   923 
   923 
   924   // STEP("(printing ring buffers)")
   924   // STEP("printing ring buffers")
   925 
   925 
   926   Events::print_all(st);
   926   Events::print_all(st);
   927   st->cr();
   927   st->cr();
   928 
   928 
   929   // STEP("(printing dynamic libraries)")
   929   // STEP("printing dynamic libraries")
   930 
   930 
   931   // dynamic libraries, or memory map
   931   // dynamic libraries, or memory map
   932   os::print_dll_info(st);
   932   os::print_dll_info(st);
   933   st->cr();
   933   st->cr();
   934 
   934 
   935   // STEP("(printing VM options)")
   935   // STEP("printing VM options")
   936 
   936 
   937   // VM options
   937   // VM options
   938   Arguments::print_on(st);
   938   Arguments::print_on(st);
   939   st->cr();
   939   st->cr();
   940 
   940 
   941   // STEP("(printing warning if internal testing API used)")
   941   // STEP("printing warning if internal testing API used")
   942 
   942 
   943   if (WhiteBox::used()) {
   943   if (WhiteBox::used()) {
   944     st->print_cr("Unsupported internal testing APIs have been used.");
   944     st->print_cr("Unsupported internal testing APIs have been used.");
   945     st->cr();
   945     st->cr();
   946   }
   946   }
   947 
   947 
   948   // STEP("(printing log configuration)")
   948   // STEP("printing log configuration")
   949   st->print_cr("Logging:");
   949   st->print_cr("Logging:");
   950   LogConfiguration::describe(st);
   950   LogConfiguration::describe(st);
   951   st->cr();
   951   st->cr();
   952 
   952 
   953   // STEP("(printing all environment variables)")
   953   // STEP("printing all environment variables")
   954 
   954 
   955   os::print_environment_variables(st, env_list);
   955   os::print_environment_variables(st, env_list);
   956   st->cr();
   956   st->cr();
   957 
   957 
   958   // STEP("(printing signal handlers)")
   958   // STEP("printing signal handlers")
   959 
   959 
   960   os::print_signal_handlers(st, buf, sizeof(buf));
   960   os::print_signal_handlers(st, buf, sizeof(buf));
   961   st->cr();
   961   st->cr();
   962 
   962 
   963   // STEP("(Native Memory Tracking)")
   963   // STEP("Native Memory Tracking")
   964 
   964 
   965   MemTracker::error_report(st);
   965   MemTracker::error_report(st);
   966 
   966 
   967   // STEP("(printing system)")
   967   // STEP("printing system")
   968 
   968 
   969   st->cr();
   969   st->cr();
   970   st->print_cr("---------------  S Y S T E M  ---------------");
   970   st->print_cr("---------------  S Y S T E M  ---------------");
   971   st->cr();
   971   st->cr();
   972 
   972 
   973   // STEP("(printing OS information)")
   973   // STEP("printing OS information")
   974 
   974 
   975   os::print_os_info(st);
   975   os::print_os_info(st);
   976   st->cr();
   976   st->cr();
   977 
   977 
   978   // STEP("(printing CPU info)")
   978   // STEP("printing CPU info")
   979 
   979 
   980   os::print_cpu_info(st, buf, sizeof(buf));
   980   os::print_cpu_info(st, buf, sizeof(buf));
   981   st->cr();
   981   st->cr();
   982 
   982 
   983   // STEP("(printing memory info)")
   983   // STEP("printing memory info")
   984 
   984 
   985   os::print_memory_info(st);
   985   os::print_memory_info(st);
   986   st->cr();
   986   st->cr();
   987 
   987 
   988   // STEP("(printing internal vm info)")
   988   // STEP("printing internal vm info")
   989 
   989 
   990   st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
   990   st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
   991   st->cr();
   991   st->cr();
   992 
   992 
   993   // print a defined marker to show that error handling finished correctly.
   993   // print a defined marker to show that error handling finished correctly.
   994   // STEP("(printing end marker)")
   994   // STEP("printing end marker")
   995 
   995 
   996   st->print_cr("END.");
   996   st->print_cr("END.");
   997 }
   997 }
   998 
   998 
   999 volatile intptr_t VMError::first_error_tid = -1;
   999 volatile intptr_t VMError::first_error_tid = -1;
  1188         out.print_raw_cr("[Too many errors, abort]");
  1188         out.print_raw_cr("[Too many errors, abort]");
  1189         os::die();
  1189         os::die();
  1190       }
  1190       }
  1191 
  1191 
  1192       jio_snprintf(buffer, sizeof(buffer),
  1192       jio_snprintf(buffer, sizeof(buffer),
  1193                    "[error occurred during error reporting %s, id 0x%x]",
  1193                    "[error occurred during error reporting (%s), id 0x%x]",
  1194                    _current_step_info, _id);
  1194                    _current_step_info, _id);
  1195       if (log.is_open()) {
  1195       if (log.is_open()) {
  1196         log.cr();
  1196         log.cr();
  1197         log.print_raw_cr(buffer);
  1197         log.print_raw_cr(buffer);
  1198         log.cr();
  1198         log.cr();