[Vm-dev] [Cog] primitiveLoadImageSegment fails

Eliot Miranda eliot.miranda at gmail.com
Tue Apr 16 01:02:19 UTC 2013

Hi Bert,

    the version-compatibility check is failing.  In
NewObjectMemory>>loadImageSegmentFrom:outPointers: there's the check
        (self readableFormat: (data bitAnd: 16rFFFF "low 2 bytes")) ifFalse:
and this is failing.  The version info in the segment is 6502, which is
pre-Cog, BlockContext.  Cog expects either 6504 (closures, but big-endian
order floats) or 6505 (closures, platform-order floats).  So one might hope
that just munging the project file so that the version is 6504 will work,
alas no.

Adding e.g.

((segment at: 1) bitAnd: 16rFFFF) = 6502 ifTrue:
[(UIManager default confirm: 'Image Segment is version 6502; expecting
either 6504 or 6505.  OK to force it to 6504?') ifFalse:
[^self error: 'bad version'].
 segment at: 1 put: ((segment at: 1) bitAnd: 16rffff0000) + 6504].
arrayOfRoots := self loadSegmentFrom: segment outPointers: outPointers.

to comeUpFullyOnReload: fails because some objects ned up having a null
class, and this will just crash the image.  Alas, a) the image code doesn't
return primitiveFailed if the load primitive does fail, and b) the failure
code in the VM doesn't fail properly.  If invalid objects are created
during an attempted load the failure code doesn't nuke them.

So there's more work to do here, a) to figure out how to convert a project
file so that it's compatible with cog images, and b) to make the image
segment loading primitive more robust when it fails.


On Thu, Apr 11, 2013 at 3:52 PM, Bert Freudenberg <bert at freudenbergs.de>wrote:

> That's primitive 99. With an updated Squeak trunk image I can load this
> project fine in the interpreter:
>         http://etoys.squeak.org/svn/trunk/Etoys/Home.007.pr
> On Cog the primitive fails. Any idea what might be wrong?
> - Bert -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20130415/5df8f0b5/attachment.htm

More information about the Vm-dev mailing list