[Vm-dev] Re: [Pharo-project] VM problem?

Eliot Miranda eliot.miranda at gmail.com
Fri May 25 18:39:51 UTC 2012

On Fri, May 25, 2012 at 12:57 AM, Fabrizio Perin
<fabrizio.perin at gmail.com>wrote:

> Hi,
> I'm using last Moose build on top of CogVM 2550 and each time I click on a
> method an error pops up (see the attachment). The same problem I have it
> with older builds of Moose but I don't have any problem if I open the same
> image with Cog VM 2540 or CogVM from the Pharo web site.

I changed the definition of at: for CompiledMethod to prevent it accessing
bytes outside of the bytecodes part of a compiled method.  What's happening
here is that a hash is being derived form the compiled method by looking at
the pointers part of the compiled method (i.e. bytes < aMethod initialPC).
 But it is wrong to try and derive a hash from these bytes.  Since the GC
can move objects these bytes can change as the GC moves the literals a
method references (unlike the bytes between: aMethod initialPC and: aMethod

Two conclusions:

The solution is to define CompiledMethod>hash such that it does not access
bytes < initialPC.  The hash it is inheriting from ByteArray is fine for
ByteArray but not at all OK for CompiledMethod.

The VM is revealing a latent bug, i.e. that on older VMs the system could
be computing a variable hash, and hence result in not-found errors in
certain circumstances, hence the VM is right to impose this stricter bounds

> I'm on Mac os 10.7.4 and the image is:
> Pharo1.4
> Latest update: #14438
> Cheers,
> Fabrizio

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

More information about the Vm-dev mailing list