<div dir="ltr"><div><div>Ah, maybe it's time to use one of our dangerous superpowers...<br></div>What if you would start your script with:<br></div> Compiler allInstances do: [:e | e becomeForward: (e as: Compiler copy)].<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/3 Frank Shearar <span dir="ltr"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm not sure how I'd do that without making changes to Trunk (which<br>
creates a bootstrap problem in that the scripts start with an old<br>
image version), because I just throw the script at the image from the<br>
command line..<br>
<br>
frank<br>
<br>
On 2 October 2013 23:42, Nicolas Cellier<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
> Frank, could you retry to launch the script with Compiler copy evaluate:<br>
> '...' instead of Compiler evaluate: ?<br>
> I checked that<br>
> Compiler copy methodDictionary ~~ Compiler methodDictionary<br>
> so it might just work...<br>
><br>
><br>
> 2013/9/25 Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>><br>
>><br>
>> Nah, I'm cheating.<br>
>> I just opened a recent artifact from CI server one or two days ago.<br>
>> It has the same kind of debugger opened<br>
>> <a href="http://build.squeak.org/job/SqueakTrunk/537/" target="_blank">http://build.squeak.org/job/SqueakTrunk/537/</a><br>
>><br>
>><br>
>> 2013/9/25 Bob Arning <<a href="mailto:arning315@comcast.net">arning315@comcast.net</a>><br>
>>><br>
>>> Are you able to tell what's in the script he's running simply from the<br>
>>> stack trace? Or some other way?<br>
>>><br>
>>> Cheers,<br>
>>> Bob<br>
>>><br>
>>> On 9/25/13 9:12 AM, Nicolas Cellier wrote:<br>
>>><br>
>>> The problem is that the script you evaluate will update the Compiler...<br>
>>> New updates will remove unused variables before the script is finished...<br>
>>> I tried to solve the problem by introducing an intermediate step:<br>
>>> - 1) publish the modified methods in an update.mcm (I reintroduced the<br>
>>> missing vars)<br>
>>> - 2) only then remove the inst. var.<br>
>>> (See the recent serie of Compiler versions 270->274<br>
>>><br>
>>> This did not solve anything because there are always cases when you<br>
>>> launch the script from an older image (typically from Squeak 4.4, 4.3 or<br>
>>> even older)<br>
>>> The same old Compiler instance is used during all the process and it must<br>
>>> be unmodified during the process, otherwise, undefined behavior (SEGV<br>
>>> included)...<br>
>>><br>
>>> I see one way to workaround this:<br>
>>> 1) clone the Compiler class<br>
>>> 2) instantiate the clone<br>
>>> 3) let the clone evaluate<br>
>>><br>
>>> In fact, to be safer we should clone the whole hierarchy, but you could<br>
>>> 1st try simply with Compiler...<br>
>>><br>
>>><br>
>>> 2013/9/25 Bob Arning <<a href="mailto:arning315@comcast.net">arning315@comcast.net</a>><br>
>>>><br>
>>>> Just type<br>
>>>><br>
>>>> PositionableStream>>#fileInAnnouncing:<br>
>>>><br>
>>>> and explore it. Look for the literal pointing to the compiler (literal8<br>
>>>> here). Toggle that open and toggle open the value. Look at the<br>
>>>> instanceVariables - does it still have sourceStream?<br>
>>>><br>
>>>> As to the explorer, did you open one? Is it still open? (The<br>
>>>> PointerFinder says it is) Could it have been open when the image was last<br>
>>>> saved?<br>
>>>><br>
>>>><br>
>>>> Also, you could do<br>
>>>><br>
>>>> Behavior allSubInstances select: [ :e | (e asString findString:<br>
>>>> 'Compiler') > 0]<br>
>>>><br>
>>>> Do you get: an OrderedCollection(ClosureCompilerTest CompilerTest<br>
>>>> CompilerExceptionsTest CompilerNotifyingTest<br>
>>>> CompilerSyntaxErrorNotifyingTest Compiler ClosureCompilerTest class<br>
>>>> CompilerTest class CompilerExceptionsTest class CompilerNotifyingTest class<br>
>>>> CompilerSyntaxErrorNotifyingTest class Compiler class)<br>
>>>><br>
>>>><br>
>>>> Cheers,<br>
>>>> Bob<br>
>>>><br>
>>>> On 9/25/13 7:31 AM, Frank Shearar wrote:<br>
>>>><br>
>>>> I don't know how I would do that. The bytecode just says pushLit:<br>
>>>> Compiler.<br>
>>>><br>
>>>> But if I say Compiler allInstances collect: [:c | c instVarNamed:<br>
>>>> 'cue'] I see {nil . a CompilationCue . a CompilationCue}. That first<br>
>>>> one's a problem! Further, my image has an ObjectExplorer (!) hanging<br>
>>>> onto that Compiler, coming from I don't know where.<br>
>>>><br>
>>>> frank<br>
>>>><br>
>>>> On 25 September 2013 11:53, Bob Arning <<a href="mailto:arning315@comcast.net">arning315@comcast.net</a>> wrote:<br>
>>>><br>
>>>> If you inspect<br>
>>>><br>
>>>> PositionableStream>>#fileInAnnouncing:<br>
>>>><br>
>>>> and look at the literal for Compiler, does it look to be pointing to the<br>
>>>> new<br>
>>>> or old Compiler?<br>
>>>><br>
>>>> Cheers,<br>
>>>> Bob<br>
>>>><br>
>>>> On 9/25/13 6:12 AM, Frank Shearar wrote:<br>
>>>><br>
>>>> I'm running with Compiler-nice.274.<br>
>>>><br>
>>>> What's weirder is in that top stack frame (Compiler >><br>
>>>> #evaluate:in:to:notifying:ifFailed:logged: the following all show up<br>
>>>> as red, because they're references to instvars that don't exist:<br>
>>>> class, sourceStream, context, requestor.<br>
>>>><br>
>>>> That's because the CompiledMethod that's running is not actually the<br>
>>>> right CompiledMethod! It's from some ancient pre-CompilationCue<br>
>>>> Compiler instance. Or at least so I suspect because that Compiler<br>
>>>> instance has a nil 'cue' instvar.<br>
>>>><br>
>>>> If it helps, the PointerFinder says this of the offending context:<br>
>>>><br>
>>>> globals: Environment<br>
>>>> declarations: IdentityDictionary<br>
>>>> #World -> PasteUpMorph<br>
>>>> submorphs: Array<br>
>>>> 1: SystemWindow<br>
>>>> model: ObjectExplorer<br>
>>>> currentSelection: ObjectExplorerWrapper<br>
>>>> item: CompiledMethod<br>
>>>><br>
>>>> In contrast, PointerFinder on: (Compiler >><br>
>>>> #evaluate:in:to:notifying:ifFail:logged:) says:<br>
>>>><br>
>>>> CLASS: SmalltalkImage class<br>
>>>> superclass: Object class<br>
>>>> subclasses: Array<br>
>>>> 445: Compiler class<br>
>>>> methodDict: MethodDictionary<br>
>>>> array: Array<br>
>>>> 39: CompiledMethod.<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>><br>
><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>