@@ -869,19 +869,25 @@ kern_return_t catch_mach_exception_raise(
869
869
}
870
870
871
871
// This message should denote a Unix soft signal, with
872
- // 1. the exception type = EXC_SOFTWARE
873
- // 2. codes[0] (which is the code) = EXC_SOFT_SIGNAL
874
- // 3. codes[1] (which is the sub-code) = SIGSTOP
875
- if (!(exception_type == EXC_SOFTWARE &&
876
- codes[0 ] == EXC_SOFT_SIGNAL &&
877
- codes[num_codes -1 ] == SIGSTOP)) {
872
+ // 1. the exception type = EXC_SOFTWARE (5)
873
+ // 2. codes[0] (which is the code) = EXC_SOFT_SIGNAL (0x10003 / 65539)
874
+ // 3. codes[1] (which is the sub-code) = SIGSTOP (17)
875
+ if (exception_type != EXC_SOFTWARE || codes[0 ] != EXC_SOFT_SIGNAL) {
878
876
print_error (" catch_mach_exception_raise: Message doesn't denote a Unix "
879
877
" soft signal. exception_type = %d , codes[0] = %d , "
880
878
" codes[num_codes -1] = 0x%llx , num_codes = %d \n " ,
881
879
exception_type, codes[0 ], codes[num_codes - 1 ], num_codes);
882
880
return GOT_UNKNOWN_EXC;
883
881
}
884
- return KERN_SUCCESS;
882
+ int sig = codes[num_codes -1 ];
883
+ if (sig == SIGSTOP) {
884
+ return KERN_SUCCESS;
885
+ } else {
886
+ // Sometimes we get SIGTRAP(4) or SIGILL(5) instead of SIGSTOP (17) on aarch64.
887
+ // We currently can't deal with them. See JDK-8288429.
888
+ print_error (" catch_mach_exception_raise: signal is not SIGSTOP (%d )\n " , sig);
889
+ return GOT_UNKNOWN_EXC;
890
+ }
885
891
}
886
892
887
893
kern_return_t catch_mach_exception_raise_state (
0 commit comments