java signal handling

java에서 처리할 수 있는 signal과 그 내용입니다. 아래의 reference를 통해서 java에서 signal을 어떻게 처리하고, 새로운 signal을 등록할 수 있는 예제를 확인하실 수 있다. 아래는 자바에서 지원되는 시그널과 내용이다.

Signal Name

Description

SIGSEGV

Incorrect access to memory
(write to inaccessible memory)

SIGILL

Illegal instruction (attempt to
invoke a unknown machine instruction)

SIGFPE

Floating point exception
(divide by zero)

SIGBUS

Bus error (attempt to address
nonexistent memory location)

SIGSYS

Bad system call issued

SIGXCPU

CPU time limit exceeded (you’ve
been running too long!)

SIGXFSZ

File size limit exceeded

SIGEMT

EMT instruction (AIX specific)

SIGABRT

Abnormal termination. The JVM
raises this signal whenever it detects a JVM fault.

SIGINT

Interactive attention (CTRL-C).
JVM will exit normally.

SIGTERM

Termination request. JVM will
exit normally.

SIGHUP

Hang up. JVM will exit
normally.

SIGUSR1

User defined. Used by some JVMs
for internal control purposes.

SIGUSR2

User defined. Used by some JVMs
for internal control purposes.

SIGQUIT

A quit signal for a terminal.
JVM uses this for taking Java core dumps.

SIGBREAK

A break signal from a terminal.
JVM uses this for taking Java core dumps.

SIGTRAP

Internal for use by dbx or
ptrace. Used by some JVMs for internal control purposes.

SIGPIPE

A write to a pipe that is not
being read. JVM ignores this.

No Name (40)

An AIX reserved signal. Used by
the AIX JVM for internal control purposes.

OS별 지원되는 signal에 대한 내용이다.

E.g. for Unix/Linux based platform the signals are SEGV, ILL, FPE,
BUS, SYS, CPU, FSZ, ABRT, INT, TERM, HUP, USR1, QUIT, BREAK, TRAP,
PIPE.

For Windows based platform, the signals are SEGV, ILL, FPE, ABRT,
INT, TERM, BREAK.

* Reference
http://www.ibm.com/developerworks/ibm/library/i-signalhandling/
http://twit88.com/blog/2008/02/06/java-signal-handling/
http://mimul.com/pebble/default/2009/07/19/1248007080000.html

답글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다.