Guys, please integrate this asap.  This is a horrible bug that is probably causing all sorts of crashes in large images on linux, and should have been generally causing horrible crashes all over the place.  Bugs are good at lurking :-/.<br>
<br><div class="gmail_quote">On Wed, Apr 3, 2013 at 3:27 PM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-eem.281.mcz" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-eem.281.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-eem.281<br>
Author: eem<br>
Time: 3 April 2013, 3:27:02.058 pm<br>
UUID: 64be55df-6421-4087-a712-5c07419806c7<br>
Ancestors: VMMaker.oscog-eem.280<br>
<br>
Cogit: Fix *HORRIBLE* yet ancient bug with the CogObjectRep.<br>
Both CogObjectRepresentationForSqueakV3&gt;&gt;couldBeObject: &amp;<br>
CogObjectRepresentationForSqueakV3&gt;&gt;shouldAnnotateObjectReference:<br>
used signed comparisons for oops and so once the heap size<br>
pushes oops into the upper half of the address space constant<br>
oops in machine code were no longer being updated by the GC.<br>
<br>
StackInterpreter: reqrite the login for printing methods so that<br>
printing the frame of a bad receiver won&#39;t seg fault.<br>
<br>
=============== Diff against VMMaker.oscog-eem.280 ===============<br>
<br>
Item was changed:<br>
  ----- Method: CogObjectRepresentationForSqueakV3&gt;&gt;couldBeObject: (in category &#39;garbage collection&#39;) -----<br>
  couldBeObject: oop<br>
        ^(objectMemory isNonIntegerObject: oop)<br>
+         and: [self oop: oop isGreaterThanOrEqualTo: objectMemory nilObject]!<br>
-         and: [oop asUnsignedInteger &gt;= objectMemory nilObject]!<br>
<br>
Item was changed:<br>
  ----- Method: CogObjectRepresentationForSqueakV3&gt;&gt;shouldAnnotateObjectReference: (in category &#39;garbage collection&#39;) -----<br>
  shouldAnnotateObjectReference: anOop<br>
        &quot;self assert: ((objectMemory isIntegerObject: anOop)<br>
                                or: [objectMemory addressCouldBeObj: anOop]).&quot;<br>
        ^(objectMemory isNonIntegerObject: anOop)<br>
+         and: [self oop: anOop isGreaterThan: objectMemory trueObject]!<br>
-         and: [anOop &gt; objectMemory trueObject]!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter class&gt;&gt;requiredMethodNames (in category &#39;translation&#39;) -----<br>
  requiredMethodNames<br>
        &quot;return the list of method names that should be retained for export or other support reasons&quot;<br>
        | requiredList |<br>
        requiredList := self exportAPISelectors.<br>
        requiredList addAll: NewObjectMemory requiredMethodNames.<br>
        &quot;A number of methods required by VM support code, jitter, specific platforms etc&quot;<br>
        requiredList addAll: #(<br>
                assertValidExecutionPointe:r:s:<br>
                characterForAscii: checkedLongAt:<br>
                delayExpired<br>
+               findClassOfMethod:forReceiver: findSelectorOfMethod:<br>
-               findClassOfMethod:forReceiver: findSelectorOfMethod:forReceiver:<br>
                        forceInterruptCheck forceInterruptCheckFromHeartbeat fullDisplayUpdate<br>
                getCurrentBytecode getFullScreenFlag getInterruptKeycode getInterruptPending<br>
                        getSavedWindowSize getThisSessionID<br>
                highBit:<br>
                interpret<br>
                loadInitialContext<br>
                oopFromChunk:<br>
                primitiveFail primitiveFailFor: primitiveFlushExternalPrimitives printAllStacks printCallStack printContext:<br>
                        printExternalHeadFrame printFramesInPage: printFrame: printHeadFrame printMemory printOop:<br>
                                printStackPages printStackPageList printStackPagesInUse printStackPageListInUse<br>
                readableFormat: readImageFromFile:HeapSize:StartingAt:<br>
                setFullScreenFlag: setInterruptKeycode: setInterruptPending: setInterruptCheckChain:<br>
                        setSavedWindowSize: success:<br>
                validInstructionPointer:inMethod:framePointer:).<br>
<br>
        &quot;Nice to actually have all the primitives available&quot;<br>
        requiredList addAll: (self primitiveTable select: [:each| each isSymbol]).<br>
<br>
        &quot;InterpreterProxy is the internal analogue of sqVirtualMachine.c, so make sure to keep all those&quot;<br>
        InterpreterProxy organization categories do:<br>
                [:cat |<br>
                ((cat ~= &#39;initialize&#39;) and: [cat ~= &#39;private&#39;]) ifTrue:<br>
                        [requiredList addAll: (InterpreterProxy organization listAtCategoryNamed: cat)]].<br>
<br>
        ^requiredList!<br>
<br>
Item was added:<br>
+ ----- Method: StackInterpreter&gt;&gt;addressCouldBeClassObj: (in category &#39;debug support&#39;) -----<br>
+ addressCouldBeClassObj: maybeClassObj<br>
+       &quot;Answer if maybeClassObj looks like a class object&quot;<br>
+       &lt;inline: false&gt;<br>
+       ^(objectMemory addressCouldBeObj: maybeClassObj)<br>
+         and: [((objectMemory isPointersNonInt: maybeClassObj) and: [(objectMemory lengthOf: maybeClassObj) &gt;= 3])<br>
+         and: [(objectMemory isPointersNonInt: (objectMemory fetchPointer: SuperclassIndex ofObject: maybeClassObj))<br>
+         and: [(objectMemory isPointersNonInt: (objectMemory fetchPointer: MethodDictionaryIndex ofObject: maybeClassObj))<br>
+         and: [(objectMemory isIntegerObject: (objectMemory fetchPointer: InstanceSpecificationIndex ofObject: maybeClassObj))]]]]!<br>
<br>
Item was added:<br>
+ ----- Method: StackInterpreter&gt;&gt;findClassContainingMethod:startingAt: (in category &#39;debug support&#39;) -----<br>
+ findClassContainingMethod: meth startingAt: classObj<br>
+       | currClass classDict classDictSize methodArray i |<br>
+       currClass := classObj.<br>
+       [classDict := objectMemory fetchPointer: MethodDictionaryIndex ofObject: currClass.<br>
+        classDictSize := objectMemory fetchWordLengthOf: classDict.<br>
+        methodArray := objectMemory fetchPointer: MethodArrayIndex ofObject: classDict.<br>
+        i := 0.<br>
+        [i &lt; (classDictSize - SelectorStart)] whileTrue:<br>
+               [meth = (objectMemory fetchPointer: i ofObject: methodArray) ifTrue:<br>
+                       [^currClass].<br>
+                i := i + 1].<br>
+        currClass := self superclassOf: currClass.<br>
+        currClass = objectMemory nilObject] whileFalse.<br>
+       ^currClass              &quot;method not found in superclass chain&quot;!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter&gt;&gt;findClassOfMethod:forReceiver: (in category &#39;debug support&#39;) -----<br>
  findClassOfMethod: meth forReceiver: rcvr<br>
+       | rclass |<br>
+       (objectMemory addressCouldBeOop: rcvr) ifTrue:<br>
+               [rclass := objectMemory fetchClassOf: rcvr.<br>
+                (self addressCouldBeClassObj: rclass) ifTrue:<br>
+                       [rclass := self findClassContainingMethod: meth startingAt: rclass.<br>
+                       rclass ~= objectMemory nilObject ifTrue:<br>
+                               [^rclass]]].<br>
-<br>
-       | rclass currClass classDict classDictSize methodArray i |<br>
        (objectMemory addressCouldBeObj: meth) ifFalse:<br>
                [^objectMemory nilObject].<br>
+       ^self findClassContainingMethod: meth startingAt: (self methodClassOf: meth)!<br>
-       (objectMemory addressCouldBeOop: rcvr)<br>
-               ifTrue: [rclass := objectMemory fetchClassOf: rcvr]<br>
-               ifFalse: [rclass := self methodClassOf: meth].<br>
-       currClass := rclass.<br>
-       [classDict := objectMemory fetchPointer: MethodDictionaryIndex ofObject: currClass.<br>
-        classDictSize := objectMemory fetchWordLengthOf: classDict.<br>
-        methodArray := objectMemory fetchPointer: MethodArrayIndex ofObject: classDict.<br>
-        i := 0.<br>
-        [i &lt; (classDictSize - SelectorStart)] whileTrue:<br>
-               [meth = (objectMemory fetchPointer: i ofObject: methodArray) ifTrue:<br>
-                       [^currClass].<br>
-                i := i + 1].<br>
-        currClass := self superclassOf: currClass.<br>
-        currClass = objectMemory nilObject] whileFalse.<br>
-       ^rclass         &quot;method not found in superclass chain&quot;!<br>
<br>
Item was added:<br>
+ ----- Method: StackInterpreter&gt;&gt;findSelectorOfMethod: (in category &#39;debug support&#39;) -----<br>
+ findSelectorOfMethod: meth<br>
+       | classObj classDict classDictSize methodArray i |<br>
+       (objectMemory addressCouldBeObj: meth) ifFalse:<br>
+               [^objectMemory nilObject].<br>
+       classObj := self methodClassOf: meth.<br>
+       (self addressCouldBeClassObj: classObj) ifTrue:<br>
+               [classDict := objectMemory fetchPointer: MethodDictionaryIndex ofObject: classObj.<br>
+                classDictSize := objectMemory fetchWordLengthOf: classDict.<br>
+                methodArray := objectMemory fetchPointer: MethodArrayIndex ofObject: classDict.<br>
+                i := 0.<br>
+                [i &lt;= (classDictSize - SelectorStart)] whileTrue:<br>
+                       [meth = (objectMemory fetchPointer: i ofObject: methodArray) ifTrue:<br>
+                               [^(objectMemory fetchPointer: i + SelectorStart ofObject: classDict)].<br>
+                                i := i + 1]].<br>
+       ^objectMemory nilObject!<br>
<br>
Item was removed:<br>
- ----- Method: StackInterpreter&gt;&gt;findSelectorOfMethod:forReceiver: (in category &#39;debug support&#39;) -----<br>
- findSelectorOfMethod: meth forReceiver: rcvr<br>
-<br>
-       | currClass classDict classDictSize methodArray i |<br>
-       (objectMemory addressCouldBeObj: meth) ifFalse:<br>
-               [^objectMemory nilObject].<br>
-       (objectMemory addressCouldBeOop: rcvr)<br>
-               ifTrue: [currClass := objectMemory fetchClassOf: rcvr]<br>
-               ifFalse: [currClass := self methodClassOf: meth].<br>
-       [classDict := objectMemory fetchPointer: MethodDictionaryIndex ofObject: currClass.<br>
-        classDictSize := objectMemory fetchWordLengthOf: classDict.<br>
-        methodArray := objectMemory fetchPointer: MethodArrayIndex ofObject: classDict.<br>
-        i := 0.<br>
-        [i &lt;= (classDictSize - SelectorStart)] whileTrue:<br>
-               [meth = (objectMemory fetchPointer: i ofObject: methodArray) ifTrue:<br>
-                       [^(objectMemory fetchPointer: i + SelectorStart ofObject: classDict)].<br>
-                       i := i + 1].<br>
-        currClass := self superclassOf: currClass.<br>
-        currClass = objectMemory nilObject] whileFalse.<br>
-       ^currClass    &quot;method not found in superclass chain&quot;!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter&gt;&gt;printActivationNameFor:receiver:isBlock:firstTemporary: (in category &#39;debug printing&#39;) -----<br>
  printActivationNameFor: aMethod receiver: anObject isBlock: isBlock firstTemporary: maybeMessage<br>
+       | methClass methodSel classObj |<br>
-       | methClass methodSel |<br>
        &lt;inline: false&gt;<br>
        isBlock ifTrue:<br>
                [self print: &#39;[] in &#39;].<br>
        methClass := self findClassOfMethod: aMethod forReceiver: anObject.<br>
+       methodSel := self findSelectorOfMethod: aMethod.<br>
+       ((objectMemory addressCouldBeOop: anObject)<br>
+        and: [self addressCouldBeClassObj: (classObj := objectMemory fetchClassOf: anObject)])<br>
-       methodSel := self findSelectorOfMethod: aMethod forReceiver: anObject.<br>
-       (objectMemory addressCouldBeOop: anObject)<br>
                ifTrue:<br>
+                       [classObj = methClass<br>
-                       [(objectMemory fetchClassOf: anObject) = methClass<br>
                                ifTrue: [self printNameOfClass: methClass count: 5]<br>
                                ifFalse:<br>
+                                       [self printNameOfClass: classObj count: 5.<br>
-                                       [self printNameOfClass: (objectMemory fetchClassOf: anObject) count: 5.<br>
                                         self print: &#39;(&#39;.<br>
                                         self printNameOfClass: methClass count: 5.<br>
                                         self print: &#39;)&#39;]]<br>
                ifFalse: [self print: &#39;INVALID RECEIVER&#39;].<br>
        self print: &#39;&gt;&#39;.<br>
        (objectMemory addressCouldBeOop: methodSel)<br>
                ifTrue:<br>
                        [methodSel = objectMemory nilObject<br>
                                ifTrue: [self print: &#39;?&#39;]<br>
                                ifFalse: [self printStringOf: methodSel]]<br>
                ifFalse: [self print: &#39;INVALID SELECTOR&#39;].<br>
        (methodSel = (objectMemory splObj: SelectorDoesNotUnderstand)<br>
        and: [(objectMemory addressCouldBeObj: maybeMessage)<br>
        and: [(objectMemory fetchClassOf: maybeMessage) = (objectMemory splObj: ClassMessage)]]) ifTrue:<br>
                [&quot;print arg message selector&quot;<br>
                methodSel := objectMemory fetchPointer: MessageSelectorIndex ofObject: maybeMessage.<br>
                self print: &#39; &#39;.<br>
                self printStringOf: methodSel]!<br>
<br>
Item was changed:<br>
  ----- Method: StackInterpreter&gt;&gt;selectorOfContext: (in category &#39;debug printing&#39;) -----<br>
  selectorOfContext: aContext<br>
        (objectMemory isContext: aContext) ifFalse:<br>
                [^nil].<br>
+       ^self findSelectorOfMethod: (objectMemory fetchPointer: MethodIndex ofObject: aContext)!<br>
-       ^self<br>
-               findSelectorOfMethod: (objectMemory fetchPointer: MethodIndex ofObject: aContext)<br>
-               forReceiver:  (objectMemory fetchPointer: ReceiverIndex ofObject: aContext)!<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>