4444
4445 st->print(", sa_flags=");
4446 os::Posix::print_sa_flags(st, sa.sa_flags);
4447
4448 // Check: is it our handler?
4449 if(handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) ||
4450 handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)SR_handler)) {
4451 // It is our signal handler
4452 // check for flags, reset system-used one!
4453 if((int)sa.sa_flags != os::Linux::get_our_sigflags(sig)) {
4454 st->print(
4455 ", flags was changed from " PTR32_FORMAT ", consider using jsig library",
4456 os::Linux::get_our_sigflags(sig));
4457 }
4458 }
4459 st->cr();
4460 }
4461
4462
4463 #define DO_SIGNAL_CHECK(sig) \
4464 if (!sigismember(&check_signal_done, sig)) \
4465 os::Linux::check_signal_handler(sig)
4466
4467 // This method is a periodic task to check for misbehaving JNI applications
4468 // under CheckJNI, we can add any periodic checks here
4469
4470 void os::run_periodic_checks() {
4471
4472 if (check_signals == false) return;
4473
4474 // SEGV and BUS if overridden could potentially prevent
4475 // generation of hs*.log in the event of a crash, debugging
4476 // such a case can be very challenging, so we absolutely
4477 // check the following for a good measure:
4478 DO_SIGNAL_CHECK(SIGSEGV);
4479 DO_SIGNAL_CHECK(SIGILL);
4480 DO_SIGNAL_CHECK(SIGFPE);
4481 DO_SIGNAL_CHECK(SIGBUS);
4482 DO_SIGNAL_CHECK(SIGPIPE);
4483 DO_SIGNAL_CHECK(SIGXFSZ);
4484 #if defined(PPC64)
|
4444
4445 st->print(", sa_flags=");
4446 os::Posix::print_sa_flags(st, sa.sa_flags);
4447
4448 // Check: is it our handler?
4449 if(handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) ||
4450 handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)SR_handler)) {
4451 // It is our signal handler
4452 // check for flags, reset system-used one!
4453 if((int)sa.sa_flags != os::Linux::get_our_sigflags(sig)) {
4454 st->print(
4455 ", flags was changed from " PTR32_FORMAT ", consider using jsig library",
4456 os::Linux::get_our_sigflags(sig));
4457 }
4458 }
4459 st->cr();
4460 }
4461
4462
4463 #define DO_SIGNAL_CHECK(sig) \
4464 if (!sigismember(&check_signal_done, sig) && (sig != SIGINT || isatty(fileno(stdin)))) \
4465 os::Linux::check_signal_handler(sig)
4466
4467 // This method is a periodic task to check for misbehaving JNI applications
4468 // under CheckJNI, we can add any periodic checks here
4469
4470 void os::run_periodic_checks() {
4471
4472 if (check_signals == false) return;
4473
4474 // SEGV and BUS if overridden could potentially prevent
4475 // generation of hs*.log in the event of a crash, debugging
4476 // such a case can be very challenging, so we absolutely
4477 // check the following for a good measure:
4478 DO_SIGNAL_CHECK(SIGSEGV);
4479 DO_SIGNAL_CHECK(SIGILL);
4480 DO_SIGNAL_CHECK(SIGFPE);
4481 DO_SIGNAL_CHECK(SIGBUS);
4482 DO_SIGNAL_CHECK(SIGPIPE);
4483 DO_SIGNAL_CHECK(SIGXFSZ);
4484 #if defined(PPC64)
|