[Vm-dev] [Fwd: StarMorph busted in Cuis 850 + Cog r2361]

Eliot Miranda eliot.miranda at gmail.com
Sun Mar 6 19:09:20 UTC 2011


On Sun, Mar 6, 2011 at 10:46 AM, Eliot Miranda <eliot.miranda at gmail.com>wrote:

> Hi Juan,
>
> On Sun, Mar 6, 2011 at 9:26 AM, Juan Vuletich <juan at jvuletich.org> wrote:
>
>>
>> Hi Folks,
>>
>> (Steven, I hope you don't mind me forwarding this to public lists)
>>
>> I got this bug report from Steven. It is a problem with Cog. This works ok
>> with the interpreter, but fails with Cog. If I copy this method to Squeak
>> trunk, the same happens. Please see that a message is sent to class Point,
>> but it looks as if the receiver is an instance of Float. See that in the
>> trace, it reads "Float(Point class)>>r:degrees:" which makes no sense at
>> all.
>>
>> It looks like in this case, a pointer is pointing to the wrong object.
>>
>
> Yes, this is a bug with the new StackToRegisterMappingCogit code generator.
>  The bug dies not show up with the SimpleStackBasedCogit.  The issue is bad
> register contents management on inline cache misses.  I'll keep you posted.
>

Nothing to do with register contents.  It's a code generator bug which is
miscompiling the reference to Point in the below:

initialize
"initialize the state of the receiver"
| pt ext oldR points |
super initialize.
""
pt _ 10 @ 10.
ext _ pt r.
oldR _ ext.
points _ 5.
vertices _ (0 to: 359 by: 360 // points // 2)
collect: [:angle | (Point r: (oldR _ oldR = ext
ifTrue: [ext * 5 // 12]
ifFalse: [ext]) degrees: angle + pt degrees)
+ (45 @ 45)].
self computeBounds

>
> best,
> Eliot
>
>>
>> Something very strange is that evaluating 'StarMorph new openInWorld'
>> seems to work ok, but creating a StarMorph from the 'new morph' menu fails
>> most times (but not always!).
>>
>> Any help from VM gurus is greately appreciated. Just copy the method to
>> Squeak and try.
>>
>> Cheers,
>> Juan Vuletich
>>
>> -------- Original Message --------
>> As a gesture of appreciation for Cuis, here's a big report of a small bug.
>>  :)
>>
>> ===========================================
>>
>> Reproduce via 'Add a new morph' -> Widgets -> StarMorph.
>>
>> ===========================================
>>
>> StarMorph>>initialize from Squeak 4.2 (works)
>>
>> initialize
>> "initialize the state of the receiver"
>> super initialize.
>> self
>> makeVertices: self defaultSides
>> starRatio: self defaultStarRatio
>> withCenter: self defaultCenter
>> withPoint: self defaultFirstVertex.
>> self computeBounds
>>
>> StarMorph>>initialize from Cuis (MNU)
>>
>> initialize
>> "initialize the state of the receiver"
>> | pt ext oldR points |
>> super initialize.
>> ""
>> pt := 10 @ 10.
>> ext := pt r.
>> oldR := ext.
>> points := 5.
>> vertices := (0 to: 359 by: 360 // points // 2)
>> collect: [:angle | (Point r: (oldR := oldR = ext
>> ifTrue: [ext * 5 // 12]
>> ifFalse: [ext]) degrees: angle + pt degrees)
>> + (45 @ 45)].
>> self computeBounds
>>
>> ===========================================
>>
>> MessageNotUnderstood: Float>>new
>> 6 March 2011 6:43:13.424 am
>>
>> VM: Mac OS - Croquet Closure Cog VM [CoInterpreter VMMaker-oscog.47]
>> Croquet Cog 3.0.0
>> Image: Cuis 3.1 [latest update: #850]
>>
>> Float(Object)>>doesNotUnderstand: #new
>> Receiver: 14.14213562373095
>> Arguments and temporary variables: aMessage: new
>> exception: MessageNotUnderstood: Float>>new
>> resumeValue: nil
>> Receiver's instance variables: 14.14213562373095
>> Float(Point class)>>r:degrees:
>> Receiver: 14.14213562373095
>> Arguments and temporary variables: rho: 14.14213562373095
>> degrees: 81.0
>> Receiver's instance variables: 14.14213562373095
>> [] in StarMorph>>initialize
>> Receiver: a StarMorph(2314)
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110306/51a095ec/attachment.htm


More information about the Vm-dev mailing list