v1.23 corrupting images

Ian Piumarta piumarta at prof.inria.fr
Thu Dec 25 00:11:04 UTC 1997

> every 20 to 40 min I end up with image 24 bytes length after an image save.
> Anyone on Unix noticed similar behavior?

No, never.  The image save (along with the other file i/o primitives)
appears to be working fine.  The only time I've seen an image saved
incorrectly was when the filesystem was full, and the snapshot primitive
failed silently (this really aught to be fixed sometime).

The only difference in the file primitives between 1.18 and 1.23 is that
the POSIX "b" options to the fopen() mode are present in the latter --
although this is unlikely to be affecting you since #writeImageFile: uses
"self cCode:" to to call "fwrite()" directly, and does not rely
significantly on the file primitives to save the image.


PS: I'm afraid I have no insights about how this could be debugged.  The
only thing I could suggest is that you alter image save so that it prints
the arguments that it's passing to fopen(), fseek(), fwrite() and
fclose(), and the next time that you see a truncated image check what it
printed in the terminal.  (The value _returned_ by fwrite(), when called
to write both the header words and the memory image, would also be a
useful thing to check.)

More information about the Squeak-dev mailing list