Skip to content

Commit 011dd0d

Browse files
committed
8254824: SignalHandlerMark have no purpose
Reviewed-by: stuefe, shade, dholmes, coleenp
1 parent 736e077 commit 011dd0d

File tree

11 files changed

+15
-49
lines changed

11 files changed

+15
-49
lines changed

src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
177177

178178
Thread* t = Thread::current_or_null_safe();
179179

180-
SignalHandlerMark shm(t);
181-
182180
// Note: it's not uncommon that JNI code uses signal/sigset to install
183181
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
184182
// or have a SIGILL handler when detecting CPU type). When that happens,

src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,11 @@ JVM_handle_bsd_signal(int sig,
401401

402402
Thread* t = Thread::current_or_null_safe();
403403

404-
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
405-
// (no destructors can be run)
404+
// If crash protection is installed we may longjmp away and no destructors
405+
// for objects in this scope will be run.
406+
// So don't use any RAII utilities before crash protection is checked.
406407
os::ThreadCrashProtection::check_crash_protection(sig, t);
407408

408-
SignalHandlerMark shm(t);
409-
410409
// Note: it's not uncommon that JNI code uses signal/sigset to install
411410
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
412411
// or have a SIGILL handler when detecting CPU type). When that happens,

src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ JVM_handle_bsd_signal(int sig,
124124

125125
Thread* t = Thread::current_or_null_safe();
126126

127-
SignalHandlerMark shm(t);
128-
129127
// handle SafeFetch faults
130128
if (sig == SIGSEGV || sig == SIGBUS) {
131129
sigjmp_buf* const pjb = get_jmp_buf_for_continuation();

src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,11 @@ JVM_handle_linux_signal(int sig,
173173

174174
Thread* t = Thread::current_or_null_safe();
175175

176-
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
177-
// (no destructors can be run)
176+
// If crash protection is installed we may longjmp away and no destructors
177+
// for objects in this scope will be run.
178+
// So don't use any RAII utilities before crash protection is checked.
178179
os::ThreadCrashProtection::check_crash_protection(sig, t);
179180

180-
SignalHandlerMark shm(t);
181-
182181
// Note: it's not uncommon that JNI code uses signal/sigset to install
183182
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
184183
// or have a SIGILL handler when detecting CPU type). When that happens,

src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,11 @@ extern "C" int JVM_handle_linux_signal(int sig, siginfo_t* info,
249249

250250
Thread* t = Thread::current_or_null_safe();
251251

252-
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
253-
// (no destructors can be run)
252+
// If crash protection is installed we may longjmp away and no destructors
253+
// for objects in this scope will be run.
254+
// So don't use any RAII utilities before crash protection is checked.
254255
os::ThreadCrashProtection::check_crash_protection(sig, t);
255256

256-
SignalHandlerMark shm(t);
257-
258257
if (sig == SIGILL &&
259258
((info->si_addr == (caddr_t)check_simd_fault_instr)
260259
|| info->si_addr == (caddr_t)check_vfp_fault_instr

src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ JVM_handle_linux_signal(int sig,
199199

200200
Thread* t = Thread::current_or_null_safe();
201201

202-
SignalHandlerMark shm(t);
203-
204202
// Note: it's not uncommon that JNI code uses signal/sigset to install
205203
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
206204
// or have a SIGILL handler when detecting CPU type). When that happens,

src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,11 @@ JVM_handle_linux_signal(int sig,
215215

216216
Thread* t = Thread::current_or_null_safe();
217217

218-
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
219-
// (no destructors can be run).
218+
// If crash protection is installed we may longjmp away and no destructors
219+
// for objects in this scope will be run.
220+
// So don't use any RAII utilities before crash protection is checked.
220221
os::ThreadCrashProtection::check_crash_protection(sig, t);
221222

222-
SignalHandlerMark shm(t);
223-
224223
// Note: it's not uncommon that JNI code uses signal/sigset to install
225224
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
226225
// or have a SIGILL handler when detecting CPU type). When that happens,

src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,11 @@ JVM_handle_linux_signal(int sig,
209209

210210
Thread* t = Thread::current_or_null_safe();
211211

212-
// Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
213-
// (no destructors can be run)
212+
// If crash protection is installed we may longjmp away and no destructors
213+
// for objects in this scope will be run.
214+
// So don't use any RAII utilities before crash protection is checked.
214215
os::ThreadCrashProtection::check_crash_protection(sig, t);
215216

216-
SignalHandlerMark shm(t);
217-
218217
// Note: it's not uncommon that JNI code uses signal/sigset to install
219218
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
220219
// or have a SIGILL handler when detecting CPU type). When that happens,

src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ JVM_handle_linux_signal(int sig,
120120

121121
Thread* t = Thread::current_or_null_safe();
122122

123-
SignalHandlerMark shm(t);
124-
125123
// handle SafeFetch faults
126124
if (sig == SIGSEGV || sig == SIGBUS) {
127125
sigjmp_buf* const pjb = get_jmp_buf_for_continuation();

src/hotspot/share/runtime/thread.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ Thread::Thread() {
260260
_current_pending_monitor_is_from_java = true;
261261
_current_waiting_monitor = NULL;
262262
_current_pending_raw_monitor = NULL;
263-
_num_nested_signal = 0;
264263
om_free_list = NULL;
265264
om_free_count = 0;
266265
om_free_provision = 32;

0 commit comments

Comments
 (0)