This is the mail archive of the
mailing list for the Java project.
Re: Is serialization broken?
- To: Bryce McKinlay <bryce at albatross dot co dot nz>
- Subject: Re: Is serialization broken?
- From: Warren Levy <warrenl at redhat dot com>
- Date: Fri, 26 Jan 2001 17:29:37 -0800 (PST)
- cc: Barnet Wagman <wagman at enteract dot com>, "java-discuss at sources dot redhat dot com" <java-discuss at sources dot redhat dot com>
On Sat, 27 Jan 2001, Bryce McKinlay wrote:
> Warren Levy wrote:
> > Well, it seems that java.io.DataInputStream.readInt is throwing an
> > EOFException because it is mistakenly reading some negative data to mean
> > EOF. I was able to jump past the check for the negative value in the
> > debugger and the program ran to completion just fine.
> Ouch. Now that I look at this, my DataInputStream patch from classpath should
> go in. It will re-merge the implementations and ought to fix this bug.
That may help but I think that ObjectInputStream.read() is the real
It takes an element of a byte array and returns it as an int (so it can
accidently get sign-extended). I haven't checked this, but my guess is
that it should be AND'ing with 0xFF (and there should be a try/catch of
EOFException so that it can return -1 if EOFException is thrown from
> > Breakpoint 2, java.util.HashMap.readObject (this=@8101fc8, s=@8086400)
> > at /home/warrenl/egcs/libjava/java/util/HashMap.java:639
> > 639 s.defaultReadObject();
> Hmm... do you have a magic GDB that can demange new-ABI java symbols? I'm
> using the latest gdb from cvs, which seems to work quite nicely, but it
> doesn't demangle. I was planning to make an attempt to fix this, but don't
> want to duplicate someone elses effort.
Nah, for debugging purposes, I'm still using a tree built with the old
ABI so I'm not running into this.