JDK-4811663 : REGRESSION: Bkgnd Process Dies When Ctrl-C is issued from parent Bourne shell
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.3.1
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2003-02-01
  • Updated: 2003-02-03
  • Resolved: 2003-02-03
Related Reports
Duplicate :  
Description

Name: gm110360			Date: 02/01/2003


FULL PRODUCT VERSION :
$ java -version
java version "1.3.1_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_06-b01)
Java HotSpot(TM) Client VM (build 1.3.1_06-b01, mixed mode)

FULL OPERATING SYSTEM VERSION :

SunOS 5.8 Generic_108528-04 sun4u sparc SUNW,Ultra-5_10

EXTRA RELEVANT SYSTEM CONFIGURATION :
JDK 1.3.1_04, JDK 1.3.1_05, and JDK 1.3.1_06 have this problem.

JDK 1.3.1_03 and below do not.

A DESCRIPTION OF THE PROBLEM :
I have determined that this "SIGINT" problem was introduced
in JDK 1.3.1_04 and exists in _05 and _06 also.  Beginning
with JDK 1.3.1_04, the JVM catches and exits when this
signal is received as can be seen with truss(1) as follows:

25006:  lwp_sigredirect(5, SIGINT, 0xFF00FC4C)          = 0
25006:      Received signal #2, SIGINT, in poll() [caught]
...
25006:  munmap(0xFE300000, 524288)                      = 0
25006:  munmap(0xFB000000, 33554432)                    = 0
25006:  llseek(0, 0, SEEK_CUR)                          = 0
25006:  _exit(130)

In the prior release (1.3.1_03), this signal was ignored as
can be seen with truss(1):

24848:  signotifywait()                                 = 2
24848:  lwp_sigredirect(5, SIGINT, 0xFF00FC4C)          = 0
24848:      Received signal #2, SIGINT, in poll() [ignored]

This can be seen by using the Solaris Bourne shell and
starting a background java process with 1.3.1_06.  Next,
simply type CTRL-C (INTR) in the command window.  The bourne
shell will signal the JVM with SIGINTR and it will exit
without any error message.



REGRESSION.  Last worked in version 1.3.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.  Open a bourne shell on Solaris Sparc
2.  Start a java process in the background (e.g. java
SleepServer &

3.  Type CTRL-C (INTR) in the command window.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Until JDK 1.3.1_04, this would not cause the process to
exit.  It now does.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
SleepServer.java
-------------------------
public class SleepServer
  {
  public static void main(String[] args)
    {
    while(true)
      {
      System.out.println("I am sleeping ...");
      }
    }
  }
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
Use nohup to launch the background process and then "exit"
the parent shell to prevent signals from the parent.

or

Use /bin/ksh instead of /bin/sh

Release Regression From : 1.3.1_03
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 180451) 
======================================================================

Comments
EVALUATION Works fine in latest JDK 1.4.2-b15 build. Unless escalated this bug will not get fixed in previous releases. This only effects bourne shell because shells are passing SIGINT's back to java and when that happens we are suppose to shutdown. The other shells do not. ###@###.### 2003-02-03
03-02-2003