Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 189168

Summary: One corrupted bundle can cause the root site to disappear
Product: [Eclipse Project] Platform Reporter: Thomas Watson <tjwatson>
Component: Update (deprecated - use Eclipse>Equinox>p2)Assignee: Platform-Update-Inbox <platform-update-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, kim.moir, mike.haller
Version: 3.2Flags: dejan: review? (dj.houghton)
dejan: review? (tjwatson)
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: obsolete
Attachments:
Description Flags
The patch to rethrow the original exception instead of eating it none

Description Thomas Watson CLA 2007-05-25 11:59:42 EDT
See bug 189000.

Update core is eating a SecurityException at org.eclipse.update.internal.core.LocalSite#parseLocalSiteFile (line 96)

This causes major issues because the base site does not get configured which causes the Europa update site to be missing.  But it also causes other major failures when attempting to configure an extension location.  This results in a platform.xml that only contains the bundles/features from the extension location, all the base platform features will be missing.  This results in all of the base plaform bundles being uninstalled and the platform fails to launch.

Here is the exception which is caught and thrown away.

java.lang.SecurityException: invalid SHA1 signature file digest for about.html	at sun.security.util.SignatureFileVerifier.verifySection(SignatureFileVerifier.java:461)	at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:254)	at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:199)	at java.util.jar.JarVerifier.processEntry(JarVerifier.java:300)	at java.util.jar.JarVerifier.update(JarVerifier.java:212)	at java.util.jar.JarFile.initializeVerifier(JarFile.java:402)	at java.util.jar.JarFile.getInputStream(JarFile.java:479)	at org.eclipse.update.core.JarEntryContentReference.getInputStream(JarEntryContentReference.java:62)	at org.eclipse.update.internal.core.SiteFileFactory.parsePackagedPlugins(SiteFileFactory.java:383)	at org.eclipse.update.internal.core.SiteFileFactory.parseSite(SiteFileFactory.java:140)	at org.eclipse.update.internal.core.SiteFileFactory.createSite(SiteFileFactory.java:72)	at org.eclipse.update.internal.core.InternalSiteManager.createSite(InternalSiteManager.java:336)	at org.eclipse.update.internal.core.InternalSiteManager.createSite(InternalSiteManager.java:326)	at org.eclipse.update.internal.core.InternalSiteManager.createSite(InternalSiteManager.java:291)	at org.eclipse.update.internal.core.InternalSiteManager.attemptCreateSite(InternalSiteManager.java:222)	at org.eclipse.update.internal.core.InternalSiteManager.getSite(InternalSiteManager.java:157)	at org.eclipse.update.core.SiteManager.getSite(SiteManager.java:80)	at org.eclipse.update.internal.model.InstallConfigurationParser.processSite(InstallConfigurationParser.java:90)	at org.eclipse.update.internal.model.InstallConfigurationParser.processConfig(InstallConfigurationParser.java:204)	at org.eclipse.update.internal.model.InstallConfigurationParser.&lt;init&gt;(InstallConfigurationParser.java:65)	at org.eclipse.update.internal.model.InstallConfigurationModel.initialize(InstallConfigurationModel.java)	at org.eclipse.update.internal.model.InstallConfigurationModel.getConfigurationSitesModel(InstallConfigurationModel.java:60)	at org.eclipse.update.internal.model.SiteLocalModel.setCurrentConfigurationModel(SiteLocalModel.java:195)	at org.eclipse.update.internal.core.LocalSite.addConfiguration(LocalSite.java:122)	at org.eclipse.update.internal.model.SiteLocalParser.processConfig(SiteLocalParser.java:131)	at org.eclipse.update.internal.model.SiteLocalParser.&lt;init&gt;(SiteLocalParser.java:79)	at org.eclipse.update.internal.core.LocalSite.parseLocalSiteFile(LocalSite.java:93)
Comment 1 Dejan Glozic CLA 2007-05-25 12:24:27 EDT
I am attaching a patch that is rethrowing the exception:

Comment 2 Dejan Glozic CLA 2007-05-25 12:25:07 EDT
Created attachment 68794 [details]
The patch to rethrow the original exception instead of eating it
Comment 3 Dejan Glozic CLA 2007-05-25 12:29:01 EDT
I was able to reproduce the original problem when I deleted the exloded project for the corruped bundle and replaced it with the signed jar. 

The attached patch will cause error dialogs to show up.
The message isn't ideal because it does not tell you which JAR is causing it, but is definitely a step forward.
Comment 4 DJ Houghton CLA 2007-05-25 12:55:59 EDT
When I apply the patch and put the patched version of the bundle into the i0525 build, I get an error dialog 3 times on my way to the "install new features" screen. The message is:
   "invalid SHA1 signature file digest for about.html"
which should be capitalized and have proper punctuation at the end.

Unfortunately without the name of the bundle that is causing the problem, this isn't much help. How much work is it to add the name of the bundle?

The result of this also means that the site is disabled and we get into the same state as mentioned in bug 189000. Does it make sense to enable the site depending on what type of error we are getting?

Tom mentions that perhaps catching the security exception in JarEntryContentReference#getInputStream and maybe rethrow an IOException with more information and use SecurityException as the cause, might be better.

Thoughts?
Comment 5 Dejan Glozic CLA 2007-05-25 13:13:38 EDT
Yes, I was thinking about it on the way to lunch :-). The SHA message is coming from the exception - I didn't create it. 
Comment 6 Dejan Glozic CLA 2007-06-01 12:55:32 EDT
Since this is not a regression relative to 3.2, we will not address it in 3.3.
Comment 7 John Arthorne CLA 2012-07-24 10:24:22 EDT
The Eclipse Update component is no longer under development, and no longer exists in the Eclipse Platform 4.x stream. If this problem still occurs in Eclipse Platform 4.2 or later, please enter a new bug report against Equinox p2.