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_bsd.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_bsd.inline.hpp"
40 #include "os_share_bsd.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/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"
62 #include "semaphore_bsd.hpp"
3223 // This method is a periodic task to check for misbehaving JNI applications
3224 // under CheckJNI, we can add any periodic checks here
3225
3226 void os::run_periodic_checks() {
3227
3228 if (check_signals == false) return;
3229
3230 // SEGV and BUS if overridden could potentially prevent
3231 // generation of hs*.log in the event of a crash, debugging
3232 // such a case can be very challenging, so we absolutely
3233 // check the following for a good measure:
3234 DO_SIGNAL_CHECK(SIGSEGV);
3235 DO_SIGNAL_CHECK(SIGILL);
3236 DO_SIGNAL_CHECK(SIGFPE);
3237 DO_SIGNAL_CHECK(SIGBUS);
3238 DO_SIGNAL_CHECK(SIGPIPE);
3239 DO_SIGNAL_CHECK(SIGXFSZ);
3240
3241
3242 // ReduceSignalUsage allows the user to override these handlers
3243 // see comments at the very top and jvm_solaris.h
3244 if (!ReduceSignalUsage) {
3245 DO_SIGNAL_CHECK(SHUTDOWN1_SIGNAL);
3246 DO_SIGNAL_CHECK(SHUTDOWN2_SIGNAL);
3247 DO_SIGNAL_CHECK(SHUTDOWN3_SIGNAL);
3248 DO_SIGNAL_CHECK(BREAK_SIGNAL);
3249 }
3250
3251 DO_SIGNAL_CHECK(SR_signum);
3252 }
3253
3254 typedef int (*os_sigaction_t)(int, const struct sigaction *, struct sigaction *);
3255
3256 static os_sigaction_t os_sigaction = NULL;
3257
3258 void os::Bsd::check_signal_handler(int sig) {
3259 char buf[O_BUFLEN];
3260 address jvmHandler = NULL;
3261
3262
3263 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_bsd.inline.hpp"
40 #include "os_share_bsd.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/java.hpp"
49 #include "runtime/javaCalls.hpp"
50 #include "runtime/mutexLocker.hpp"
51 #include "runtime/objectMonitor.hpp"
52 #include "runtime/orderAccess.inline.hpp"
53 #include "runtime/osThread.hpp"
54 #include "runtime/perfMemory.hpp"
55 #include "runtime/sharedRuntime.hpp"
56 #include "runtime/statSampler.hpp"
57 #include "runtime/stubRoutines.hpp"
58 #include "runtime/thread.inline.hpp"
59 #include "runtime/threadCritical.hpp"
60 #include "runtime/timer.hpp"
61 #include "semaphore_bsd.hpp"
3222 // This method is a periodic task to check for misbehaving JNI applications
3223 // under CheckJNI, we can add any periodic checks here
3224
3225 void os::run_periodic_checks() {
3226
3227 if (check_signals == false) return;
3228
3229 // SEGV and BUS if overridden could potentially prevent
3230 // generation of hs*.log in the event of a crash, debugging
3231 // such a case can be very challenging, so we absolutely
3232 // check the following for a good measure:
3233 DO_SIGNAL_CHECK(SIGSEGV);
3234 DO_SIGNAL_CHECK(SIGILL);
3235 DO_SIGNAL_CHECK(SIGFPE);
3236 DO_SIGNAL_CHECK(SIGBUS);
3237 DO_SIGNAL_CHECK(SIGPIPE);
3238 DO_SIGNAL_CHECK(SIGXFSZ);
3239
3240
3241 // ReduceSignalUsage allows the user to override these handlers
3242 // see comments at the very top and jvm_md.h
3243 if (!ReduceSignalUsage) {
3244 DO_SIGNAL_CHECK(SHUTDOWN1_SIGNAL);
3245 DO_SIGNAL_CHECK(SHUTDOWN2_SIGNAL);
3246 DO_SIGNAL_CHECK(SHUTDOWN3_SIGNAL);
3247 DO_SIGNAL_CHECK(BREAK_SIGNAL);
3248 }
3249
3250 DO_SIGNAL_CHECK(SR_signum);
3251 }
3252
3253 typedef int (*os_sigaction_t)(int, const struct sigaction *, struct sigaction *);
3254
3255 static os_sigaction_t os_sigaction = NULL;
3256
3257 void os::Bsd::check_signal_handler(int sig) {
3258 char buf[O_BUFLEN];
3259 address jvmHandler = NULL;
3260
3261
3262 struct sigaction act;
|