new Deadlock bug in 7u45 webstart?
Asked Answered
R

1

6

The fun from java 7u45 keeps on giving. This time it's a deadlock within webstart. This is happening very consistently (every time) launching a large application (~100 jars).

Has anyone else run into this or know of any workarounds? Other than reverting to 1.7.0_40?

Thanks,

Found one Java-level deadlock:
=============================
"Java Web Start Main Thread":
  waiting to lock monitor 0x066368bc (object 0x29e65428, a java.lang.Class),
  which is held by "Finalizer"
"Finalizer":
  waiting to lock monitor 0x00dbc954 (object 0x2a1b52b0, a com.sun.deploy.cache.CacheEntry),
  which is held by "Java Web Start Main Thread"

Java stack information for the threads listed above:
===================================================
"Java Web Start Main Thread":
    at com.sun.deploy.cache.MemoryCache.getLoadedResource(Unknown Source)
    - waiting to lock <0x29e65428> (a java.lang.Class for com.sun.deploy.cache.MemoryCache)
    at com.sun.deploy.cache.CachedJarFile.getCacheEntry(Unknown Source)
    - locked <0x24810058> (a com.sun.deploy.cache.CachedJarFile)
    at com.sun.deploy.cache.CachedJarFile.getManifest(Unknown Source)
    - locked <0x24810058> (a com.sun.deploy.cache.CachedJarFile)
    at com.sun.deploy.util.JarUtil.isBlobSigned(Unknown Source)
    at com.sun.deploy.cache.CacheEntry.getJarFile(Unknown Source)
    - locked <0x2a1b52b0> (a com.sun.deploy.cache.CacheEntry)
    at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
    at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.launch(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
"Finalizer":
    at com.sun.deploy.cache.CacheEntry.storageFilesExist(Unknown Source)
    - waiting to lock <0x2a1b52b0> (a com.sun.deploy.cache.CacheEntry)
    at com.sun.deploy.cache.MemoryCache.validateResource(Unknown Source)
    at com.sun.deploy.cache.MemoryCache.getLoadedResource(Unknown Source)
    - locked <0x29e65428> (a java.lang.Class for com.sun.deploy.cache.MemoryCache)
    at com.sun.deploy.cache.CachedJarFile.isReferencedTo(Unknown Source)
    at com.sun.deploy.cache.CachedJarFile.close(Unknown Source)
    at java.util.zip.ZipFile.finalize(Unknown Source)
    at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
    at java.lang.ref.Finalizer.runFinalizer(Unknown Source)
    at java.lang.ref.Finalizer.access$100(Unknown Source)
    at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

Found 1 deadlock.
Rope answered 21/10, 2013 at 21:56 Comment(5)
If you found a JVM/JRE/JDK bug, please report it to Oracle. oracle.com/technetwork/java/javase/bugreports-140511.htmlWhidah
I plan to, but oracle's feedback on bug reports is just "thanks." No response, and you can't even see the bug once they 'accept it'. I was going to poke at this a bit more and see if I could find what they changed in deploy.jar between 7u40 and 7u45.Rope
The bug comes from a new block of code added in getJarFile() in CacheEntry class in deploy.jar between 7u40 and 7u45. I've submitted the bug now. With luck, maybe they'll make the bug public. (Are you listening Larry?)Rope
forums.oracle.com/thread/2595230 says this was filed as issue 9007571, so it should show up at one or both of these URLs eventually: bugs.openjdk.java.net/browse/JDK-9007571, bugs.sun.com/bugdatabase/view_bug.do?bug_id=9007571Woehick
Would it help to merge all the 100 jars into a single big jar? I've been considering doing this for my application for a while because the JWS cache has historically been flaky. It'd be pretty easy with ant... just unzip all the jars into one directory and then jar up that directory. I know it makes update downloads painful, but ... better than no launching at all?Reeve
W
1

The bug report I mentioned in my comment has now been accepted.

It looks like its ID changed as part of that process, though. It moved from the JI- namespace to the JDK- namespace: https://bugs.openjdk.java.net/browse/JI-9007571 now redirects to https://bugs.openjdk.java.net/browse/JDK-8027029. The issue can be seen at https://bugs.java.com/bugdatabase/view_bug?bug_id=8027029 now too.

The fix appears to be under discussion for inclusion in 7u51, due in January.

Our stack traces are similar -- the deadlock itself appears to be identical. In our case we have two applets in the page that are loading at the same time.

"thread applet-cl.applet.TutorApplet-2" prio=4 tid=0x04f21000 nid=0x528 waiting for monitor entry [0x0652f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at com.sun.deploy.cache.MemoryCache.getLoadedResource(Unknown Source)
    - waiting to lock <0x29d288b8> (a java.lang.Class for com.sun.deploy.cache.MemoryCache)
    at com.sun.deploy.cache.CachedJarFile.getCacheEntry(Unknown Source)
    - locked <0x247a4f90> (a com.sun.deploy.cache.CachedJarFile)
    at com.sun.deploy.cache.CachedJarFile.getManifest(Unknown Source)
    - locked <0x247a4f90> (a com.sun.deploy.cache.CachedJarFile)
    at com.sun.deploy.util.JarUtil.isBlobSigned(Unknown Source)
    at com.sun.deploy.cache.CacheEntry.getJarFile(Unknown Source)
    - locked <0x29eccc00> (a com.sun.deploy.cache.CacheEntry)
    at com.sun.javaws.security.SigningInfo.check(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

"thread applet-cl.applet.TTSApplet-1" prio=4 tid=0x04f1f800 nid=0xa40 waiting for monitor entry [0x0600f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at com.sun.deploy.cache.CacheEntry.storageFilesExist(Unknown Source)
    - waiting to lock <0x29eccc00> (a com.sun.deploy.cache.CacheEntry)
    at com.sun.deploy.cache.MemoryCache.validateResource(Unknown Source)
    at com.sun.deploy.cache.MemoryCache.getLoadedResource(Unknown Source)
    - locked <0x29d288b8> (a java.lang.Class for com.sun.deploy.cache.MemoryCache)
    at com.sun.deploy.cache.MemoryCache.getLoadedResource(Unknown Source)
    - locked <0x29d288b8> (a java.lang.Class for com.sun.deploy.cache.MemoryCache)
    at com.sun.deploy.cache.Cache.getCacheEntry(Unknown Source)
    at com.sun.deploy.cache.Cache.getCacheEntry(Unknown Source)
    at com.sun.deploy.cache.Cache.getCachedResourceFilePath(Unknown Source)
    at com.sun.deploy.cache.ResourceProviderImpl.getCachedResourceFilePath(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.getSignedJNLPBits(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.getSignedJNLPFile(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedLaunchDescHelper(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedLaunchDesc(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Woehick answered 1/11, 2013 at 15:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.