comparison src/share/vm/utilities/vmError.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 3eed8712d410 f73af4455d7d
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
40 #include "utilities/defaultStream.hpp" 40 #include "utilities/defaultStream.hpp"
41 #include "utilities/errorReporter.hpp" 41 #include "utilities/errorReporter.hpp"
42 #include "utilities/events.hpp" 42 #include "utilities/events.hpp"
43 #include "utilities/top.hpp" 43 #include "utilities/top.hpp"
44 #include "utilities/vmError.hpp" 44 #include "utilities/vmError.hpp"
45
46 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
45 47
46 // List of environment variables that should be reported in error log file. 48 // List of environment variables that should be reported in error log file.
47 const char *env_list[] = { 49 const char *env_list[] = {
48 // All platforms 50 // All platforms
49 "JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH", 51 "JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH",
357 if (_size) { 359 if (_size) {
358 st->print("# Native memory allocation "); 360 st->print("# Native memory allocation ");
359 st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " : 361 st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " :
360 "(mmap) failed to map "); 362 "(mmap) failed to map ");
361 jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size); 363 jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size);
362 st->print(buf); 364 st->print("%s", buf);
363 st->print(" bytes"); 365 st->print(" bytes");
364 if (_message != NULL) { 366 if (_message != NULL) {
365 st->print(" for "); 367 st->print(" for ");
366 st->print(_message); 368 st->print("%s", _message);
367 } 369 }
368 st->cr(); 370 st->cr();
369 } else { 371 } else {
370 if (_message != NULL) 372 if (_message != NULL)
371 st->print("# "); 373 st->print("# ");
372 st->print_cr(_message); 374 st->print_cr("%s", _message);
373 } 375 }
374 // In error file give some solutions 376 // In error file give some solutions
375 if (_verbose) { 377 if (_verbose) {
376 st->print_cr("# Possible reasons:"); 378 st->print_cr("# Possible reasons:");
377 st->print_cr("# The system is out of physical RAM or swap space"); 379 st->print_cr("# The system is out of physical RAM or swap space");
484 if (coredump_status) { 486 if (coredump_status) {
485 st->print("Core dump written. Default location: %s", coredump_message); 487 st->print("Core dump written. Default location: %s", coredump_message);
486 } else { 488 } else {
487 st->print("Failed to write core dump. %s", coredump_message); 489 st->print("Failed to write core dump. %s", coredump_message);
488 } 490 }
489 st->print_cr(""); 491 st->cr();
490 st->print_cr("#"); 492 st->print_cr("#");
491 493
492 STEP(65, "(printing bug submit message)") 494 STEP(65, "(printing bug submit message)")
493 495
494 if (should_report_bug(_id) && _verbose) { 496 if (should_report_bug(_id) && _verbose) {
617 while (count++ < StackPrintLimit) { 619 while (count++ < StackPrintLimit) {
618 fr.print_on_error(st, buf, sizeof(buf)); 620 fr.print_on_error(st, buf, sizeof(buf));
619 st->cr(); 621 st->cr();
620 // Compiled code may use EBP register on x86 so it looks like 622 // Compiled code may use EBP register on x86 so it looks like
621 // non-walkable C frame. Use frame.sender() for java frames. 623 // non-walkable C frame. Use frame.sender() for java frames.
622 if (_thread && _thread->is_Java_thread() && fr.is_java_frame()) { 624 if (_thread && _thread->is_Java_thread()) {
623 RegisterMap map((JavaThread*)_thread, false); // No update 625 // Catch very first native frame by using stack address.
624 fr = fr.sender(&map); 626 // For JavaThread stack_base and stack_size should be set.
625 continue; 627 if (!_thread->on_local_stack((address)(fr.sender_sp() + 1))) {
628 break;
629 }
630 if (fr.is_java_frame()) {
631 RegisterMap map((JavaThread*)_thread, false); // No update
632 fr = fr.sender(&map);
633 } else {
634 fr = os::get_sender_for_C_frame(&fr);
635 }
636 } else {
637 // is_first_C_frame() does only simple checks for frame pointer,
638 // it will pass if java compiled code has a pointer in EBP.
639 if (os::is_first_C_frame(&fr)) break;
640 fr = os::get_sender_for_C_frame(&fr);
626 } 641 }
627 if (os::is_first_C_frame(&fr)) break;
628 fr = os::get_sender_for_C_frame(&fr);
629 } 642 }
630 643
631 if (count > StackPrintLimit) { 644 if (count > StackPrintLimit) {
632 st->print_cr("...<more frames>..."); 645 st->print_cr("...<more frames>...");
633 } 646 }
1064 1077
1065 // done with OnError 1078 // done with OnError
1066 OnError = NULL; 1079 OnError = NULL;
1067 } 1080 }
1068 1081
1069 static bool skip_replay = false; 1082 static bool skip_replay = ReplayCompiles; // Do not overwrite file during replay
1070 if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) { 1083 if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) {
1071 skip_replay = true; 1084 skip_replay = true;
1072 ciEnv* env = ciEnv::current(); 1085 ciEnv* env = ciEnv::current();
1073 if (env != NULL) { 1086 if (env != NULL) {
1074 int fd = prepare_log_file(ReplayDataFile, "replay_pid%p.log", buffer, sizeof(buffer)); 1087 int fd = prepare_log_file(ReplayDataFile, "replay_pid%p.log", buffer, sizeof(buffer));