@@ -168,43 +168,8 @@ frame os::current_frame() {
168
168
return os::get_sender_for_C_frame (&tmp);
169
169
}
170
170
171
- // Utility functions
172
-
173
- extern " C" JNIEXPORT int
174
- JVM_handle_aix_signal (int sig, siginfo_t * info, void * ucVoid, int abort_if_unrecognized) {
175
-
176
- ucontext_t * uc = (ucontext_t *) ucVoid;
177
-
178
- Thread* t = Thread::current_or_null_safe ();
179
-
180
- // Note: it's not uncommon that JNI code uses signal/sigset to install
181
- // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
182
- // or have a SIGILL handler when detecting CPU type). When that happens,
183
- // JVM_handle_aix_signal() might be invoked with junk info/ucVoid. To
184
- // avoid unnecessary crash when libjsig is not preloaded, try handle signals
185
- // that do not require siginfo/ucontext first.
186
-
187
- if (sig == SIGPIPE || sig == SIGXFSZ) {
188
- if (PosixSignals::chained_handler (sig, info, ucVoid)) {
189
- return 1 ;
190
- } else {
191
- // Ignoring SIGPIPE - see bugs 4229104
192
- return 1 ;
193
- }
194
- }
195
-
196
- JavaThread* thread = NULL ;
197
- VMThread* vmthread = NULL ;
198
- if (PosixSignals::are_signal_handlers_installed ()) {
199
- if (t != NULL ) {
200
- if (t->is_Java_thread ()) {
201
- thread = t->as_Java_thread ();
202
- }
203
- else if (t->is_VM_thread ()) {
204
- vmthread = (VMThread *)t;
205
- }
206
- }
207
- }
171
+ bool PosixSignals::pd_hotspot_signal_handler (int sig, siginfo_t * info,
172
+ ucontext_t * uc, JavaThread* thread) {
208
173
209
174
// Decide if this trap can be handled by a stub.
210
175
address stub = NULL ;
@@ -226,8 +191,8 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
226
191
}
227
192
}
228
193
229
- if (info == NULL || uc == NULL || thread == NULL && vmthread == NULL ) {
230
- goto run_chained_handler;
194
+ if (info == NULL || uc == NULL ) {
195
+ return false ; // Fatal error
231
196
}
232
197
233
198
// If we are a java thread...
@@ -237,11 +202,11 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
237
202
if (sig == SIGSEGV && thread->is_in_full_stack (addr)) {
238
203
// stack overflow
239
204
if (os::Posix::handle_stack_overflow (thread, addr, pc, uc, &stub)) {
240
- return 1 ; // continue
205
+ return true ; // continue
241
206
} else if (stub != NULL ) {
242
207
goto run_stub;
243
208
} else {
244
- goto report_and_die;
209
+ return false ; // Fatal error
245
210
}
246
211
} // end handle SIGSEGV inside stack boundaries
247
212
@@ -281,17 +246,6 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
281
246
// happens rarely. In heap based and disjoint base compressd oop modes also loads
282
247
// are used for null checks.
283
248
284
- // A VM-related SIGILL may only occur if we are not in the zero page.
285
- // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else
286
- // in the zero page, because it is filled with 0x0. We ignore
287
- // explicit SIGILLs in the zero page.
288
- if (sig == SIGILL && (pc < (address) 0x200 )) {
289
- if (TraceTraps) {
290
- tty->print_raw_cr (" SIGILL happened inside zero page." );
291
- }
292
- goto report_and_die;
293
- }
294
-
295
249
int stop_type = -1 ;
296
250
// Handle signal from NativeJump::patch_verified_entry().
297
251
if (sig == SIGILL && nativeInstruction_at (pc)->is_sigill_zombie_not_entrant ()) {
@@ -384,10 +338,7 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
384
338
tty->print_cr (" trap: %s: %s (SIGTRAP, stop type %d)" , msg, detail_msg, stop_type);
385
339
}
386
340
387
- va_list detail_args;
388
- VMError::report_and_die (INTERNAL_ERROR, msg, detail_msg, detail_args, thread,
389
- pc, info, ucVoid, NULL , 0 , 0 );
390
- va_end (detail_args);
341
+ return false ; // Fatal error
391
342
}
392
343
393
344
else if (sig == SIGBUS) {
@@ -403,7 +354,7 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
403
354
}
404
355
next_pc = SharedRuntime::handle_unsafe_access (thread, next_pc);
405
356
os::Aix::ucontext_set_pc (uc, next_pc);
406
- return 1 ;
357
+ return true ;
407
358
}
408
359
}
409
360
}
@@ -428,7 +379,7 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
428
379
}
429
380
next_pc = SharedRuntime::handle_unsafe_access (thread, next_pc);
430
381
os::Aix::ucontext_set_pc (uc, next_pc);
431
- return 1 ;
382
+ return true ;
432
383
}
433
384
}
434
385
@@ -450,32 +401,10 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
450
401
// Save all thread context in case we need to restore it.
451
402
if (thread != NULL ) thread->set_saved_exception_pc (pc);
452
403
os::Aix::ucontext_set_pc (uc, stub);
453
- return 1 ;
454
- }
455
-
456
- run_chained_handler:
457
-
458
- // signal-chaining
459
- if (PosixSignals::chained_handler (sig, info, ucVoid)) {
460
- return 1 ;
404
+ return true ;
461
405
}
462
- if (!abort_if_unrecognized) {
463
- // caller wants another chance, so give it to him
464
- return 0 ;
465
- }
466
-
467
- report_and_die:
468
406
469
- // Use sigthreadmask instead of sigprocmask on AIX and unmask current signal.
470
- sigset_t newset;
471
- sigemptyset (&newset);
472
- sigaddset (&newset, sig);
473
- sigthreadmask (SIG_UNBLOCK, &newset, NULL );
474
-
475
- VMError::report_and_die (t, sig, pc, info, ucVoid);
476
-
477
- ShouldNotReachHere ();
478
- return 0 ;
407
+ return false ; // Fatal error
479
408
}
480
409
481
410
void os::Aix::init_thread_fpu_state (void ) {
0 commit comments