|
Description
|
The later release of JVM 1.3.1-04 to JVM 1.3.1-05 are ignoring the nohup(1)
command. Instead of ignoring the SIGHUP, it actually caught and process the
SIGHUP signal, resulting in the java application being exited with a return
code of 129.
nohup(1) command is working correctly on the following releases:
JVM 1.3.1-FCS - OK
JVM 1.3.1-01 - OK
JVM 1.3.1-02 - OK
JVM 1.3.1-03 - OK
nohup(1) command is NOT working on the following releases:
JVM 1.3.1-04 - NOT OK (not ignored)
JVM 1.3.1-05pre - NOT OK (not ignored)
The above findings are reproducable.
Reproduction / How to / Test case:
----------------------------------
I have attached the tests scripts and the famous lt (loadtest)
java apps for the testing. just setup the directories below
on your test machine. Get all the JVM 1.3.1 releases.
bash-2.03# ls -l
total 70
-rwxr-xr-x 1 root other 18 Sep 23 19:54 1.sh
-rwxr-xr-x 1 root other 72 Sep 23 18:59 2.sh
-rwxr-xr-x 1 root other 187 Sep 26 11:23 3-01.sh
-rwxr-xr-x 1 root other 187 Sep 26 11:23 3-02.sh
-rwxr-xr-x 1 root other 187 Sep 26 11:23 3-03.sh
-rwxr-xr-x 1 root other 192 Sep 26 11:45 3-04-xrs.sh
-rwxr-xr-x 1 root other 187 Sep 26 11:24 3-04.sh
-rwxr-xr-x 1 root other 192 Sep 26 12:44 3-05-xrs.sh
-rwxr-xr-x 1 root other 187 Sep 26 11:22 3-05.sh
-rwxr-xr-x 1 root other 189 Sep 26 11:24 3-fcs.sh
drwxr-xr-x 7 root other 512 Sep 26 10:03 jdk131_01
drwxr-xr-x 7 root other 512 Sep 26 10:52 jdk131_02
drwxr-xr-x 4 root other 512 Sep 26 11:09 jdk131_03
drwxr-xr-x 4 root other 512 Sep 26 11:17 jdk131_04
drwx--x--x 8 root other 512 Aug 30 22:12 jdk131_05
drwxr-xr-x 6 root other 512 Sep 26 11:22 jdk131_fcs
-rw-r--r-- 1 root other 3419 Sep 23 18:54 lt.class
-rw-r--r-- 1 root other 11039 Sep 23 18:54 lt.java
-rw-r--r-- 1 root other 3514 Sep 23 18:54 ltThread.class
Run scripts starting with 3-0X where X is the release of JVM.
Scripts with -xrs are ran with Java option -Xrs (Workaround).
Below is a sample script, notice the nohup command at the beginning
of the java binary.
bash-2.03# more 3-02.sh
#!/bin/ksh
/temp1/jdk131_02/bin/java -version
nohup /temp1/jdk131_02/bin/java -ms256m -mx256m -DredirectOutputToFile=false lt -verbose:gc http://dolphin.singapore:8888 > /temp1/log.out &
In General, open 2 terminal windows. First one to run the script
with truss and the second to send the signal to the java process
that was launched by the script. Repeat for all the 3-XX scripts.
1. Window1:
--------
$ truss -af -sall ./3-04
[ add the -o <outfile> if you wish catch the truss output in file ]
2. Windows2:
---------
$ ps -ef | grep java
root 3672 ...... /java -ms256m -mx256m -Xrs -Dre
Note the PPID, it should be 1.
$ kill -1 3672 [To send a SIGHUP]
3. Window1:
--------
A functional JVM (1.3.1-03 and below) shows that SIGHUP is ignored.
3672: signotifywait() = 1
3672: lwp_sigredirect(5, SIGHUP, 0xFF00FC4C) = 0
-->3672: Received signal #1, SIGHUP, in poll() [ignored]
3672: siginfo: SIGHUP pid=1763 uid=0
3672: poll(0xFEC07A50, 0, 10) = 0
3672: read(8, " < I M G S R C = " / i".., 2048) = 1999
3672: read(8, " " > < / T D >\n ".., 2048) = 1024
3672: poll(0xFEC07A50, 0, 10) = 0
...
A broken JVM (1.3.1-04 and 1.3.1-05pre) shows that SIGHUP is being
caught and processed.
3712: signotifywait() = 1
3712: lwp_sigredirect(5, SIGHUP, 0xFF00FC4C) = 0
-->3712: Received signal #1, SIGHUP, in poll() [caught]
3712: siginfo: SIGHUP pid=1763 uid=0
3712: poll(0xFEC07A50, 0, 10) Err#91 ERESTART
3712: lwp_mutex_wakeup(0xFF3855D8) = 0
...
3712: llseek(0, 0, SEEK_CUR) = 0
-->3712: _exit(129)
|
|
Evaluation
|
JPSE team will take over this bug
xxxxx@xxxxx 2002-10-01
the problem stems from a previous but fix for
#4614121 java.io.File.deleteOnExit not working on Windows NT
As part of this fix (for shutdown hooks), a new signal handler was set up
for each of the shutdown hooks (of which SIGHUP was one).
What we should do is to ignore the SIGHUP signal if it is masked when java
starts up.
xxxxx@xxxxx 2002-10-09
-------------------------------------------------
Note the fix has introduced a new problem. With the fix, no shutdown hook
will get executed if "nohup" is used. Please see 4850355 for details.
xxxxx@xxxxx 2003-04-18
|
|
Comments
|
Submitted On 05-APR-2003
zane97
java plug-in1.3.1-04 for netscape(dill) it says it
damaged
Submitted On 05-APR-2003
zane97
java runtime evnironment plugin says it damaged
Submitted On 19-SEP-2003
amzshar
-ms256m -mx256m -Xrs -Dre
Submitted On 19-SEP-2003
amzshar
http://java.sun.com/j2se/1.3/ReleaseNotes.html
----------------------------------------------------------
Changes in 1.3.1_08
Bugs fixed in the 1.3.1_08 Version are listed in the following
table. The Fix Status columns indicate the operating system
and version to which the fix applies.
4755829 An application ignored the nohup(1) command,
caught and processed the SIGHUP signal, resulting in
application exit with a return code of 129. NA 1.3.1_08
1.3.1_08
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|