JDK-7082118 : Java WebStart occationally hangs when tracing is on
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 7-client
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-08-22
  • Updated: 2011-09-22
  • Resolved: 2011-08-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u2 b03Fixed 8Resolved
Description
1. With console enabled, run javaws http://javaweb.sfbay.sun.com/~nn136682/BlobSignedArcTest/normal_signedjar.jnlp
2. Click Run on security dialog
Application launch hangs once every 4-5 times.
Stack show this relevant locking/blocked threads:

"Java Web Start Main Thread" prio=6 tid=0x16f09400 nid=0x450 in Object.wait() [0x17c6f000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x082c4708> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)
        at java.lang.Object.wait(Object.java:503)
        at sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator.createThread(PluginSysUtil.java:264)
        - locked <0x082c4708> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)
        at sun.plugin.util.PluginSysUtil.execute(PluginSysUtil.java:151)
        at sun.plugin.util.PluginSysUtil.delegate(PluginSysUtil.java:130)
        at com.sun.deploy.util.DeploySysRun.execute(DeploySysRun.java:29)
        at com.sun.deploy.uitoolkit.impl.awt.ui.SwingConsoleWindow.invokeLater(SwingConsoleWindow.java:501)
        at com.sun.deploy.uitoolkit.impl.awt.ui.SwingConsoleWindow.append(SwingConsoleWindow.java:545)
        at com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$ConsoleWriterThread.flush(ConsoleTraceListener.java:150)
        at com.sun.deploy.uitoolkit.ui.ConsoleTraceListener.flush(ConsoleTraceListener.java:38)
        at com.sun.deploy.trace.Trace.fireFlushEvent(Trace.java:411)
        at com.sun.deploy.trace.Trace.flush(Trace.java:199)
        - locked <0x0806fe90> (a java.util.ArrayList)
        at com.sun.javaws.Main.continueInSecureThread(Main.java:346)
        at com.sun.javaws.Main$1.run(Main.java:175)
        at java.lang.Thread.run(Thread.java:722)

"ConsoleTraceListener" daemon prio=6 tid=0x17d24400 nid=0xb80 in Object.wait() [0x1810f000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x082c4708> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)
        at java.lang.Object.wait(Object.java:503)
        at sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator.createThread(PluginSysUtil.java:264)
        - locked <0x082c4708> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)
        at sun.plugin.util.PluginSysUtil.execute(PluginSysUtil.java:151)
        at sun.plugin.util.PluginSysUtil.delegate(PluginSysUtil.java:130)
        at com.sun.deploy.util.DeploySysRun.execute(DeploySysRun.java:29)
        at com.sun.deploy.uitoolkit.impl.awt.ui.SwingConsoleWindow.invokeLater(SwingConsoleWindow.java:501)
        at com.sun.deploy.uitoolkit.impl.awt.ui.SwingConsoleWindow.append(SwingConsoleWindow.java:545)
        at com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$ConsoleWriterThread.run(ConsoleTraceListener.java:136)

"ProgressReporter" daemon prio=4 tid=0x17e80400 nid=0x54c waiting for monitor entry [0x18b4f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at com.sun.deploy.trace.Trace.enQueue(Trace.java:314)
        - waiting to lock <0x0806fe90> (a java.util.ArrayList)
        at com.sun.deploy.trace.Trace.println(Trace.java:333)
        at com.sun.javaws.progress.PreloaderDelegate$ProgressQueueChecker.run(PreloaderDelegate.java:767)
        at java.lang.Thread.run(Thread.java:722)

"thread applet-ArcTest-1" prio=4 tid=0x17e8e800 nid=0x824 waiting for monitor entry [0x18aff000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at com.sun.deploy.trace.Trace.enQueue(Trace.java:314)
        - waiting to lock <0x0806fe90> (a java.util.ArrayList)
        at com.sun.deploy.trace.Trace.msgPrintln(Trace.java:354)
        at com.sun.deploy.trace.Trace.msgSecurityPrintln(Trace.java:567)
        at com.sun.deploy.security.TrustDecider.validateChain(TrustDecider.java:758)
        at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(TrustDecider.java:904)
        - locked <0x082c3ec0> (a java.lang.Class for com.sun.deploy.security.TrustDecider)
        at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(AppPolicy.java:261)
        at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(JNLPSignedResourcesHelper.java:534)
        at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(JNLPSignedResourcesHelper.java:170)
        at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(JNLP2Manager.java:1484)
        at sun.plugin2.applet.JNLP2Manager.loadJarFiles(JNLP2Manager.java:457)
        at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1545)
        at java.lang.Thread.run(Thread.java:722)

Comments
EVALUATION The blocking is due to Main calling flush() which lock the Trace queue when calling Trace.fireFlushEvent(). This block the applet thread and progress reporter thread which happen to also trying to add to the trace message queue. The fix is to move the fireFlustEvent call outside of the synchronization block on the queue.
2011-08-23