United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6541319 PIT: Jaws hangs on the first lunch of damaged_signed_test.jnlp
JDK-6541319 : PIT: Jaws hangs on the first lunch of damaged_signed_test.jnlp

Details
Type:
Bug
Submit Date:
2007-04-02
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
deploy
OS:
windows
Sub-Component:
webstart
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Jaws hangs on the first lunch of damaged_signed_test.jnlp 
It is a regression, latest promoted build is fine

To reproduce it, launch this test
http://nicole1.sfbay.sun.com:8080/JavawsJDK7IntegTest/certificate/damaged_signed_test.jnlp

                                    

Comments
EVALUATION

From Thomas Ng:
This is an regression caused by

6518576: Graphics icon not displayed while Java Web Start launch an application with JDK 6.

We are trying to remove a JAR file, but the JAR is not closed yet, and hence when we try to remove it, we got the exception with the new FileLock code:

java.nio.channels.OverlappingFileLockException

   at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(Unknown Source)

   at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(Unknown Source)

   at sun.nio.ch.FileChannelImpl.lock(Unknown Source)

   at com.sun.deploy.cache.CacheEntry.lockFile(Unknown Source)

   at com.sun.deploy.cache.CacheEntry.readManifest(Unknown Source)

   at com.sun.deploy.cache.CacheEntry.access$300(Unknown Source)

   at com.sun.deploy.cache.CacheEntry$2.run(Unknown Source)

   at java.security.AccessController.doPrivileged(Native Method)

   at com.sun.deploy.cache.CacheEntry.getJarFile(Unknown Source)

   at com.sun.deploy.cache.Cache.removeCacheEntryImpl(Unknown Source)

   at com.sun.deploy.cache.Cache.access$100(Unknown Source)

   at com.sun.deploy.cache.Cache$4.run(Unknown Source)

   at java.security.AccessController.doPrivileged(Native Method)

   at com.sun.deploy.cache.Cache.removeCacheEntry(Unknown Source)

   at com.sun.deploy.cache.Cache.removeCacheEntry(Unknown Source)

   at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)

   at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)

   at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)

   at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)

   at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)

   at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)

   at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)

   at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)

   at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)

   at com.sun.javaws.Launcher.downloadResources(Unknown Source)

   at com.sun.javaws.Launcher.prepareLaunchFile(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$1.run(Unknown Source)

   at java.lang.Thread.run(Unknown Source)

CacheEntry.lockFile is spinning, hoping it will be able to get the lock sometime, which it won't, and therefore the hang.

This is because in CacheEntry.writeFileToDisk, once we got the badcert exception, we try to remove the bad jar, without actually closing it first.  So with the new locking code, we run into the hang.

I have a simple fix available.  In CacheEntry.writeFileToDisk, once we got the exception, we should close the JAR before we try to remove the JAR.

Please file a new bug for this.  We need to put in a fix for both 6u2 b02 and JDK 7.
                                     
2007-04-02
SUGGESTED FIX

http://web-east.east/deployment/www/webrevs/ngthomas/6541319/jdk7/webrev/
                                     
2007-04-02



Hardware and Software, Engineered to Work Together