< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page




 302         st->print_cr("#   JVM is running with Zero Based Compressed Oops mode in which the Java heap is");
 303         st->print_cr("#     placed in the first 32GB address space. The Java Heap base address is the");
 304         st->print_cr("#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress");
 305         st->print_cr("#     to set the Java Heap base and to place the Java Heap above 32GB virtual address.");
 306         break;
 307       default:
 308         break;
 309     }
 310   }
 311   st->print_cr("# This output file may be truncated or incomplete.");
 312 }
 313 
 314 static void report_vm_version(outputStream* st, char* buf, int buflen) {
 315    // VM version
 316    st->print_cr("#");
 317    JDK_Version::current().to_string(buf, buflen);
 318    const char* runtime_name = JDK_Version::runtime_name() != NULL ?
 319                                 JDK_Version::runtime_name() : "";
 320    const char* runtime_version = JDK_Version::runtime_version() != NULL ?
 321                                    JDK_Version::runtime_version() : "";
 322    const char* jdk_debug_level = Abstract_VM_Version::printable_jdk_debug_level() != NULL ?
 323                                    Abstract_VM_Version::printable_jdk_debug_level() : "";
 324 
 325    st->print_cr("# JRE version: %s (%s) (%sbuild %s)", runtime_name, buf,
 326                  jdk_debug_level, runtime_version);
 327 
 328    // This is the long version with some default settings added
 329    st->print_cr("# Java VM: %s (%s%s, %s%s%s%s%s, %s, %s)",
 330                  Abstract_VM_Version::vm_name(),
 331                  jdk_debug_level,
 332                  Abstract_VM_Version::vm_release(),
 333                  Abstract_VM_Version::vm_info_string(),
 334                  TieredCompilation ? ", tiered" : "",
 335 #if INCLUDE_JVMCI
 336                  EnableJVMCI ? ", jvmci" : "",
 337                  UseJVMCICompiler ? ", jvmci compiler" : "",
 338 #else
 339                  "", "",
 340 #endif
 341                  UseCompressedOops ? ", compressed oops" : "",
 342                  GCConfig::hs_err_name(),
 343                  Abstract_VM_Version::vm_platform_string()
 344                );
 345 }
 346 
 347 // This is the main function to report a fatal error. Only one thread can
 348 // call this function, so we don't need to worry about MT-safety. But it's
 349 // possible that the error handler itself may crash or die on an internal
 350 // error, for example, when the stack/heap is badly damaged. We must be
 351 // able to handle recursive errors that happen inside error handler.
 352 //
 353 // Error reporting is done in several steps. If a crash or internal error
 354 // occurred when reporting an error, the nested signal/exception handler
 355 // can skip steps that are already (or partially) done. Error reporting will
 356 // continue from the next step. This allows us to retrieve and print
 357 // information that may be unsafe to get after a fatal error. If it happens,
 358 // you may find nested report_and_die() frames when you look at the stack
 359 // in a debugger.
 360 //
 361 // In general, a hang in error handler is much worse than a crash or internal
 362 // error, as it's harder to recover from a hang. Deadlock can happen if we
 363 // try to grab a lock that is already owned by current thread, or if the


 972        os::print_os_info(st);
 973        st->cr();
 974      }
 975 
 976   STEP("printing CPU info")
 977      if (_verbose) {
 978        os::print_cpu_info(st, buf, sizeof(buf));
 979        st->cr();
 980      }
 981 
 982   STEP("printing memory info")
 983 
 984      if (_verbose) {
 985        os::print_memory_info(st);
 986        st->cr();
 987      }
 988 
 989   STEP("printing internal vm info")
 990 
 991      if (_verbose) {
 992        st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
 993        st->cr();
 994      }
 995 
 996   // print a defined marker to show that error handling finished correctly.
 997   STEP("printing end marker")
 998 
 999      if (_verbose) {
1000        st->print_cr("END.");
1001      }
1002 
1003   END
1004 
1005 # undef BEGIN
1006 # undef STEP
1007 # undef END
1008 }
1009 
1010 // Report for the vm_info_cmd. This prints out the information above omitting
1011 // crash and thread specific information.  If output is added above, it should be added
1012 // here also, if it is safe to call during a running process.


1135   st->print_cr("---------------  S Y S T E M  ---------------");
1136   st->cr();
1137 
1138   // STEP("printing OS information")
1139 
1140   os::print_os_info(st);
1141   st->cr();
1142 
1143   // STEP("printing CPU info")
1144 
1145   os::print_cpu_info(st, buf, sizeof(buf));
1146   st->cr();
1147 
1148   // STEP("printing memory info")
1149 
1150   os::print_memory_info(st);
1151   st->cr();
1152 
1153   // STEP("printing internal vm info")
1154 
1155   st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
1156   st->cr();
1157 
1158   // print a defined marker to show that error handling finished correctly.
1159   // STEP("printing end marker")
1160 
1161   st->print_cr("END.");
1162 }
1163 
1164 volatile intptr_t VMError::first_error_tid = -1;
1165 
1166 // An error could happen before tty is initialized or after it has been
1167 // destroyed.
1168 // Please note: to prevent large stack allocations, the log- and
1169 // output-stream use a global scratch buffer for format printing.
1170 // (see VmError::report_and_die(). Access to those streams is synchronized
1171 // in  VmError::report_and_die() - there is only one reporting thread at
1172 // any given time.
1173 fdStream VMError::out(defaultStream::output_fd());
1174 fdStream VMError::log; // error log used by VMError::report_and_die()
1175 




 302         st->print_cr("#   JVM is running with Zero Based Compressed Oops mode in which the Java heap is");
 303         st->print_cr("#     placed in the first 32GB address space. The Java Heap base address is the");
 304         st->print_cr("#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress");
 305         st->print_cr("#     to set the Java Heap base and to place the Java Heap above 32GB virtual address.");
 306         break;
 307       default:
 308         break;
 309     }
 310   }
 311   st->print_cr("# This output file may be truncated or incomplete.");
 312 }
 313 
 314 static void report_vm_version(outputStream* st, char* buf, int buflen) {
 315    // VM version
 316    st->print_cr("#");
 317    JDK_Version::current().to_string(buf, buflen);
 318    const char* runtime_name = JDK_Version::runtime_name() != NULL ?
 319                                 JDK_Version::runtime_name() : "";
 320    const char* runtime_version = JDK_Version::runtime_version() != NULL ?
 321                                    JDK_Version::runtime_version() : "";
 322    const char* jdk_debug_level = VM_Version::printable_jdk_debug_level() != NULL ?
 323                                    VM_Version::printable_jdk_debug_level() : "";
 324 
 325    st->print_cr("# JRE version: %s (%s) (%sbuild %s)", runtime_name, buf,
 326                  jdk_debug_level, runtime_version);
 327 
 328    // This is the long version with some default settings added
 329    st->print_cr("# Java VM: %s (%s%s, %s%s%s%s%s, %s, %s)",
 330                  VM_Version::vm_name(),
 331                  jdk_debug_level,
 332                  VM_Version::vm_release(),
 333                  VM_Version::vm_info_string(),
 334                  TieredCompilation ? ", tiered" : "",
 335 #if INCLUDE_JVMCI
 336                  EnableJVMCI ? ", jvmci" : "",
 337                  UseJVMCICompiler ? ", jvmci compiler" : "",
 338 #else
 339                  "", "",
 340 #endif
 341                  UseCompressedOops ? ", compressed oops" : "",
 342                  GCConfig::hs_err_name(),
 343                  VM_Version::vm_platform_string()
 344                );
 345 }
 346 
 347 // This is the main function to report a fatal error. Only one thread can
 348 // call this function, so we don't need to worry about MT-safety. But it's
 349 // possible that the error handler itself may crash or die on an internal
 350 // error, for example, when the stack/heap is badly damaged. We must be
 351 // able to handle recursive errors that happen inside error handler.
 352 //
 353 // Error reporting is done in several steps. If a crash or internal error
 354 // occurred when reporting an error, the nested signal/exception handler
 355 // can skip steps that are already (or partially) done. Error reporting will
 356 // continue from the next step. This allows us to retrieve and print
 357 // information that may be unsafe to get after a fatal error. If it happens,
 358 // you may find nested report_and_die() frames when you look at the stack
 359 // in a debugger.
 360 //
 361 // In general, a hang in error handler is much worse than a crash or internal
 362 // error, as it's harder to recover from a hang. Deadlock can happen if we
 363 // try to grab a lock that is already owned by current thread, or if the


 972        os::print_os_info(st);
 973        st->cr();
 974      }
 975 
 976   STEP("printing CPU info")
 977      if (_verbose) {
 978        os::print_cpu_info(st, buf, sizeof(buf));
 979        st->cr();
 980      }
 981 
 982   STEP("printing memory info")
 983 
 984      if (_verbose) {
 985        os::print_memory_info(st);
 986        st->cr();
 987      }
 988 
 989   STEP("printing internal vm info")
 990 
 991      if (_verbose) {
 992        st->print_cr("vm_info: %s", VM_Version::internal_vm_info_string());
 993        st->cr();
 994      }
 995 
 996   // print a defined marker to show that error handling finished correctly.
 997   STEP("printing end marker")
 998 
 999      if (_verbose) {
1000        st->print_cr("END.");
1001      }
1002 
1003   END
1004 
1005 # undef BEGIN
1006 # undef STEP
1007 # undef END
1008 }
1009 
1010 // Report for the vm_info_cmd. This prints out the information above omitting
1011 // crash and thread specific information.  If output is added above, it should be added
1012 // here also, if it is safe to call during a running process.


1135   st->print_cr("---------------  S Y S T E M  ---------------");
1136   st->cr();
1137 
1138   // STEP("printing OS information")
1139 
1140   os::print_os_info(st);
1141   st->cr();
1142 
1143   // STEP("printing CPU info")
1144 
1145   os::print_cpu_info(st, buf, sizeof(buf));
1146   st->cr();
1147 
1148   // STEP("printing memory info")
1149 
1150   os::print_memory_info(st);
1151   st->cr();
1152 
1153   // STEP("printing internal vm info")
1154 
1155   st->print_cr("vm_info: %s", VM_Version::internal_vm_info_string());
1156   st->cr();
1157 
1158   // print a defined marker to show that error handling finished correctly.
1159   // STEP("printing end marker")
1160 
1161   st->print_cr("END.");
1162 }
1163 
1164 volatile intptr_t VMError::first_error_tid = -1;
1165 
1166 // An error could happen before tty is initialized or after it has been
1167 // destroyed.
1168 // Please note: to prevent large stack allocations, the log- and
1169 // output-stream use a global scratch buffer for format printing.
1170 // (see VmError::report_and_die(). Access to those streams is synchronized
1171 // in  VmError::report_and_die() - there is only one reporting thread at
1172 // any given time.
1173 fdStream VMError::out(defaultStream::output_fd());
1174 fdStream VMError::log; // error log used by VMError::report_and_die()
1175 


< prev index next >