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

Java Plug-In 2 class loader deadlock when crossdomain.xml is present

    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.6.0_21"
      Java(TM) SE Runtime Environment (build 1.6.0_21-b07-288-10M3222)
      Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17-288, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Darwin Shadowfax.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

      Also happens on Windows XP and Windows 7


      A DESCRIPTION OF THE PROBLEM :
      Our Applet works fine as long as there is no crossdomain.xml file on the server.

      Once we put a crossdomain.xml on the root of the web server - for Flash, not for Java - the Applet started to freeze on load.

      The thread dump shows very clearly how a deadlock prevents the Applet from starting. Please fix this, it's terrible.

      Here are the relevant parts of the Java thread dump:


      "MMX-AppletLoadTracker" daemon prio=4 tid=101998000 nid=0x12f689000 waiting for monitor entry [12f687000]
         java.lang.Thread.State: BLOCKED (on object monitor)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:160)
      - waiting to lock <107ac08a8> (a sun.plugin2.applet.Applet2ClassLoader)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at javax.xml.parsers.FactoryFinder.getProviderClass(FactoryFinder.java:111)
      at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:146)
      at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:176)
      at com.sun.deploy.net.CrossDomainXML$2.run(CrossDomainXML.java:364)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.deploy.net.CrossDomainXML.check(CrossDomainXML.java:354)
      at com.sun.deploy.net.CrossDomainXML.check(CrossDomainXML.java:148)
      - locked <10f935988> (a java.lang.Class for com.sun.deploy.net.CrossDomainXML)
      at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Applet2SecurityManager.java:513)
      at java.net.InetAddress.getAllByName0(InetAddress.java:1146)
      at java.net.InetAddress.getAllByName(InetAddress.java:1084)
      at java.net.InetAddress.getAllByName(InetAddress.java:1020)
      at java.net.InetAddress.getByName(InetAddress.java:970)
      at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:420)
      - locked <107adcaa0> (a sun.net.www.protocol.http.Handler)
      at java.net.URLStreamHandler.hostsEqual(URLStreamHandler.java:439)
      at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:396)
      at java.net.URLStreamHandler.equals(URLStreamHandler.java:316)
      at java.net.URL.equals(URL.java:842)
      at sun.plugin2.applet.Plugin2Manager$AppletContextImpl.getApplet(Plugin2Manager.java:2722)
      at net.prophet.matrix.c.f.run(f.java:6)


      "thread applet-net.prophet.matrix.MarketMatrix.class-1" prio=4 tid=103166800 nid=0x12b8e1000 waiting for monitor entry [12b8de000]
         java.lang.Thread.State: BLOCKED (on object monitor)
      at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
      - waiting to lock <107adcaa0> (a sun.net.www.protocol.http.Handler)
      at java.net.URLStreamHandler.hostsEqual(URLStreamHandler.java:439)
      at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:396)
      at java.net.URLStreamHandler.equals(URLStreamHandler.java:316)
      at java.net.URL.equals(URL.java:842)
      at java.security.CodeSource.equals(CodeSource.java:135)
      at com.sun.deploy.security.CPCallbackHandler.checkPackage(CPCallbackHandler.java:658)
      - locked <107b2aae0> (a com.sun.deploy.security.CPCallbackHandler)
      at com.sun.deploy.security.CPCallbackHandler.access$1700(CPCallbackHandler.java:82)
      at com.sun.deploy.security.CPCallbackHandler$ChildElement.checkResource(CPCallbackHandler.java:486)
      at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(DeployURLClassPath.java:790)
      at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(DeployURLClassPath.java:890)
      at com.sun.deploy.security.DeployURLClassPath.getResource(DeployURLClassPath.java:231)
      at sun.plugin2.applet.Plugin2ClassLoader$2.run(Plugin2ClassLoader.java:950)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Plugin2ClassLoader.java:939)
      at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:133)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:249)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:179)
      - locked <107ac08a8> (a sun.plugin2.applet.Applet2ClassLoader)
      at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:160)
      - locked <107ac08a8> (a sun.plugin2.applet.Applet2ClassLoader)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at net.prophet.matrix.MarketMatrix.start(MarketMatrix.java:176)
      at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1681)
      at java.lang.Thread.run(Thread.java:637)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create an Applet which spins a separate thread, and in this separate thread calls AppletContext.getApplet(name) to access the other applets on the same page.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No deadlock
      ACTUAL -
      deadlock

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Have not found a workaround so far.

      I think signing the Applet would work since it would then not load the crossdomain.xml file. But I have so far avoided that since the Applet does not need full access to the user's computer.

            dtitov Daniil Titov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: