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

REGRESSION in 1.3.1_02: App started as Service under Win2000 dies-Xrs broken

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.3.1_02
    • Fix Version/s: 1.3.1_04
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      04
    • CPU:
      x86
    • OS:
      windows_2000

      Backports

        Description

        Customer Problem Description:
        ------------------------------
        The issue is that beginning with JRE131 the Java VM exits when the
        console
        user logs off. In JRE131_b24, we were able to workaround this problem
        using
        the -Xrs option. In JRE131_01, the -Xrs option stopped working
        altogether.
        In JRE131_02, the -Xrs option still does not work in the case when an
        AWT
        class is loaded.

        To reproduce the problem I created an NT Service application that
        launches a
        Java VM with the -Xrs option. I also created a simple Java class that
        creates a java.awt.Frame, disposes of it and sleeps indefinitely. When
        I log
        off the Java VM exits with exit code 3. If I comment out the awt code,
        then
        the Java VM does not exit when I log off.

        I've included the source and executables for the NT Service and Java
        apps
        along with a README.txt on how to reproduce the bug.

        synopsis: -Xrs fails to prevent VM exit when awt is loaded
        description: FULL PRODUCT VERSION :
        C:\Install\jre131_02\bin>java -version
        java version "1.3.1_02"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_02-b02)
        Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode)

        FULL OPERATING SYSTEM VERSION :
        Windows 2000 Professional Service Pack 1



        EXTRA RELEVANT SYSTEM CONFIGURATION :
        Dell Optiplex GX150, standard desktop config.

        A DESCRIPTION OF THE PROBLEM :
        If the Java VM is launched with -Xrs and does not load awt,
        then the Java VM does not exit when the console user logs
        out. If awt is loaded, then the Java incorrectly exits.

        I've created an NT service application, svcmain.c, that
        launches a Java VM with the -Xrs option and
        MyService.class. The class creates an invisible
        java.awt.Frame, disposes of it and goes to sleep. As a
        result the Java VM loads awt.dll. When I log out, the Java
        VM exits. If I comment out the awt code, then the Java VM
        does not exit.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Create an NT Service app that launches a Java VM with
        the -Xrs option.

        2. Create a Java app that creates an invisible awt frame,
        disposes of it and goes to sleep. See source code below.

        3. Log out and log back in. The NT Service app and Java VM
        are no longer running.

        4. Comment out the awt code, recompile and repeat the test.
        The processes will still be running when you log back in.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        It is imperative that the Java VM not exit when the console
        user logs out. When -Xrs is specified, the Java VM should
        not exit, yet it does whenever awt is loaded.

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        There are no stack traces.

        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.awt.*;

        public class MyService {
            public static void main(String argv[]) {
        Frame frame = new Frame();
        frame.dispose();

        try {
        Thread.sleep(100000000);
        } catch (InterruptedException e) {
        }
            }
        }
        ---------- END SOURCE ----------

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  myangsunw Mingyao Yang (Inactive)
                  Reporter:
                  cprasadsunw Ck Prasad (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: