<div dir="ltr"><div><div>Yes, I always wanted to ask what oops signed-ness was good for?<br></div>IMO, they could simply be declared usqInt.<br><br></div>Nicolas<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/4/4 Esteban Lorenzano <span dir="ltr"><<a href="mailto:estebanlm@gmail.com" target="_blank">estebanlm@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
oh, well... I think I have a 100% reproducible case, which is already something :)<br>
<br>
anyway, I will integrate your changes tomorrow or monday :)<br>
<br>
cheers,<br>
Esteban<br>
<div class="HOEnZb"><div class="h5"><br>
On Apr 4, 2013, at 1:37 AM, Igor Stasenko <<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>> wrote:<br>
<br>
> On 4 April 2013 00:37, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br>
>> Guys, please integrate this asap. This is a horrible bug that is probably<br>
>> causing all sorts of crashes in large images on linux, and should have been<br>
>> generally causing horrible crashes all over the place. Bugs are good at<br>
>> lurking :-/.<br>
>><br>
><br>
> Glad we have less and less of them. Thanks for your effort, Eliot!<br>
><br>
> I am currently at some remote place in Switzerland ;) , and cannot do<br>
> much right now..<br>
> We're also have an interesting bug with pharo VM which (i guess)<br>
> related to some stack (mis)balancing,<br>
> we have a reproducible case where running code given you SmallInteger>>DNU...<br>
> because some SmallInteger pops up on the stack at some point. At least<br>
> it doesn't causing VM crash.<br>
> But i had no time to investigate that. Esteban, do you having any new<br>
> details on that?<br>
><br>
>><br>
>> On Wed, Apr 3, 2013 at 3:27 PM, <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br>
>>><br>
>>><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>>couldBeObject: &<br>
>>> CogObjectRepresentationForSqueakV3>>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't seg fault.<br>
>>><br>
>>> =============== Diff against VMMaker.oscog-eem.280 ===============<br>
>>><br>
>>> Item was changed:<br>
>>> ----- Method: CogObjectRepresentationForSqueakV3>>couldBeObject: (in<br>
>>> category 'garbage collection') -----<br>
>>> couldBeObject: oop<br>
>>> ^(objectMemory isNonIntegerObject: oop)<br>
>>> + and: [self oop: oop isGreaterThanOrEqualTo: objectMemory<br>
>>> nilObject]!<br>
>>> - and: [oop asUnsignedInteger >= objectMemory nilObject]!<br>
>>><br>
>>> Item was changed:<br>
>>> ----- Method:<br>
>>> CogObjectRepresentationForSqueakV3>>shouldAnnotateObjectReference: (in<br>
>>> category 'garbage collection') -----<br>
>>> shouldAnnotateObjectReference: anOop<br>
>>> "self assert: ((objectMemory isIntegerObject: anOop)<br>
>>> or: [objectMemory addressCouldBeObj:<br>
>>> anOop])."<br>
>>> ^(objectMemory isNonIntegerObject: anOop)<br>
>>> + and: [self oop: anOop isGreaterThan: objectMemory trueObject]!<br>
>>> - and: [anOop > objectMemory trueObject]!<br>
>>><br>
>>> Item was changed:<br>
>>> ----- Method: StackInterpreter class>>requiredMethodNames (in category<br>
>>> 'translation') -----<br>
>>> requiredMethodNames<br>
>>> "return the list of method names that should be retained for<br>
>>> export or other support reasons"<br>
>>> | requiredList |<br>
>>> requiredList := self exportAPISelectors.<br>
>>> requiredList addAll: NewObjectMemory requiredMethodNames.<br>
>>> "A number of methods required by VM support code, jitter, specific<br>
>>> platforms etc"<br>
>>> requiredList addAll: #(<br>
>>> assertValidExecutionPointe:r:s:<br>
>>> characterForAscii: checkedLongAt:<br>
>>> delayExpired<br>
>>> + findClassOfMethod:forReceiver: findSelectorOfMethod:<br>
>>> - findClassOfMethod:forReceiver:<br>
>>> findSelectorOfMethod:forReceiver:<br>
>>> forceInterruptCheck<br>
>>> forceInterruptCheckFromHeartbeat fullDisplayUpdate<br>
>>> getCurrentBytecode getFullScreenFlag getInterruptKeycode<br>
>>> getInterruptPending<br>
>>> getSavedWindowSize getThisSessionID<br>
>>> highBit:<br>
>>> interpret<br>
>>> loadInitialContext<br>
>>> oopFromChunk:<br>
>>> primitiveFail primitiveFailFor:<br>
>>> primitiveFlushExternalPrimitives printAllStacks printCallStack printContext:<br>
>>> printExternalHeadFrame printFramesInPage:<br>
>>> printFrame: printHeadFrame printMemory printOop:<br>
>>> printStackPages printStackPageList<br>
>>> printStackPagesInUse printStackPageListInUse<br>
>>> readableFormat: readImageFromFile:HeapSize:StartingAt:<br>
>>> setFullScreenFlag: setInterruptKeycode:<br>
>>> setInterruptPending: setInterruptCheckChain:<br>
>>> setSavedWindowSize: success:<br>
>>> validInstructionPointer:inMethod:framePointer:).<br>
>>><br>
>>> "Nice to actually have all the primitives available"<br>
>>> requiredList addAll: (self primitiveTable select: [:each| each<br>
>>> isSymbol]).<br>
>>><br>
>>> "InterpreterProxy is the internal analogue of sqVirtualMachine.c,<br>
>>> so make sure to keep all those"<br>
>>> InterpreterProxy organization categories do:<br>
>>> [:cat |<br>
>>> ((cat ~= 'initialize') and: [cat ~= 'private']) ifTrue:<br>
>>> [requiredList addAll: (InterpreterProxy<br>
>>> organization listAtCategoryNamed: cat)]].<br>
>>><br>
>>> ^requiredList!<br>
>>><br>
>>> Item was added:<br>
>>> + ----- Method: StackInterpreter>>addressCouldBeClassObj: (in category<br>
>>> 'debug support') -----<br>
>>> + addressCouldBeClassObj: maybeClassObj<br>
>>> + "Answer if maybeClassObj looks like a class object"<br>
>>> + <inline: false><br>
>>> + ^(objectMemory addressCouldBeObj: maybeClassObj)<br>
>>> + and: [((objectMemory isPointersNonInt: maybeClassObj) and:<br>
>>> [(objectMemory lengthOf: maybeClassObj) >= 3])<br>
>>> + and: [(objectMemory isPointersNonInt: (objectMemory<br>
>>> fetchPointer: SuperclassIndex ofObject: maybeClassObj))<br>
>>> + and: [(objectMemory isPointersNonInt: (objectMemory<br>
>>> fetchPointer: MethodDictionaryIndex ofObject: maybeClassObj))<br>
>>> + and: [(objectMemory isIntegerObject: (objectMemory fetchPointer:<br>
>>> InstanceSpecificationIndex ofObject: maybeClassObj))]]]]!<br>
>>><br>
>>> Item was added:<br>
>>> + ----- Method: StackInterpreter>>findClassContainingMethod:startingAt:<br>
>>> (in category 'debug support') -----<br>
>>> + findClassContainingMethod: meth startingAt: classObj<br>
>>> + | currClass classDict classDictSize methodArray i |<br>
>>> + currClass := classObj.<br>
>>> + [classDict := objectMemory fetchPointer: MethodDictionaryIndex<br>
>>> ofObject: currClass.<br>
>>> + classDictSize := objectMemory fetchWordLengthOf: classDict.<br>
>>> + methodArray := objectMemory fetchPointer: MethodArrayIndex<br>
>>> ofObject: classDict.<br>
>>> + i := 0.<br>
>>> + [i < (classDictSize - SelectorStart)] whileTrue:<br>
>>> + [meth = (objectMemory fetchPointer: i ofObject:<br>
>>> methodArray) ifTrue:<br>
>>> + [^currClass].<br>
>>> + i := i + 1].<br>
>>> + currClass := self superclassOf: currClass.<br>
>>> + currClass = objectMemory nilObject] whileFalse.<br>
>>> + ^currClass "method not found in superclass chain"!<br>
>>><br>
>>> Item was changed:<br>
>>> ----- Method: StackInterpreter>>findClassOfMethod:forReceiver: (in<br>
>>> category 'debug support') -----<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<br>
>>> 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<br>
>>> 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<br>
>>> ofObject: currClass.<br>
>>> - classDictSize := objectMemory fetchWordLengthOf: classDict.<br>
>>> - methodArray := objectMemory fetchPointer: MethodArrayIndex<br>
>>> ofObject: classDict.<br>
>>> - i := 0.<br>
>>> - [i < (classDictSize - SelectorStart)] whileTrue:<br>
>>> - [meth = (objectMemory fetchPointer: i ofObject:<br>
>>> methodArray) ifTrue:<br>
>>> - [^currClass].<br>
>>> - i := i + 1].<br>
>>> - currClass := self superclassOf: currClass.<br>
>>> - currClass = objectMemory nilObject] whileFalse.<br>
>>> - ^rclass "method not found in superclass chain"!<br>
>>><br>
>>> Item was added:<br>
>>> + ----- Method: StackInterpreter>>findSelectorOfMethod: (in category<br>
>>> 'debug support') -----<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:<br>
>>> MethodDictionaryIndex ofObject: classObj.<br>
>>> + classDictSize := objectMemory fetchWordLengthOf:<br>
>>> classDict.<br>
>>> + methodArray := objectMemory fetchPointer:<br>
>>> MethodArrayIndex ofObject: classDict.<br>
>>> + i := 0.<br>
>>> + [i <= (classDictSize - SelectorStart)] whileTrue:<br>
>>> + [meth = (objectMemory fetchPointer: i ofObject:<br>
>>> methodArray) ifTrue:<br>
>>> + [^(objectMemory fetchPointer: i +<br>
>>> SelectorStart ofObject: classDict)].<br>
>>> + i := i + 1]].<br>
>>> + ^objectMemory nilObject!<br>
>>><br>
>>> Item was removed:<br>
>>> - ----- Method: StackInterpreter>>findSelectorOfMethod:forReceiver: (in<br>
>>> category 'debug support') -----<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<br>
>>> ofObject: currClass.<br>
>>> - classDictSize := objectMemory fetchWordLengthOf: classDict.<br>
>>> - methodArray := objectMemory fetchPointer: MethodArrayIndex<br>
>>> ofObject: classDict.<br>
>>> - i := 0.<br>
>>> - [i <= (classDictSize - SelectorStart)] whileTrue:<br>
>>> - [meth = (objectMemory fetchPointer: i ofObject:<br>
>>> methodArray) ifTrue:<br>
>>> - [^(objectMemory fetchPointer: i + SelectorStart<br>
>>> ofObject: classDict)].<br>
>>> - i := i + 1].<br>
>>> - currClass := self superclassOf: currClass.<br>
>>> - currClass = objectMemory nilObject] whileFalse.<br>
>>> - ^currClass "method not found in superclass chain"!<br>
>>><br>
>>> Item was changed:<br>
>>> ----- Method:<br>
>>> StackInterpreter>>printActivationNameFor:receiver:isBlock:firstTemporary:<br>
>>> (in category 'debug printing') -----<br>
>>> printActivationNameFor: aMethod receiver: anObject isBlock: isBlock<br>
>>> firstTemporary: maybeMessage<br>
>>> + | methClass methodSel classObj |<br>
>>> - | methClass methodSel |<br>
>>> <inline: false><br>
>>> isBlock ifTrue:<br>
>>> [self print: '[] in '].<br>
>>> methClass := self findClassOfMethod: aMethod forReceiver:<br>
>>> anObject.<br>
>>> + methodSel := self findSelectorOfMethod: aMethod.<br>
>>> + ((objectMemory addressCouldBeOop: anObject)<br>
>>> + and: [self addressCouldBeClassObj: (classObj := objectMemory<br>
>>> fetchClassOf: anObject)])<br>
>>> - methodSel := self findSelectorOfMethod: aMethod forReceiver:<br>
>>> anObject.<br>
>>> - (objectMemory addressCouldBeOop: anObject)<br>
>>> ifTrue:<br>
>>> + [classObj = methClass<br>
>>> - [(objectMemory fetchClassOf: anObject) = methClass<br>
>>> ifTrue: [self printNameOfClass: methClass<br>
>>> count: 5]<br>
>>> ifFalse:<br>
>>> + [self printNameOfClass: classObj<br>
>>> count: 5.<br>
>>> - [self printNameOfClass:<br>
>>> (objectMemory fetchClassOf: anObject) count: 5.<br>
>>> self print: '('.<br>
>>> self printNameOfClass: methClass<br>
>>> count: 5.<br>
>>> self print: ')']]<br>
>>> ifFalse: [self print: 'INVALID RECEIVER'].<br>
>>> self print: '>'.<br>
>>> (objectMemory addressCouldBeOop: methodSel)<br>
>>> ifTrue:<br>
>>> [methodSel = objectMemory nilObject<br>
>>> ifTrue: [self print: '?']<br>
>>> ifFalse: [self printStringOf: methodSel]]<br>
>>> ifFalse: [self print: 'INVALID SELECTOR'].<br>
>>> (methodSel = (objectMemory splObj: SelectorDoesNotUnderstand)<br>
>>> and: [(objectMemory addressCouldBeObj: maybeMessage)<br>
>>> and: [(objectMemory fetchClassOf: maybeMessage) = (objectMemory<br>
>>> splObj: ClassMessage)]]) ifTrue:<br>
>>> ["print arg message selector"<br>
>>> methodSel := objectMemory fetchPointer:<br>
>>> MessageSelectorIndex ofObject: maybeMessage.<br>
>>> self print: ' '.<br>
>>> self printStringOf: methodSel]!<br>
>>><br>
>>> Item was changed:<br>
>>> ----- Method: StackInterpreter>>selectorOfContext: (in category 'debug<br>
>>> printing') -----<br>
>>> selectorOfContext: aContext<br>
>>> (objectMemory isContext: aContext) ifFalse:<br>
>>> [^nil].<br>
>>> + ^self findSelectorOfMethod: (objectMemory fetchPointer:<br>
>>> MethodIndex ofObject: aContext)!<br>
>>> - ^self<br>
>>> - findSelectorOfMethod: (objectMemory fetchPointer:<br>
>>> MethodIndex ofObject: aContext)<br>
>>> - forReceiver: (objectMemory fetchPointer: ReceiverIndex<br>
>>> ofObject: aContext)!<br>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> best,<br>
>> Eliot<br>
><br>
><br>
><br>
> --<br>
> Best regards,<br>
> Igor Stasenko.<br>
<br>
</div></div></blockquote></div><br></div>