< prev index next >

src/share/vm/utilities/vmError.cpp

Print this page
rev 12504 : 8166944: Hanging Error Reporting steps may lead to torn error logs.
Reviewed-by: cjplummer, dholmes
Summary: Interupt error reporting if reporting steps hang to enable subsequent reporting steps to run.
rev 12505 : [mq]: 8166944-Hanging-Error-Reporting-04


 369   // Error handler self tests
 370 
 371   // test secondary error handling. Test it twice, to test that resetting
 372   // error handler after a secondary crash works.
 373   STEP("test secondary crash 1")
 374     if (_verbose && TestCrashInErrorHandler != 0) {
 375       st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
 376         TestCrashInErrorHandler);
 377       controlled_crash(TestCrashInErrorHandler);
 378     }
 379 
 380   STEP("test secondary crash 2")
 381     if (_verbose && TestCrashInErrorHandler != 0) {
 382       st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
 383         TestCrashInErrorHandler);
 384       controlled_crash(TestCrashInErrorHandler);
 385     }
 386 
 387   // TestUnresponsiveErrorHandler: We want to test both step timeouts and global timeout.
 388   // Step to global timeout ratio is 4:1, so in order to be absolutely sure we hit the
 389   // global timeout, lets execute the timeout step five times.
 390   // See corresponding test in test/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java
 391   #define TIMEOUT_TEST_STEP STEP("test unresponsive error reporting step") \
 392     if (_verbose && TestUnresponsiveErrorHandler) { os::infinite_sleep(); }
 393   TIMEOUT_TEST_STEP
 394   TIMEOUT_TEST_STEP
 395   TIMEOUT_TEST_STEP
 396   TIMEOUT_TEST_STEP
 397   TIMEOUT_TEST_STEP
 398 
 399   STEP("test safefetch in error handler")
 400     // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice
 401     // to test that resetting the signal handler works correctly.
 402     if (_verbose && TestSafeFetchInErrorHandler) {
 403       st->print_cr("Will test SafeFetch...");
 404       if (CanUseSafeFetch32()) {
 405         int* const invalid_pointer = (int*) get_segfault_address();
 406         const int x = 0x76543210;
 407         int i1 = SafeFetch32(invalid_pointer, x);
 408         int i2 = SafeFetch32(invalid_pointer, x);
 409         if (i1 == x && i2 == x) {




 369   // Error handler self tests
 370 
 371   // test secondary error handling. Test it twice, to test that resetting
 372   // error handler after a secondary crash works.
 373   STEP("test secondary crash 1")
 374     if (_verbose && TestCrashInErrorHandler != 0) {
 375       st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
 376         TestCrashInErrorHandler);
 377       controlled_crash(TestCrashInErrorHandler);
 378     }
 379 
 380   STEP("test secondary crash 2")
 381     if (_verbose && TestCrashInErrorHandler != 0) {
 382       st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
 383         TestCrashInErrorHandler);
 384       controlled_crash(TestCrashInErrorHandler);
 385     }
 386 
 387   // TestUnresponsiveErrorHandler: We want to test both step timeouts and global timeout.
 388   // Step to global timeout ratio is 4:1, so in order to be absolutely sure we hit the
 389   // global timeout, let's execute the timeout step five times.
 390   // See corresponding test in test/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java
 391   #define TIMEOUT_TEST_STEP STEP("test unresponsive error reporting step") \
 392     if (_verbose && TestUnresponsiveErrorHandler) { os::infinite_sleep(); }
 393   TIMEOUT_TEST_STEP
 394   TIMEOUT_TEST_STEP
 395   TIMEOUT_TEST_STEP
 396   TIMEOUT_TEST_STEP
 397   TIMEOUT_TEST_STEP
 398 
 399   STEP("test safefetch in error handler")
 400     // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice
 401     // to test that resetting the signal handler works correctly.
 402     if (_verbose && TestSafeFetchInErrorHandler) {
 403       st->print_cr("Will test SafeFetch...");
 404       if (CanUseSafeFetch32()) {
 405         int* const invalid_pointer = (int*) get_segfault_address();
 406         const int x = 0x76543210;
 407         int i1 = SafeFetch32(invalid_pointer, x);
 408         int i2 = SafeFetch32(invalid_pointer, x);
 409         if (i1 == x && i2 == x) {


< prev index next >