[Vm-dev] Interpreter simulator error

Eliot Miranda eliot.miranda at gmail.com
Thu May 7 21:17:43 UTC 2020


Hi Subbu,

    I had to make some changes to get the Balloon plugin to simulate
correctly.  You might want to take a look at BalloonArray and CArray et al
in VMMaker.oscog and see your way to porting the changes to VMMaker.
Better would be to get Interpreter up-to-date in VMMaker.oscog.  A sensible
end point has to be an Interpreter which is refactored like
StackInterprteer is (i.e. it does not inherit from ObjectMemory) and that
has the improvements Andreas implemented to e.g. the sample profile
primitives, etc.  Right now we have a fork, and I have no cycles I can
spend to working on Interpreter in either context.  I'd love to see someone
tackle being able to derive a classic Interpreter VM from VMMaker.oscog.
VMMaker.oscog has a much improved Slang, and of course is where Cog is
developed.

On Thu, May 7, 2020 at 12:46 AM K K Subbu <kksubbu.ml at gmail.com> wrote:

>  On 06/05/20 1:19 am, karl ramberg wrote:
> >
> > Bitmap(Object)>>at:put:
> > Receiver: a Bitmap of length 5499668
> > Arguments and temporary variables:
> > index: 4902231
> > value: 0.006711409395973154
> > Receiver's instance variables:
> > a Bitmap of length 5499668
> When I trace the stack, this occurs when a float value 1.0 is stored in
> the first slot of a float array of size 6 through an plugin
> (FloatArrayPlugin). The Bitmap here is memory (sized in words). When
> running on native VM, this code works fine but triggers an error when
> simulator tries to mimic a CArray at:put:.
> ----
> memory 4118397 (words)
> a CArray
> arrayBaseAddress:       14488972 (bytes)
> ptrOffset:      0
> unitSize:       4
>
> CArray>>at: offset put: val
>    ptrOffset = 0 ifFalse: [self error: 'only expect base address to
> receive at:put: message'].
>    unitSize = 1 ifTrue: [^ interpreter byteAt: arrayBaseAddress + offset
> put: val].
>    unitSize = 4 ifTrue: [^ interpreter longAt: arrayBaseAddress +
> (offset * 4) put: val].
>
> InterpreterSimulatorLSB>>longAt: byteAddress put: a32BitValue
>    ^memory at: (byteAddress // 4) + 1 put: a32BitValue
> -----
> But I don't understand why a valid store into memory with an index
> within bounds raises an error:
> -----
> Object>>at: index put: value
>    index isInteger ifTrue:
>      [self class isVariable
>        ifTrue: [(index >= 1 and: [index <= self size])
>          ifTrue: [self errorImproperStore]
>          ifFalse: [self errorSubscriptBounds: index]]
> -----
>
> I could reproduce this error on released images on Ubuntu Linux (64bit
> host).
> * Run Squeak3.8.1-6747full.image (this contains VMMaker code)
> * Open a workspace and inspect:
>      InterpreterSimulator new openOn: 'Squeak32-3.8g-6548.image')
> * run 'self test' from the code pane of inspector
> * after swapping bytes and relocating objects, an error dialog pops up
> (see attached log)
>
> Regards .. Subbu
>


-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200507/6cca6e4d/attachment.html>


More information about the Vm-dev mailing list