< prev index next >

src/hotspot/os/aix/os_aix.cpp

Print this page




3018   // pthread_sigmask returns error number, sigthreadmask -1 and sets global errno
3019   // (so, pthread_sigmask is more theadsafe for error handling)
3020   // But success is always 0.
3021   return rc == 0 ? true : false;
3022 }
3023 
3024 // Function to unblock all signals which are, according
3025 // to POSIX, typical program error signals. If they happen while being blocked,
3026 // they typically will bring down the process immediately.
3027 bool unblock_program_error_signals() {
3028   sigset_t set;
3029   ::sigemptyset(&set);
3030   ::sigaddset(&set, SIGILL);
3031   ::sigaddset(&set, SIGBUS);
3032   ::sigaddset(&set, SIGFPE);
3033   ::sigaddset(&set, SIGSEGV);
3034   return set_thread_signal_mask(SIG_UNBLOCK, &set, NULL);
3035 }
3036 
3037 // Renamed from 'signalHandler' to avoid collision with other shared libs.
3038 void javaSignalHandler(int sig, siginfo_t* info, void* uc) {
3039   assert(info != NULL && uc != NULL, "it must be old kernel");
3040 
3041   // Never leave program error signals blocked;
3042   // on all our platforms they would bring down the process immediately when
3043   // getting raised while being blocked.
3044   unblock_program_error_signals();
3045 
3046   int orig_errno = errno;  // Preserve errno value over signal handler.
3047   JVM_handle_aix_signal(sig, info, uc, true);
3048   errno = orig_errno;
3049 }
3050 
3051 // This boolean allows users to forward their own non-matching signals
3052 // to JVM_handle_aix_signal, harmlessly.
3053 bool os::Aix::signal_handlers_are_installed = false;
3054 
3055 // For signal-chaining
3056 struct sigaction sigact[NSIG];
3057 sigset_t sigs;
3058 bool os::Aix::libjsig_is_loaded = false;


3577   }
3578 
3579   trcVerbose("processor count: %d", os::_processor_count);
3580   trcVerbose("physical memory: %lu", Aix::_physical_memory);
3581 
3582   // Initially build up the loaded dll map.
3583   LoadedLibraries::reload();
3584   if (Verbose) {
3585     trcVerbose("Loaded Libraries: ");
3586     LoadedLibraries::print(tty);
3587   }
3588 
3589   // initialize suspend/resume support - must do this before signal_sets_init()
3590   if (SR_initialize() != 0) {
3591     perror("SR_initialize failed");
3592     return JNI_ERR;
3593   }
3594 
3595   Aix::signal_sets_init();
3596   Aix::install_signal_handlers();




3597 
3598   // Check and sets minimum stack sizes against command line options
3599   if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
3600     return JNI_ERR;
3601   }
3602 
3603   if (UseNUMA) {
3604     UseNUMA = false;
3605     warning("NUMA optimizations are not available on this OS.");
3606   }
3607 
3608   if (MaxFDLimit) {
3609     // Set the number of file descriptors to max. print out error
3610     // if getrlimit/setrlimit fails but continue regardless.
3611     struct rlimit nbr_files;
3612     int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
3613     if (status != 0) {
3614       log_info(os)("os::init_2 getrlimit failed: %s", os::strerror(errno));
3615     } else {
3616       nbr_files.rlim_cur = nbr_files.rlim_max;




3018   // pthread_sigmask returns error number, sigthreadmask -1 and sets global errno
3019   // (so, pthread_sigmask is more theadsafe for error handling)
3020   // But success is always 0.
3021   return rc == 0 ? true : false;
3022 }
3023 
3024 // Function to unblock all signals which are, according
3025 // to POSIX, typical program error signals. If they happen while being blocked,
3026 // they typically will bring down the process immediately.
3027 bool unblock_program_error_signals() {
3028   sigset_t set;
3029   ::sigemptyset(&set);
3030   ::sigaddset(&set, SIGILL);
3031   ::sigaddset(&set, SIGBUS);
3032   ::sigaddset(&set, SIGFPE);
3033   ::sigaddset(&set, SIGSEGV);
3034   return set_thread_signal_mask(SIG_UNBLOCK, &set, NULL);
3035 }
3036 
3037 // Renamed from 'signalHandler' to avoid collision with other shared libs.
3038 static void javaSignalHandler(int sig, siginfo_t* info, void* uc) {
3039   assert(info != NULL && uc != NULL, "it must be old kernel");
3040 
3041   // Never leave program error signals blocked;
3042   // on all our platforms they would bring down the process immediately when
3043   // getting raised while being blocked.
3044   unblock_program_error_signals();
3045 
3046   int orig_errno = errno;  // Preserve errno value over signal handler.
3047   JVM_handle_aix_signal(sig, info, uc, true);
3048   errno = orig_errno;
3049 }
3050 
3051 // This boolean allows users to forward their own non-matching signals
3052 // to JVM_handle_aix_signal, harmlessly.
3053 bool os::Aix::signal_handlers_are_installed = false;
3054 
3055 // For signal-chaining
3056 struct sigaction sigact[NSIG];
3057 sigset_t sigs;
3058 bool os::Aix::libjsig_is_loaded = false;


3577   }
3578 
3579   trcVerbose("processor count: %d", os::_processor_count);
3580   trcVerbose("physical memory: %lu", Aix::_physical_memory);
3581 
3582   // Initially build up the loaded dll map.
3583   LoadedLibraries::reload();
3584   if (Verbose) {
3585     trcVerbose("Loaded Libraries: ");
3586     LoadedLibraries::print(tty);
3587   }
3588 
3589   // initialize suspend/resume support - must do this before signal_sets_init()
3590   if (SR_initialize() != 0) {
3591     perror("SR_initialize failed");
3592     return JNI_ERR;
3593   }
3594 
3595   Aix::signal_sets_init();
3596   Aix::install_signal_handlers();
3597   // Initialize data for jdk.internal.misc.Signal
3598   if (!ReduceSignalUsage) {
3599     signal_init_pd();
3600   }
3601 
3602   // Check and sets minimum stack sizes against command line options
3603   if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
3604     return JNI_ERR;
3605   }
3606 
3607   if (UseNUMA) {
3608     UseNUMA = false;
3609     warning("NUMA optimizations are not available on this OS.");
3610   }
3611 
3612   if (MaxFDLimit) {
3613     // Set the number of file descriptors to max. print out error
3614     // if getrlimit/setrlimit fails but continue regardless.
3615     struct rlimit nbr_files;
3616     int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
3617     if (status != 0) {
3618       log_info(os)("os::init_2 getrlimit failed: %s", os::strerror(errno));
3619     } else {
3620       nbr_files.rlim_cur = nbr_files.rlim_max;


< prev index next >