6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // no precompiled headers
26 #include "classfile/classLoader.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "classfile/vmSymbols.hpp"
29 #include "code/icBuffer.hpp"
30 #include "code/vtableStubs.hpp"
31 #include "compiler/compileBroker.hpp"
32 #include "compiler/disassembler.hpp"
33 #include "interpreter/interpreter.hpp"
34 #include "jvm_linux.h"
35 #include "logging/log.hpp"
36 #include "memory/allocation.inline.hpp"
37 #include "memory/filemap.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "os_linux.inline.hpp"
40 #include "os_share_linux.hpp"
41 #include "prims/jniFastGetField.hpp"
42 #include "prims/jvm.h"
43 #include "prims/jvm_misc.hpp"
44 #include "runtime/arguments.hpp"
45 #include "runtime/atomic.hpp"
46 #include "runtime/extendedPC.hpp"
47 #include "runtime/globals.hpp"
48 #include "runtime/interfaceSupport.hpp"
49 #include "runtime/init.hpp"
50 #include "runtime/java.hpp"
51 #include "runtime/javaCalls.hpp"
52 #include "runtime/mutexLocker.hpp"
53 #include "runtime/objectMonitor.hpp"
54 #include "runtime/orderAccess.inline.hpp"
55 #include "runtime/osThread.hpp"
56 #include "runtime/perfMemory.hpp"
57 #include "runtime/sharedRuntime.hpp"
58 #include "runtime/statSampler.hpp"
59 #include "runtime/stubRoutines.hpp"
60 #include "runtime/thread.inline.hpp"
61 #include "runtime/threadCritical.hpp"
62 #include "runtime/timer.hpp"
4647 // under CheckJNI, we can add any periodic checks here
4648
4649 void os::run_periodic_checks() {
4650 if (check_signals == false) return;
4651
4652 // SEGV and BUS if overridden could potentially prevent
4653 // generation of hs*.log in the event of a crash, debugging
4654 // such a case can be very challenging, so we absolutely
4655 // check the following for a good measure:
4656 DO_SIGNAL_CHECK(SIGSEGV);
4657 DO_SIGNAL_CHECK(SIGILL);
4658 DO_SIGNAL_CHECK(SIGFPE);
4659 DO_SIGNAL_CHECK(SIGBUS);
4660 DO_SIGNAL_CHECK(SIGPIPE);
4661 DO_SIGNAL_CHECK(SIGXFSZ);
4662 #if defined(PPC64)
4663 DO_SIGNAL_CHECK(SIGTRAP);
4664 #endif
4665
4666 // ReduceSignalUsage allows the user to override these handlers
4667 // see comments at the very top and jvm_solaris.h
4668 if (!ReduceSignalUsage) {
4669 DO_SIGNAL_CHECK(SHUTDOWN1_SIGNAL);
4670 DO_SIGNAL_CHECK(SHUTDOWN2_SIGNAL);
4671 DO_SIGNAL_CHECK(SHUTDOWN3_SIGNAL);
4672 DO_SIGNAL_CHECK(BREAK_SIGNAL);
4673 }
4674
4675 DO_SIGNAL_CHECK(SR_signum);
4676 }
4677
4678 typedef int (*os_sigaction_t)(int, const struct sigaction *, struct sigaction *);
4679
4680 static os_sigaction_t os_sigaction = NULL;
4681
4682 void os::Linux::check_signal_handler(int sig) {
4683 char buf[O_BUFLEN];
4684 address jvmHandler = NULL;
4685
4686
4687 struct sigaction act;
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // no precompiled headers
26 #include "jvm.h"
27 #include "classfile/classLoader.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "code/icBuffer.hpp"
31 #include "code/vtableStubs.hpp"
32 #include "compiler/compileBroker.hpp"
33 #include "compiler/disassembler.hpp"
34 #include "interpreter/interpreter.hpp"
35 #include "logging/log.hpp"
36 #include "memory/allocation.inline.hpp"
37 #include "memory/filemap.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "os_linux.inline.hpp"
40 #include "os_share_linux.hpp"
41 #include "prims/jniFastGetField.hpp"
42 #include "prims/jvm_misc.hpp"
43 #include "runtime/arguments.hpp"
44 #include "runtime/atomic.hpp"
45 #include "runtime/extendedPC.hpp"
46 #include "runtime/globals.hpp"
47 #include "runtime/interfaceSupport.hpp"
48 #include "runtime/init.hpp"
49 #include "runtime/java.hpp"
50 #include "runtime/javaCalls.hpp"
51 #include "runtime/mutexLocker.hpp"
52 #include "runtime/objectMonitor.hpp"
53 #include "runtime/orderAccess.inline.hpp"
54 #include "runtime/osThread.hpp"
55 #include "runtime/perfMemory.hpp"
56 #include "runtime/sharedRuntime.hpp"
57 #include "runtime/statSampler.hpp"
58 #include "runtime/stubRoutines.hpp"
59 #include "runtime/thread.inline.hpp"
60 #include "runtime/threadCritical.hpp"
61 #include "runtime/timer.hpp"
4646 // under CheckJNI, we can add any periodic checks here
4647
4648 void os::run_periodic_checks() {
4649 if (check_signals == false) return;
4650
4651 // SEGV and BUS if overridden could potentially prevent
4652 // generation of hs*.log in the event of a crash, debugging
4653 // such a case can be very challenging, so we absolutely
4654 // check the following for a good measure:
4655 DO_SIGNAL_CHECK(SIGSEGV);
4656 DO_SIGNAL_CHECK(SIGILL);
4657 DO_SIGNAL_CHECK(SIGFPE);
4658 DO_SIGNAL_CHECK(SIGBUS);
4659 DO_SIGNAL_CHECK(SIGPIPE);
4660 DO_SIGNAL_CHECK(SIGXFSZ);
4661 #if defined(PPC64)
4662 DO_SIGNAL_CHECK(SIGTRAP);
4663 #endif
4664
4665 // ReduceSignalUsage allows the user to override these handlers
4666 // see comments at the very top and jvm_md.h
4667 if (!ReduceSignalUsage) {
4668 DO_SIGNAL_CHECK(SHUTDOWN1_SIGNAL);
4669 DO_SIGNAL_CHECK(SHUTDOWN2_SIGNAL);
4670 DO_SIGNAL_CHECK(SHUTDOWN3_SIGNAL);
4671 DO_SIGNAL_CHECK(BREAK_SIGNAL);
4672 }
4673
4674 DO_SIGNAL_CHECK(SR_signum);
4675 }
4676
4677 typedef int (*os_sigaction_t)(int, const struct sigaction *, struct sigaction *);
4678
4679 static os_sigaction_t os_sigaction = NULL;
4680
4681 void os::Linux::check_signal_handler(int sig) {
4682 char buf[O_BUFLEN];
4683 address jvmHandler = NULL;
4684
4685
4686 struct sigaction act;
|