253 // Note: it's not uncommon that JNI code uses signal/sigset to install
254 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
255 // or have a SIGILL handler when detecting CPU type). When that happens,
256 // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
257 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
258 // that do not require siginfo/ucontext first.
259
260 if (sig == SIGPIPE) {
261 if (os::Linux::chained_handler(sig, info, ucVoid)) {
262 return true;
263 } else {
264 if (PrintMiscellaneous && (WizardMode || Verbose)) {
265 warning("Ignoring SIGPIPE - see bug 4229104");
266 }
267 return true;
268 }
269 }
270
271 #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
272 if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
273 handle_assert_poison_fault(ucVoid, info->si_addr);
274 return 1;
275 }
276 #endif
277
278 JavaThread* thread = NULL;
279 VMThread* vmthread = NULL;
280 if (os::Linux::signal_handlers_are_installed) {
281 if (t != NULL) {
282 if(t->is_Java_thread()) {
283 thread = (JavaThread*)t;
284 } else if(t->is_VM_thread()) {
285 vmthread = (VMThread *)t;
286 }
287 }
288 }
289
290 // Moved SafeFetch32 handling outside thread!=NULL conditional block to make
291 // it work if no associated JavaThread object exists.
292 if (uc) {
293 address const pc = os::Linux::ucontext_get_pc(uc);
294 if (pc && StubRoutines::is_safefetch_fault(pc)) {
|
253 // Note: it's not uncommon that JNI code uses signal/sigset to install
254 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
255 // or have a SIGILL handler when detecting CPU type). When that happens,
256 // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
257 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
258 // that do not require siginfo/ucontext first.
259
260 if (sig == SIGPIPE) {
261 if (os::Linux::chained_handler(sig, info, ucVoid)) {
262 return true;
263 } else {
264 if (PrintMiscellaneous && (WizardMode || Verbose)) {
265 warning("Ignoring SIGPIPE - see bug 4229104");
266 }
267 return true;
268 }
269 }
270
271 #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
272 if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
273 if (handle_assert_poison_fault(ucVoid, info->si_addr)) {
274 return 1;
275 }
276 }
277 #endif
278
279 JavaThread* thread = NULL;
280 VMThread* vmthread = NULL;
281 if (os::Linux::signal_handlers_are_installed) {
282 if (t != NULL) {
283 if(t->is_Java_thread()) {
284 thread = (JavaThread*)t;
285 } else if(t->is_VM_thread()) {
286 vmthread = (VMThread *)t;
287 }
288 }
289 }
290
291 // Moved SafeFetch32 handling outside thread!=NULL conditional block to make
292 // it work if no associated JavaThread object exists.
293 if (uc) {
294 address const pc = os::Linux::ucontext_get_pc(uc);
295 if (pc && StubRoutines::is_safefetch_fault(pc)) {
|