CRC for Squeak images (was Re: Squeak crash upon full GC)

Paul Fernhout kfsoft at netins.net
Sun Jan 18 16:27:23 UTC 1998


Andreas -

I downloaded Squeak 1.3 (zipped) again and it works fine now.  

Since the original zipped file unzipped OK (which uses some sort of
CRC), I figure that transission must have worked OK. So the problem must
have occured when I unzipped the file and stored in on my local hard
drive (or shortly thereafter). That machine's hard drive is about two or
three years old (and has never been reformatted).

Thanks again for resolving this so quickly.  
I agree CRC would detect many potential problems.
It could just warn you of a problem, in case you wanted to use the image
anyway.

After looking at readImageFile() and writeImageFile() in (the obsolete
but similar to current practice) sqSaveRestore.c it seems one could be
added there fairly easily (if you have code for doing CRC). There must
be some PD code for that somewhere.  The biggest issue is deciding where
to put the CRC checksum value so that the new images were compatible
with the old ones.  It looks like you could increase the header size
from by fourb bytes and only read the checksum if the header size was
greater than the old one.  Then one could pass memory and
imageBytes/dataSize to a CRC function and compare the result.

I made a modified version of sqSaveRestore that calls a CRC function
(although I don't have code for what goes in that function).  Then I
realized that code is obsolete - the file save and load is now defined
in Smalltalk and will need to be changed there and regenerated.  

Anybody have a PD CRC function that could be translated to Smalltalk?  
 
-Paul Fernhout

Andreas Raab wrote:
> 
> Paul,
> 
> The crash upon GC looks like being solved.
> 
> > > Strange thing. I just downloaded it again, extracted it and _could_ save
> > > it without any problems.
> >
> > Sounds like a problem on my end or transmission error then.
> 
> It looks very much like this. I've run a binary diff on your image and the
> one in the ftp directory and it turned out that one bit differed.
> 
> > Gee, it would be nice if Squeak did a CRC on images.  I wonder how I
> > would add that - maybe a check at startup?  Maybe adding that should be
> > my punishment if it is just a transmission error. Perhaps it could be an
> > optional method - but the CRC value would have to be computed on image
> > save - which would slow things down.
> 
> I don't think that this would slow down things too much. Would be great if
> somebody would add some CRC checking to Squeak. I'm not sure how many
> images are hanging around with the one or other bit toggled. In your case
> we did find only because it was in the object header ... yes I think doing
> some CRC checking would be a _very_ good idea.
> 
> > I'm going to download the zip file again and see if it improves.  That
> > really should have been the first thing I did before mentioning it.
> > Sorry.
> 
> Don't worry. These things happen all the time. And it also shows the need
> for CRC checking. In this sense it may turn out as a good starting point
> for future development.
> 
> Andreas





More information about the Squeak-dev mailing list