On Fri, May 25, 2012 at 12:57 AM, Fabrizio Perin <[email protected]>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 size). 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 checking. > I'm on Mac os 10.7.4 and the image is: > > Pharo1.4 > Latest update: #14438 > > Cheers, > Fabrizio > > -- best, Eliot
