284
285 // Note: it's not uncommon that JNI code uses signal/sigset to install
286 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
287 // or have a SIGILL handler when detecting CPU type). When that happens,
288 // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
289 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
290 // that do not require siginfo/ucontext first.
291
292 if (sig == SIGPIPE || sig == SIGXFSZ) {
293 // allow chained handler to go first
294 if (os::Linux::chained_handler(sig, info, ucVoid)) {
295 return true;
296 } else {
297 // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
298 return true;
299 }
300 }
301
302 #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
303 if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
304 handle_assert_poison_fault(ucVoid, info->si_addr);
305 return 1;
306 }
307 #endif
308
309 JavaThread* thread = NULL;
310 VMThread* vmthread = NULL;
311 if (os::Linux::signal_handlers_are_installed) {
312 if (t != NULL ){
313 if(t->is_Java_thread()) {
314 thread = (JavaThread*)t;
315 }
316 else if(t->is_VM_thread()){
317 vmthread = (VMThread *)t;
318 }
319 }
320 }
321
322 address stub = NULL;
323 address pc = NULL;
324 bool unsafe_access = false;
325
|
284
285 // Note: it's not uncommon that JNI code uses signal/sigset to install
286 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
287 // or have a SIGILL handler when detecting CPU type). When that happens,
288 // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
289 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
290 // that do not require siginfo/ucontext first.
291
292 if (sig == SIGPIPE || sig == SIGXFSZ) {
293 // allow chained handler to go first
294 if (os::Linux::chained_handler(sig, info, ucVoid)) {
295 return true;
296 } else {
297 // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
298 return true;
299 }
300 }
301
302 #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
303 if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
304 if (handle_assert_poison_fault(ucVoid, info->si_addr)) {
305 return 1;
306 }
307 }
308 #endif
309
310 JavaThread* thread = NULL;
311 VMThread* vmthread = NULL;
312 if (os::Linux::signal_handlers_are_installed) {
313 if (t != NULL ){
314 if(t->is_Java_thread()) {
315 thread = (JavaThread*)t;
316 }
317 else if(t->is_VM_thread()){
318 vmthread = (VMThread *)t;
319 }
320 }
321 }
322
323 address stub = NULL;
324 address pc = NULL;
325 bool unsafe_access = false;
326
|