[squeak-dev] new Cog VMs

Igor Stasenko siguctua at gmail.com
Wed Jan 5 00:55:24 UTC 2011


On 4 January 2011 23:46, Yoshiki Ohshima <yoshiki at vpri.org> wrote:
>  Hi, Eliot and all,
>
> With Cog VM.r2341 (Cog VM 4.0.0 (release) from Jan 2 2011) and vanilla
> 4.2-10779 image on Windows Vista, I have an interesting issue.  File
> in attached change set and put the following line in a workspace:
>
> BooleanArrayUser new loop
>
> and do-it couple of times.  And, say, switch to web browser, surf some
> web and come back and try the cycle again.  I get mustBeBoolean error
> in the #loop method eventually.  In the debugger, the array often is
> displayed as:
>
> a BooleanArray(true true 1 1 1 1 1 1)
>
> when all of slots should be printed as 'true'.
>
> It is as if my version of #at: is bypassed and, say, right after GC or
> something like that.
>
> In a real "application", I get the error more consistently.
>

I observed similar issues when references to some stable object(s)
randomly flipped to small integers.
My guess is that there are something broken, or probably interferes
with GC mark phase. Because the only place where
GC playing with references is during marking, and here is potential
place, which could do that:

ObjectMemory>>startField
    ....
	parentField := field - BytesPerWord bitOr: 1.
        ^ StartObj


then in same method, just little above:

	typeBits = 0 ifTrue: "normal oop, go down"
		[self longAt: field put: parentField.
		parentField := field.
		^ StartObj].

so, the place where it puts the small int is
  self longAt: field put: parentField.

and parentField formed previously as (anything-something) bitOr: 1 ,
is small int.

Somehow is not properly restored back, when object is fully traced.
In this way, an instances of smallints may appear instead of valid references.

> -- Yoshiki
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list