classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Jikesrvm-regression] classpath CVS head regression FAILED 4 tests;


From: Mark Wielaard
Subject: Re: [Jikesrvm-regression] classpath CVS head regression FAILED 4 tests; 0 mauve failures
Date: Tue, 09 Nov 2004 00:12:54 +0100

Hi,

On Mon, 2004-11-08 at 23:46, Steven Augart wrote:
> >  development: Failed in SPECjbb2000
> Another new problem, this time during class loading.  I'm CC'ing this 
> to the classpath list, since it probably points to a problem in 
> Classpath CVS head.
>
>          at java.util.jar.JarFile.verify(JarFile.java:669)
>          at java.util.jar.JarFile.readSignatures(JarFile.java:561)
>          at java.util.jar.JarFile.getEntry(JarFile.java:406)
>          at java.util.jar.JarFile.getJarEntry(JarFile.java:475)

I was just hunting this one down.
Attached is my first attempt.

It makes sure to not check the verified Map when the jar file is
explicitly opened with verify set to false. It also just compares the
value in the Map to Boolean.TRUE or Boolean.FALSE.

I am still thinking about synchronization issues.
It looks like we need to be more careful about synchronization when
manipulating/reading the verified Map since a JarFile can probably be
accessed from multiple threads at once.

Cheers,

Mark
Index: java/util/jar/JarFile.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/jar/JarFile.java,v
retrieving revision 1.12
diff -u -r1.12 JarFile.java
--- java/util/jar/JarFile.java  7 Nov 2004 22:04:57 -0000       1.12
+++ java/util/jar/JarFile.java  8 Nov 2004 23:10:50 -0000
@@ -363,7 +363,7 @@
       // signatures are valid. This means the certificates will not be
       // available if the entry hasn't been read yet.
       if (entryCerts != null && verified.containsKey(zip.getName())
-          && ((Boolean) verified.get(zip.getName())).booleanValue())
+          && verified.get(zip.getName()) == Boolean.TRUE)
         {
           Set certs = (Set) entryCerts.get(jar.getName());
           if (certs != null)
@@ -420,7 +420,7 @@
           debug("entryCerts=" + entryCerts + " verified " + name
                 + " ? " + verified.get(name));
         if (entryCerts != null && verified.containsKey(name)
-            && ((Boolean) verified.get(name)).booleanValue())
+            && verified.get(name) == Boolean.TRUE)
           {
             Set certs = (Set) entryCerts.get(name);
             if (certs != null)
@@ -455,7 +455,7 @@
       {
         if (DEBUG)
           debug("reading already verified entry " + entry);
-        if (!((Boolean) verified.get(entry.getName())).booleanValue())
+        if (verify && verified.get(entry.getName()) == Boolean.FALSE)
           throw new ZipException("digest for " + entry + " is invalid");
         return super.getInputStream(entry);
       }

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]