1.1 --- a/src/share/vm/utilities/debug.cpp Thu Jul 04 04:03:28 2013 -0700 1.2 +++ b/src/share/vm/utilities/debug.cpp Thu Jul 04 21:10:17 2013 -0700 1.3 @@ -314,8 +314,8 @@ 1.4 #ifndef PRODUCT 1.5 #include <signal.h> 1.6 1.7 -void test_error_handler(size_t test_num) 1.8 -{ 1.9 +void test_error_handler() { 1.10 + uintx test_num = ErrorHandlerTest; 1.11 if (test_num == 0) return; 1.12 1.13 // If asserts are disabled, use the corresponding guarantee instead. 1.14 @@ -327,6 +327,8 @@ 1.15 1.16 const char* const eol = os::line_separator(); 1.17 const char* const msg = "this message should be truncated during formatting"; 1.18 + char * const dataPtr = NULL; // bad data pointer 1.19 + const void (*funcPtr)(void) = (const void(*)()) 0xF; // bad function pointer 1.20 1.21 // Keep this in sync with test/runtime/6888954/vmerrors.sh. 1.22 switch (n) { 1.23 @@ -348,11 +350,16 @@ 1.24 case 9: ShouldNotCallThis(); 1.25 case 10: ShouldNotReachHere(); 1.26 case 11: Unimplemented(); 1.27 - // This is last because it does not generate an hs_err* file on Windows. 1.28 - case 12: os::signal_raise(SIGSEGV); 1.29 + // There's no guarantee the bad data pointer will crash us 1.30 + // so "break" out to the ShouldNotReachHere(). 1.31 + case 12: *dataPtr = '\0'; break; 1.32 + // There's no guarantee the bad function pointer will crash us 1.33 + // so "break" out to the ShouldNotReachHere(). 1.34 + case 13: (*funcPtr)(); break; 1.35 1.36 - default: ShouldNotReachHere(); 1.37 + default: tty->print_cr("ERROR: %d: unexpected test_num value.", n); 1.38 } 1.39 + ShouldNotReachHere(); 1.40 } 1.41 #endif // !PRODUCT 1.42