RE: [kaffe] make check fails...

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

 



Dalibor Topic wrote:
> Blake Meike wrote:
> > Dalibor Topic wrote:
> >
> >> I assume you've run into the same gcc3 vs. gcc4 issue that
> Kelvin ran
> >> into with 1.1.7. It's been fixed in CVS, indeed.
> >
> >
> > I spoke too soon.  Everything seems to be working just fine, but two
> > of the Unit Tests failed:
> >
> > FAIL: TestSerialVersions.java
> > FAIL: TestSerialPersistent.java
> >
> > I'm including the failure logs, in case you are interested.
>
> Right, that's a failure that was introduced when I merged in
> the latest
> classpath code.
> The failures were apparently introduced with Jeroen's patch from
>
> 2006-08-11  Jeroen Frijters  <jeroen@xxxxxxxxxxxx
> <mailto:jeroen@xxxxxxxxxxxx>>
>
>         * java/io/ObjectInputStream.java (readClassDescriptor):
>         Use class's class loader to resolve field types.
>         * java/io/ObjectStreamField.java
>         (ObjectStreamField(String,String,ClassLoader)): Removed.
>         (ObjectStreamField(String,String)): Don't try to
> resolve typename.
>         (resolveType): New method.
>
> but I've not investigated further yet, after I saw that the expected
> output for the test cases did not match what
> jdk 1.6 outputs for them, anyway, and the output I got with jamvm &
> classpath did not match jdk1.6 output
> either.

I can't see how that patch could have caused this (but given the complexity of the code I certainly don't rule anything out).

I've attached a hack that makes the two mentioned tests pass again (and I'm reasonably confident that won't cause any regressions), but it is not the right way to fix this problem. However, the truth of the matter is that IMO our serialization code is broken beyond repair, so I don't think it's worth it to try to fix it the right way. We should just merge in the Sun serialization code once that is available ;-)

Regards,
Jeroen
Index: java/io/ObjectOutputStream.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/io/ObjectOutputStream.java,v
retrieving revision 1.71
diff -u -r1.71 ObjectOutputStream.java
--- java/io/ObjectOutputStream.java	24 Dec 2006 20:45:06 -0000	1.71
+++ java/io/ObjectOutputStream.java	6 Feb 2007 07:37:48 -0000
@@ -1329,6 +1329,12 @@
       {
         ObjectStreamField osf = fields[i];
         Field field = osf.field;
+
+        if (field == null)
+          throw new InvalidClassException("Missing field: " + osf.getName());
+
+        if (field.getType() != osf.getType())
+          throw new InvalidClassException("Incorrect field type: " + osf.getName());
         
         if (DEBUG && dump)
           dumpElementln ("WRITE FIELD: " + osf.getName() + " type=" + osf.getType());

[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux