Hi Mariano,<div><br></div><div>    indeed it&#39;s a bug.  Your fix (objectMemory is: rcvr instanceOf: <span style="background-color: rgb(255, 255, 51); ">(self splObj: ClassBlockClosure)</span> compactClassIndex: ClassBlockClosureCompactIndex) is the correct one.  There are a few other places where this needs to be done also.  I&#39;ll roll out new code soon.</div>
<div><br></div><div>best</div><div>Eliot<br><br><div class="gmail_quote">On Wed, Dec 22, 2010 at 12:03 PM, Mariano Martinez Peck <span dir="ltr">&lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <br>Hi Eliot. If I compile a StackVM, and I just press the left arrow in a code pane of a OB windows, in a pharo image, I get an asser that fails:<br>
(oop &amp; 1) 19202<br><br>Sorry I bother with these asserts, but I am trying to solve the crashes I have and I think starting for the asserts is a good idea.<br>



<br>The assert that fails is in primitiveClosureValue()  the part:<br><br>blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));<br>    /* begin quickFetchInteger:ofObject: */<br>    oop = longAt((blockClosure + BaseHeaderSize) + (ClosureNumArgsIndex &lt;&lt; ShiftForWord));<br>




    assert((oop &amp; 1));<br>    numArgs = (oop &gt;&gt; 1);<br>    if (!(GIV(argumentCount) == numArgs)) {<br>        /* begin primitiveFail */<br>        if (GIV(primFailCode) == 0) {<br>            GIV(primFailCode) = 1;<br>




        }<br>        return;<br>    } <br><br><br>numArgs results to be a large number (using #printNum:   was 718613205), and if I try to do a #printOop:  I got a &quot; 0x55aa55aa0x55aa55aa is not on the heap&quot; <br>




<br>Now, of course, the &quot;if (!(GIV(argumentCount) == numArgs)) &quot; fails.<br><br>What it is funny is that I did a #printOop: of blockClosure instVar, and this is what I get:  0x1f59b578: a(n) Association<br><br>Association? WTF ?   so...I guess something weird is happening. I continue debugging it..and I noticed that:<br>



<br>- Several classes were called in addition to Association,like Character. These seems to be compact classes and implement #value and #value:   ;)<br>- Both, #bytecodePrimValue and #bytecodePrimValueWithArg  were not calling #primitiveClosureValue. So, &quot;isBlock&quot; was false...<br>



<br>I tried modifying #bytecodePrimValueWithArg and #bytecodePrimValue  this line:<br><br>isBlock := objectMemory is: rcvr instanceOf: <span style="background-color:rgb(255, 255, 51)">ClassBlockClosure</span> compactClassIndex: ClassBlockClosureCompactIndex.<br>



<br>to this one:<br><br>isBlock := objectMemory is: rcvr instanceOf: <span style="background-color:rgb(255, 255, 51)">(self splObj: ClassBlockClosure)</span> compactClassIndex: ClassBlockClosureCompactIndex.<br><br>
WIth this change, at least, the assert doesn&#39;t fail anymore. I made progress (maybe). But still, for normal closures, &quot;isBlock&quot; seems to be false. So.....all block values are being managed as a normal send ????<br>



<br>Now, I don&#39;t understand why ClassBlockClosureCompactIndex  is 0. I think this may be the problem. Why it is not 12? (in Pharo  Smalltalk compactClassesArray at: 12 -&gt;&gt;&gt; BlockClosure.)<br>I notice that ObjectMemory &gt;&gt; initializeCompactClassIndices  does:<br>



<br>    ClassBlockClosureCompactIndex := 0 &quot;12&quot;. &quot;Prospective.  Currently TranslatedMethod class&quot;<br><br><br>Notice that this ZERO changes the sematic of #is: oop instanceOf: classOop compactClassIndex: compactClassIndex<br>



called from the #bytecodePrimValue and bytecodePrimValueWithArg<br><br>Finally, I changed the mentioned line to this:<br><br>isBlock := objectMemory is: rcvr instanceOf:<span style="background-color:rgb(255, 255, 102)"> (self splObj: ClassBlockClosure) compactClassIndex: 12.</span><br>


   <br>and finally, with block closures, it is calling the primitive, and for Association it doesn&#39;t fail the assert.  ahh and the image doesn&#39;t crash ;)<br><br>I don&#39;t know if this is a bug, if my solution was ok, nor it impact. Please let me know.<br>


<br>Cheers<br><br>Mariano<br><br><br><br><br>
<br></blockquote></div><br></div>