[Vm-dev] CogVM/StackVM fail to read in image, fine on Squeak 4.2.1 MacVM

Stefan Marr squeak at stefan-marr.de
Mon Jul 18 13:01:07 UTC 2011

Hi Dave:

On 18/07/11 14:34, David T. Lewis wrote:
> On Mon, Jul 18, 2011 at 02:02:10PM +0200, Stefan Marr wrote:
>> However, now I noticed that the CogVM/StackVM crash when they are asked
>> to load an image which is saved by our RoarVM.
>> The Cog/StackVM fail to open it with an error in "0
>> org.squeakfoundation.Squeak       0x00033462
>> readImageFromFileHeapSizeStartingAt + 3058"
>> [1] http://soft.vub.ac.be/~smarr/roarvm/squeak-saved-with-rvm.zip
> The difference between the 6505 format at 6504 format is the word
> reversal for floats when running on little-endian. That is the only
> difference in the image itself, but Cog/StackInterpreter also add
> some additional information in the image file header. This means
> that if you load a 6505 format image into RoarVM, and later save
> it in that same format (as opposed to converting back to 6504),
> then your image file header will be missing some information that
> an actual Cog VM would expect to see.
I should have left out the mentioning of 6505, sorry for the confusion.
I do not think that it has anything to do with that.

I took the standard stock Squeak 4.2 image, which is as far as I can 
tell published as 6504.

Now, I open and save it with the RoarVM, and then try to open it with 
Stack/CogVM, which crashes.

> For the standard VM, I adopted the convention of accepting a
> 6505 format image, converting the float word ordering back to
> 6504 format at load time, and always saving it as 6504. Since
> Cog and StackVM know how to read a 6504 format, and the standard
> VM knows how to read a 6505 format, everything works as expected
> with this policy.
Just as a side note, since I think it is unrelated to the issue I am seeing:
Yes, that is exactly, what I do to. I might have missed some bits, since 
the cs file I found unfortunately does not contain diffs. So I could not 
figure out exactly what changed, but well. At least I got the necessary 
functionality which allows me to open images saved with Cog.
For reference: 
Crediting you ;)

Best regards

More information about the Vm-dev mailing list