388 return frame();
389 } else {
390 return os::get_sender_for_C_frame(&myframe);
391 }
392 }
393
394 // Utility functions
395
396 // From IA32 System Programming Guide
397 enum {
398 trap_page_fault = 0xE
399 };
400
401 extern "C" JNIEXPORT int
402 JVM_handle_bsd_signal(int sig,
403 siginfo_t* info,
404 void* ucVoid,
405 int abort_if_unrecognized) {
406 ucontext_t* uc = (ucontext_t*) ucVoid;
407
408 Thread* t = ThreadLocalStorage::get_thread_slow();
409
410 // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
411 // (no destructors can be run)
412 os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
413
414 SignalHandlerMark shm(t);
415
416 // Note: it's not uncommon that JNI code uses signal/sigset to install
417 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
418 // or have a SIGILL handler when detecting CPU type). When that happens,
419 // JVM_handle_bsd_signal() might be invoked with junk info/ucVoid. To
420 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
421 // that do not require siginfo/ucontext first.
422
423 if (sig == SIGPIPE || sig == SIGXFSZ) {
424 // allow chained handler to go first
425 if (os::Bsd::chained_handler(sig, info, ucVoid)) {
426 return true;
427 } else {
428 if (PrintMiscellaneous && (WizardMode || Verbose)) {
|
388 return frame();
389 } else {
390 return os::get_sender_for_C_frame(&myframe);
391 }
392 }
393
394 // Utility functions
395
396 // From IA32 System Programming Guide
397 enum {
398 trap_page_fault = 0xE
399 };
400
401 extern "C" JNIEXPORT int
402 JVM_handle_bsd_signal(int sig,
403 siginfo_t* info,
404 void* ucVoid,
405 int abort_if_unrecognized) {
406 ucontext_t* uc = (ucontext_t*) ucVoid;
407
408 Thread* t = ThreadLocalStorage::thread(); // can't use Thread::current()
409
410 // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
411 // (no destructors can be run)
412 os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
413
414 SignalHandlerMark shm(t);
415
416 // Note: it's not uncommon that JNI code uses signal/sigset to install
417 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
418 // or have a SIGILL handler when detecting CPU type). When that happens,
419 // JVM_handle_bsd_signal() might be invoked with junk info/ucVoid. To
420 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
421 // that do not require siginfo/ucontext first.
422
423 if (sig == SIGPIPE || sig == SIGXFSZ) {
424 // allow chained handler to go first
425 if (os::Bsd::chained_handler(sig, info, ucVoid)) {
426 return true;
427 } else {
428 if (PrintMiscellaneous && (WizardMode || Verbose)) {
|