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

Deadlock in Java Web Start application involving JNLPClassLoader

    Details

    • Subcomponent:
    • Introduced In Build:
      b02
    • Introduced In Version:
    • Resolved In Build:
      b01
    • OS:
      windows

      Backports

        Description

        FULL PRODUCT VERSION :
        JRE 8u102 b14, JRE 7u111 b13

        ADDITIONAL OS VERSION INFORMATION :
        MS Windows 10 OS, MS Windows 7 OS

        A DESCRIPTION OF THE PROBLEM :
        Java Web Start application, which sets a custom class loader as its threads' context class loader, hangs, because of the deadlock between "JNLPClassLoader" and the application's custom class loader which occurs in the method "com.sun.deploy.security.DeployURLClassPath.getLoader".

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Upload JAR, JNLP files of the minimal test case attached to the bug as the file "DeadlockWithCustomAndJNLPClassLoaders.zip" to the same directory on an accessible web server.
        2. Edit "codebase" attribute value in the uploaded JNLP file "DeadlockWithCustomAndJNLPClassLoaders.jnlp" to reflect a URL to the directory, where the file was uploaded.
        3. Install JRE 8 or JRE 7 to be tested.
        4. Go to "Java Control Panel -> Advanced" and:

          a. Switch on the options: "Enable tracing", "Enable logging", "Show applet lifecycle exceptions" in "Debugging" group.
          b. Set "Java console" to "Show console".

        5. Open Internet Explorer (IE) web browser and load JNLP file of the test case uploaded to the web server, Java Web Start application should run. If the following 2 messages are not displayed in Java Console window, the deadlock is reproduced.

          a. "JAVAWSAPP_TRACE: Creation of instances of 'B' classes finished."
          b. "JAVAWSAPP_TRACE: Loading of 'A' classes finished."

        6. If the bug is reproduced, then exit IE, start "taskmgr.exe" and terminate the remaining "jp2launcher.exe" process containing the deadlock in "Processes" tab of the shown "Windows Task Manager" window.

        ERROR MESSAGES/STACK TRACES THAT OCCUR :

        ---------- Call stacks of 2 threads blocking each other from the attached thread dump "ThreadDumpWithDeadlockIn8u102b14.txt" ----------
        Found one Java-level deadlock:
        =============================
        "Thread-24":
          waiting to lock monitor 0x199d1b1c (object 0x0a969fa0, a mainpkg.DeadlockWithCustomAndJNLPClassLoaders$1),
          which is held by "javawsApplicationMain"
        "javawsApplicationMain":
          waiting to lock monitor 0x172ad784 (object 0x0a227158, a com.sun.jnlp.JNLPClassLoader),
          which is held by "Thread-24"

        Java stack information for the threads listed above:
        ===================================================
        "Thread-24":
                at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
                - waiting to lock <0x0a969fa0> (a mainpkg.DeadlockWithCustomAndJNLPClassLoaders$1)
                at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
                at java.net.URLClassLoader$1.run(Unknown Source)
                at java.net.URLClassLoader$1.run(Unknown Source)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(Unknown Source)
                at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
                at java.lang.ClassLoader.loadClass(Unknown Source)
                - locked <0x0a26b3e0> (a com.sun.jnlp.JNLPClassLoader)
                at com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
                at java.lang.ClassLoader.loadClass(Unknown Source)
                - locked <0x0a227158> (a com.sun.jnlp.JNLPClassLoader)
                at com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
                at java.lang.ClassLoader.loadClass(Unknown Source)
                at mainpkg.DeadlockWithCustomAndJNLPClassLoaders$2.run(DeadlockWithCustomAndJNLPClassLoaders.java:65)
                at java.lang.Thread.run(Unknown Source)
        "javawsApplicationMain":
                at mainpkg.DeadlockWithCustomAndJNLPClassLoaders$1.loadClass(DeadlockWithCustomAndJNLPClassLoaders.java:42)
                at java.lang.ClassLoader.loadClass(Unknown Source)
                at java.lang.ClassLoader.defineClass1(Native Method)
                at java.lang.ClassLoader.defineClass(Unknown Source)
                at java.security.SecureClassLoader.defineClass(Unknown Source)
                at java.net.URLClassLoader.defineClass(Unknown Source)
                at java.net.URLClassLoader.access$100(Unknown Source)
                at java.net.URLClassLoader$1.run(Unknown Source)
                at java.net.URLClassLoader$1.run(Unknown Source)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(Unknown Source)
                at java.lang.ClassLoader.loadClass(Unknown Source)
                - locked <0x0a969fa0> (a mainpkg.DeadlockWithCustomAndJNLPClassLoaders$1)
                at mainpkg.DeadlockWithCustomAndJNLPClassLoaders$1.loadClass(DeadlockWithCustomAndJNLPClassLoaders.java:53)
                at java.lang.ClassLoader.loadClass(Unknown Source)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Unknown Source)
                at mainpkg.DeadlockWithCustomAndJNLPClassLoaders.main(DeadlockWithCustomAndJNLPClassLoaders.java:99)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at com.sun.javaws.Launcher.executeApplication(Unknown Source)
                at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
                at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
                at com.sun.javaws.Launcher.run(Unknown Source)
                at java.lang.Thread.run(Unknown Source)

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alitvinov Anton Litvinov
                  Reporter:
                  shadowbug Shadow Bug
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved: