<br><br><div class="gmail_quote">On Thu, Oct 13, 2011 at 5:26 AM, Nick. <span dir="ltr">&lt;<a href="mailto:nick.lsts@gmail.com">nick.lsts@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;">
Hi Mariano,<br>
<br>
Thanks for the advice.<br>
I want to update this post with the results of some tests I&#39;ve been doing,<br>
so it&#39;s useful to anyone trying to run the simulator.<br>
<br>
I got stuck with an error I describe in the &quot;About running<br>
StackInterpreterSimulator in Pharo&quot; section.<br>
Hope someone could give me a clue on fixing that one :)<br>
<br></blockquote><div><br>Wow Nick. Your experience is really really helpful. <br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
*Simulator in Squeak 2.6/2.7 is working*<br>
First of all, if all you need is a simulator for learning/experimenting<br>
purposes grab a Squeak 2.6 or 2.7 release (yes, /that/ old). The simulator<br>
works right out of the box in those ones. See<br>
<a href="http://wiki.squeak.org/squeak/2465" target="_blank">http://wiki.squeak.org/squeak/2465</a> for  instructions on how to archieve<br>
that.<br>
<br>
*About running StackInterpreterSimulator in Pharo*<br>
Taking Mariano&#39;s image as base (grab it here:<br>
<a href="https://gforge.inria.fr/frs/download.php/28513/Pharo-1.2.1.cog.zip" target="_blank">https://gforge.inria.fr/frs/download.php/28513/Pharo-1.2.1.cog.zip</a>) I found<br>
the following issues and fixed them:<br>
<br>
To begin, I saved a copy of the image to a new file named &quot;simulated.image&quot;.<br>
Closed the image and reopened the first one.<br>
<br>
1) First problem: &quot;Error: basicNew: failed&quot;<br>
Then, I evaluated the following from the original:<br>
(StackInterpreterSimulator new openOn: &#39;source.image&#39;) test.<br>
The error I&#39;ve got is the one I described in my first post: &quot;Error:<br>
basicNew: failled&quot; for &quot;ArrayClass&gt;&gt;new&quot;.<br>
Inspecting the stack trace I found that RootTableSize was an instance of<br>
UndefinedObject in ObjectMemory&gt;&gt;initialize.<br>
Taking a deeper look, it seemed that RootTableSize was setted in<br>
ObjectMemory&gt;&gt;initializeWithOptions, wich wasn&#39;t called from<br>
StackInterpreterSimulator&gt;&gt;initialize. Instead, ObjectMemory&gt;&gt;initialize was<br>
called, but that message didn&#39;t initialize RootTableSize.<br>
So, I replaced the call form objectMemoryClass initialize to<br>
objectMemoryClass initializeWithOptions: Dictionary new. to get<br>
RootTableSize initialized properly.<br>
<br>
2) Second problem: same situation with MethodCacheSize<br>
Proceeding with StackInterpreterSimulator&#39;s execution, I came across a<br>
similar situation with MethodCacheSize in ArrayClass&gt;&gt;basicNew:.<br>
Following the same procedure as before, I found MethodCacheSize<br>
uninitialized, and setted it property replacing, in<br>
StackInterpreterSimulator&gt;&gt;initialize, the call from StackInterpreter<br>
initialize. to StackInterpreter initializeWithOptions: Dictionary new.<br>
<br>
3) Third problem: missing method from UtilityClass<br>
Proceeding again, I came across an MNU saying that UtilityClass does not<br>
understands &quot;informUser:during:&quot; message. After a message selector search, I<br>
replaced the call (that was being done in<br>
StackInterpreterSimulator&gt;&gt;openOn:extraMemory:) with UIManager default<br>
informUser: (...) during: (...)<br>
<br>
4) Fourth problem: &quot;the receiver of / is nil&quot;<br>
Originated from InterpreterStackPage&gt;&gt;headFP:. The cause was that<br>
LargeContextBytes was an instance of UndefinedObject.<br>
Once again, using the Method Finder (great tool!) I fixed the problem<br>
evaluating: InterpreterStackPage initialize. as said in that method&#39;s<br>
comment.<br>
<br></blockquote><div><br><br>Can you put the exact code to initialize all this points of 1) 2) and 4) ? <br>I mean, can you provide the final script you had to use before being able to do the <br>(StackInterpreterSimulator new openOn: &#39;source.image&#39;) test.<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
5) Fifth problem: Two MNUs in StackInterpreter<br>
Those came up: isContextNonInt:, generated from<br>
commonVariable:at:chacheIndex: and commonVaraible:at:put:cacheIndex:.<br>
I fixed those issues by replacing calls from self isContextNonInt: to self<br>
objectMemory isContextNonInt:.<br>
<br>
6) Sixth problem: MNU in StackInterpreter<br>
The selector was isContextHeader: and it was used in<br>
StackInterpreter&gt;&gt;stObject:at:.<br>
I replaced calls from self isContextHeader: to self objectMemory<br>
isContextHeader:.<br></blockquote><div><br>for 5) and 6) .. which version of VMMaker are you using?  because maybe this was already fixed in new versions?<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
7) Seventh problem: primitive clone failed in CArrayAccesor.<br>
I fixes that by adding the clone message in CArrayAccessor as follows:<br>
    clone<br>
            &lt;primitive: 148&gt;<br>
        ^ self primitiveFailed<br>
<br>
8) Lastly, restarting the simulation again I found that the desktop from the<br>
simulation image was beign rendered (Pharo logo, some Workpaces that were<br>
saved, etc.) and then this error came up: &quot;primitive failed:<br>
setGCBiasToGrowGCLimit:&quot;.<br>
The thing is that the VM that hosts the simulated one didn&#39;t open the<br>
debugger on that halt, it was like the simulated image was frozen (I<br>
suppose, because that error was in the call stack of<br>
snapshot:andQuit:embedded:).<br>
<br>
And here is when I wanted to ask you for some help guys, as I couldn&#39;t debug<br>
the host machine to invesitgate the cause and fix the problem.<br>
<br>
Do you have any clue/idea to detect the cause/fix this issue?<br>
<br></blockquote><div><br>No, I have no idea :(<br>but maybe someone does. <br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
*FileOut of the changes described*<br>
<a href="http://forum.world.st/file/n3900467/ChangesSoFarToMakeSimulatorWorkInPharo-1.2.1.zip" target="_blank">http://forum.world.st/file/n3900467/ChangesSoFarToMakeSimulatorWorkInPharo-1.2.1.zip</a><br>
ChangesSoFarToMakeSimulatorWorkInPharo-1.2.1.zip<br>
<br></blockquote><div><br>Excellent!   At the end you can also provide an image (that mine) with those changes + a workspace with all the needed initialize code and the snippet to start the simulator.<br><br>Cheers<br>   <br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Cheers and thanks in advance!<br>
<br>
Nick<br>
<font color="#888888"><br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://forum.world.st/Got-Error-basicNew-failed-when-running-InterpreterSimulator-tp3835723p3900467.html" target="_blank">http://forum.world.st/Got-Error-basicNew-failed-when-running-InterpreterSimulator-tp3835723p3900467.html</a><br>

</font><div><div></div><div class="h5">Sent from the Smalltalk VM - Beginners mailing list archive at Nabble.com.<br>
_______________________________________________<br>
VM-beginners mailing list<br>
<a href="mailto:VM-beginners@lists.squeakfoundation.org">VM-beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>