src/hotspot/share/utilities/vmError.cpp
changeset 49653 a569cb4425f3
parent 49334 aefee96e2b90
child 49725 e740e1a38c96
child 56422 b09629f4b243
equal deleted inserted replaced
49652:a74836b05c28 49653:a569cb4425f3
  1236 void VMError::report_and_die(const char* message)
  1236 void VMError::report_and_die(const char* message)
  1237 {
  1237 {
  1238   report_and_die(message, "%s", "");
  1238   report_and_die(message, "%s", "");
  1239 }
  1239 }
  1240 
  1240 
  1241 void VMError::report_and_die(Thread* thread, const char* filename, int lineno, const char* message,
  1241 void VMError::report_and_die(Thread* thread, void* context, const char* filename, int lineno, const char* message,
  1242                              const char* detail_fmt, va_list detail_args)
  1242                              const char* detail_fmt, va_list detail_args)
  1243 {
  1243 {
  1244   report_and_die(INTERNAL_ERROR, message, detail_fmt, detail_args, thread, NULL, NULL, NULL, filename, lineno, 0);
  1244   report_and_die(INTERNAL_ERROR, message, detail_fmt, detail_args, thread, NULL, NULL, context, filename, lineno, 0);
  1245 }
  1245 }
  1246 
  1246 
  1247 void VMError::report_and_die(Thread* thread, const char* filename, int lineno, size_t size,
  1247 void VMError::report_and_die(Thread* thread, const char* filename, int lineno, size_t size,
  1248                              VMErrorType vm_err_type, const char* detail_fmt, va_list detail_args) {
  1248                              VMErrorType vm_err_type, const char* detail_fmt, va_list detail_args) {
  1249   report_and_die(vm_err_type, NULL, detail_fmt, detail_args, thread, NULL, NULL, NULL, filename, lineno, size);
  1249   report_and_die(vm_err_type, NULL, detail_fmt, detail_args, thread, NULL, NULL, NULL, filename, lineno, size);
  1672   // Case 14 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java.
  1672   // Case 14 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java.
  1673   // Case 15 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java.
  1673   // Case 15 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java.
  1674   // Case 16 is tested by test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java.
  1674   // Case 16 is tested by test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java.
  1675   // Case 17 is tested by test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java.
  1675   // Case 17 is tested by test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java.
  1676   switch (how) {
  1676   switch (how) {
  1677     case  1: vmassert(str == NULL, "expected null");
  1677     case  1: vmassert(str == NULL, "expected null"); break;
  1678     case  2: vmassert(num == 1023 && *str == 'X',
  1678     case  2: vmassert(num == 1023 && *str == 'X',
  1679                       "num=" SIZE_FORMAT " str=\"%s\"", num, str);
  1679                       "num=" SIZE_FORMAT " str=\"%s\"", num, str); break;
  1680     case  3: guarantee(str == NULL, "expected null");
  1680     case  3: guarantee(str == NULL, "expected null"); break;
  1681     case  4: guarantee(num == 1023 && *str == 'X',
  1681     case  4: guarantee(num == 1023 && *str == 'X',
  1682                        "num=" SIZE_FORMAT " str=\"%s\"", num, str);
  1682                        "num=" SIZE_FORMAT " str=\"%s\"", num, str); break;
  1683     case  5: fatal("expected null");
  1683     case  5: fatal("expected null"); break;
  1684     case  6: fatal("num=" SIZE_FORMAT " str=\"%s\"", num, str);
  1684     case  6: fatal("num=" SIZE_FORMAT " str=\"%s\"", num, str); break;
  1685     case  7: fatal("%s%s#    %s%s#    %s%s#    %s%s#    %s%s#    "
  1685     case  7: fatal("%s%s#    %s%s#    %s%s#    %s%s#    %s%s#    "
  1686                    "%s%s#    %s%s#    %s%s#    %s%s#    %s%s#    "
  1686                    "%s%s#    %s%s#    %s%s#    %s%s#    %s%s#    "
  1687                    "%s%s#    %s%s#    %s%s#    %s%s#    %s",
  1687                    "%s%s#    %s%s#    %s%s#    %s%s#    %s",
  1688                    msg, eol, msg, eol, msg, eol, msg, eol, msg, eol,
  1688                    msg, eol, msg, eol, msg, eol, msg, eol, msg, eol,
  1689                    msg, eol, msg, eol, msg, eol, msg, eol, msg, eol,
  1689                    msg, eol, msg, eol, msg, eol, msg, eol, msg, eol,
  1690                    msg, eol, msg, eol, msg, eol, msg, eol, msg);
  1690                    msg, eol, msg, eol, msg, eol, msg, eol, msg); break;
  1691     case  8: vm_exit_out_of_memory(num, OOM_MALLOC_ERROR, "ChunkPool::allocate");
  1691     case  8: vm_exit_out_of_memory(num, OOM_MALLOC_ERROR, "ChunkPool::allocate"); break;
  1692     case  9: ShouldNotCallThis();
  1692     case  9: ShouldNotCallThis(); break;
  1693     case 10: ShouldNotReachHere();
  1693     case 10: ShouldNotReachHere(); break;
  1694     case 11: Unimplemented();
  1694     case 11: Unimplemented(); break;
  1695     // There's no guarantee the bad data pointer will crash us
  1695     // There's no guarantee the bad data pointer will crash us
  1696     // so "break" out to the ShouldNotReachHere().
  1696     // so "break" out to the ShouldNotReachHere().
  1697     case 12: *dataPtr = '\0'; break;
  1697     case 12: *dataPtr = '\0'; break;
  1698     // There's no guarantee the bad function pointer will crash us
  1698     // There's no guarantee the bad function pointer will crash us
  1699     // so "break" out to the ShouldNotReachHere().
  1699     // so "break" out to the ShouldNotReachHere().
  1712       }
  1712       }
  1713     }
  1713     }
  1714 
  1714 
  1715     default: tty->print_cr("ERROR: %d: unexpected test_num value.", how);
  1715     default: tty->print_cr("ERROR: %d: unexpected test_num value.", how);
  1716   }
  1716   }
       
  1717   tty->print_cr("VMError::controlled_crash: survived intentional crash. Did you suppress the assert?");
  1717   ShouldNotReachHere();
  1718   ShouldNotReachHere();
  1718 }
  1719 }
  1719 #endif // !PRODUCT
  1720 #endif // !PRODUCT
  1720 
  1721