[squeak-dev] Error in ImageSegment primitive?

Max Leske maxleske at gmail.com
Sun May 7 11:24:31 UTC 2017


Hi,

I'm trying to store an image segment with the latest pharo.cog.spur VM (32 bits) but keep failing. The segment should produce a file of around 60 MB. With an old V3 VM this is no problem at all. There, the WordArrayForSegment instance has a size of 4094179 but with the new VM I always run out of space because the primitive returns nil and, therefore, the word array size is constantly being increased.

I've built a debug VM and am stepping through the code but I don't have a clear understanding of everything that's happening. The failure happens on line 46626 of gcc3x-cointerp.c:

newOop = (copy - segStart) / 8;
if (newOop > (identityHashHalfWordMask())) {
	return PrimErrLimitExceeded;  // <--------------- failure
}

What I don't understand, for example, is why "newOop" is checked against "identityHashHalfWordMask()" and not against the segment end ("endSeg"). Here's a list of the current values of the variables upon failure:

objOop	sqInt	180812096
segAddr	sqInt	494731288
segStart	sqInt	461176856
endSeg	sqInt	815841432
bodySize	usqInt	64
contextSize	sqInt	335672448
copy	sqInt	494731288
hash	sqInt	0
hash1	sqInt	4194302
i	sqInt	833574680
iLimiT	sqInt	833574688
methodHeader	sqInt	1193471
newOop	sqInt	4194304
numMediatedSlots	sqInt	833574688
numSlots	usqInt	14
oop	sqInt	142640272

As you can see, "endSeg" would be more than large enough to hold the object. Is it possible that there's an error here?

Cheers,
Max


More information about the Squeak-dev mailing list