37 #include "compiler/disassembler.hpp"
38 #include "interpreter/interpreter.hpp"
39 #include "memory/allocation.inline.hpp"
40 #include "nativeInst_s390.hpp"
41 #include "os_share_linux.hpp"
42 #include "prims/jniFastGetField.hpp"
43 #include "prims/jvm_misc.hpp"
44 #include "runtime/arguments.hpp"
45 #include "runtime/extendedPC.hpp"
46 #include "runtime/frame.inline.hpp"
47 #include "runtime/interfaceSupport.inline.hpp"
48 #include "runtime/java.hpp"
49 #include "runtime/javaCalls.hpp"
50 #include "runtime/mutexLocker.hpp"
51 #include "runtime/osThread.hpp"
52 #include "runtime/sharedRuntime.hpp"
53 #include "runtime/stubRoutines.hpp"
54 #include "runtime/thread.inline.hpp"
55 #include "runtime/timer.hpp"
56 #include "utilities/events.hpp"
57 #include "utilities/vmError.hpp"
58
59 // put OS-includes here
60 # include <sys/types.h>
61 # include <sys/mman.h>
62 # include <pthread.h>
63 # include <signal.h>
64 # include <errno.h>
65 # include <dlfcn.h>
66 # include <stdlib.h>
67 # include <stdio.h>
68 # include <unistd.h>
69 # include <sys/resource.h>
70 # include <pthread.h>
71 # include <sys/stat.h>
72 # include <sys/time.h>
73 # include <sys/utsname.h>
74 # include <sys/socket.h>
75 # include <sys/wait.h>
76 # include <pwd.h>
252
253 SignalHandlerMark shm(t);
254
255 // Note: it's not uncommon that JNI code uses signal/sigset to install
256 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
257 // or have a SIGILL handler when detecting CPU type). When that happens,
258 // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
259 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
260 // that do not require siginfo/ucontext first.
261
262 if (sig == SIGPIPE) {
263 if (os::Linux::chained_handler(sig, info, ucVoid)) {
264 return true;
265 } else {
266 if (PrintMiscellaneous && (WizardMode || Verbose)) {
267 warning("Ignoring SIGPIPE - see bug 4229104");
268 }
269 return true;
270 }
271 }
272
273 JavaThread* thread = NULL;
274 VMThread* vmthread = NULL;
275 if (os::Linux::signal_handlers_are_installed) {
276 if (t != NULL) {
277 if(t->is_Java_thread()) {
278 thread = (JavaThread*)t;
279 } else if(t->is_VM_thread()) {
280 vmthread = (VMThread *)t;
281 }
282 }
283 }
284
285 // Moved SafeFetch32 handling outside thread!=NULL conditional block to make
286 // it work if no associated JavaThread object exists.
287 if (uc) {
288 address const pc = os::Linux::ucontext_get_pc(uc);
289 if (pc && StubRoutines::is_safefetch_fault(pc)) {
290 os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
291 return true;
|
37 #include "compiler/disassembler.hpp"
38 #include "interpreter/interpreter.hpp"
39 #include "memory/allocation.inline.hpp"
40 #include "nativeInst_s390.hpp"
41 #include "os_share_linux.hpp"
42 #include "prims/jniFastGetField.hpp"
43 #include "prims/jvm_misc.hpp"
44 #include "runtime/arguments.hpp"
45 #include "runtime/extendedPC.hpp"
46 #include "runtime/frame.inline.hpp"
47 #include "runtime/interfaceSupport.inline.hpp"
48 #include "runtime/java.hpp"
49 #include "runtime/javaCalls.hpp"
50 #include "runtime/mutexLocker.hpp"
51 #include "runtime/osThread.hpp"
52 #include "runtime/sharedRuntime.hpp"
53 #include "runtime/stubRoutines.hpp"
54 #include "runtime/thread.inline.hpp"
55 #include "runtime/timer.hpp"
56 #include "utilities/events.hpp"
57 #include "utilities/debug.hpp"
58 #include "utilities/vmError.hpp"
59
60 // put OS-includes here
61 # include <sys/types.h>
62 # include <sys/mman.h>
63 # include <pthread.h>
64 # include <signal.h>
65 # include <errno.h>
66 # include <dlfcn.h>
67 # include <stdlib.h>
68 # include <stdio.h>
69 # include <unistd.h>
70 # include <sys/resource.h>
71 # include <pthread.h>
72 # include <sys/stat.h>
73 # include <sys/time.h>
74 # include <sys/utsname.h>
75 # include <sys/socket.h>
76 # include <sys/wait.h>
77 # include <pwd.h>
253
254 SignalHandlerMark shm(t);
255
256 // Note: it's not uncommon that JNI code uses signal/sigset to install
257 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
258 // or have a SIGILL handler when detecting CPU type). When that happens,
259 // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
260 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
261 // that do not require siginfo/ucontext first.
262
263 if (sig == SIGPIPE) {
264 if (os::Linux::chained_handler(sig, info, ucVoid)) {
265 return true;
266 } else {
267 if (PrintMiscellaneous && (WizardMode || Verbose)) {
268 warning("Ignoring SIGPIPE - see bug 4229104");
269 }
270 return true;
271 }
272 }
273
274 #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
275 if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
276 handle_assert_poison_fault(ucVoid, info->si_addr);
277 return 1;
278 }
279 #endif
280
281 JavaThread* thread = NULL;
282 VMThread* vmthread = NULL;
283 if (os::Linux::signal_handlers_are_installed) {
284 if (t != NULL) {
285 if(t->is_Java_thread()) {
286 thread = (JavaThread*)t;
287 } else if(t->is_VM_thread()) {
288 vmthread = (VMThread *)t;
289 }
290 }
291 }
292
293 // Moved SafeFetch32 handling outside thread!=NULL conditional block to make
294 // it work if no associated JavaThread object exists.
295 if (uc) {
296 address const pc = os::Linux::ucontext_get_pc(uc);
297 if (pc && StubRoutines::is_safefetch_fault(pc)) {
298 os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
299 return true;
|