Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4755829

JVM 1.3.1-04 and Pre-release of JVM 1.3.1-05 ignoring nohup(1) command

XMLWordPrintable

    • 08
    • generic, x86, sparc
    • generic, linux, solaris_8, solaris_9


        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)

              pcashman Pat Cashman
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: