Hi Stefan,<br><br><div>    this sounds a lot like an issue that bit someone in squeak 4.x recently and was due to a bytecode compiler bug that I fixed.  I can&#39;t find or remember the email associated with this, so if anyone does remember please speak up.  Stefan, you might try running this in an updated squeak 4.1 image and compare the bytecodes.  If you get different bytecodes then we need to port the compiler fixes from 4.1 trunk to Pharo.</div>
<div><br></div><div>HTH</div><div>Eliot</div><div><br></div><div><br><div class="gmail_quote">On Wed, Sep 29, 2010 at 10:22 AM, Stefan Marr <span dir="ltr">&lt;<a href="mailto:pharo@stefan-marr.de">pharo@stefan-marr.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Further testing reveals a strange behavior in the debugger.<br>
So, I am not sure where the problem is actually caused.<br>
<br>
I added a new local variable block to the method.<br>
block gets assigned aBlock (the parameter).<br>
<br>
If I executed Erlang spawn: [Transcript show: &#39;foo&#39;], the &#39;1 halt.&#39; is executed as I mentioned before.<br>
However, the debugger does not allow me to access aBlock, there is a subscript out of bound exception.<br>
Interestingly, &#39;block&#39; is accessible without error.<br>
<br>
<br>
If I now actually use &#39;block&#39; instead of &#39;aBlock&#39; in the executed block, then phenomena is reversed.<br>
Thus, the variable which is actually referenced in the code is not accessible anymore but gets somehow lost. They also get lost if I use both.<br>
<br>
<br>
I would still like to understand what is going on here.<br>
So any remarks are welcome.<br>
<br>
Thanks<br>
Stefan<br>
<div class="im"><br>
<br>
<br>
<br>
spawn: aBlock<br>
        &quot;Answer an ErlProcess running the code given in the parameter. The process isscheduled.&quot;<br>
</div>        | proc block |<br>
        &lt;primitive: 19&gt; &quot;Simulation guard&quot;<br>
        block := aBlock.<br>
        proc := Process<br>
<div class="im">                forContext:<br>
                        [1 halt. aBlock value.<br>
                         Processor terminateActive] asContext<br>
                priority: Processor activePriority.<br>
        proc resume.<br>
        ^ proc<br>
<br>
<br>
<br>
</div><div><div></div><div class="h5">On 29 Sep 2010, at 11:21, Stefan Marr wrote:<br>
<br>
&gt;<br>
&gt; On 29 Sep 2010, at 11:01, Igor Stasenko wrote:<br>
&gt;<br>
&gt;&gt; On 29 September 2010 11:11, Stéphane Ducasse &lt;<a href="mailto:stephane.ducasse@inria.fr">stephane.ducasse@inria.fr</a>&gt; wrote:<br>
&gt;&gt;&gt; no idea but I want to know that too so keep us posted.<br>
&gt;&gt;&gt;<br>
&gt;&gt; Smalltalk specialObjectsArray at: 28.<br>
&gt;&gt; Thats it, Process is a special object, recognized by VM.<br>
&gt;&gt; No other Process (sub)classes can be accepted by it.<br>
&gt; Could you elaborate on that? No other process can be accepted for what?<br>
&gt; Being scheduled, or being executed?<br>
&gt;<br>
&gt; There is also a comment in the comment of Process which suggests that it should be possible:<br>
&gt; &quot;(If anyone ever makes a subclass of Process, be sure to use allSubInstances in anyProcessesAbove:.)&quot;<br>
&gt; But even after making the change, that does not seem to be the actual problem.<br>
&gt;<br>
&gt;<br>
&gt; The process gets execute fine. With a &#39;1 halt.&#39; as the first statement of the aBlock block I even get a debugger. It only fails on accessing variables referenced by the closure with an index out of bound error or something similar.<br>

&gt;<br>
&gt;&gt;&gt; Erlang&gt;&gt;spawn: aBlock<br>
&gt;&gt;&gt;      &quot;Answer an ErlProcess running the code given in the parameter.<br>
&gt;&gt;&gt;        The process is scheduled.&quot;<br>
&gt;&gt;&gt;      | proc |<br>
&gt;&gt;&gt;      proc := ErlProcess<br>
&gt;&gt;&gt;              forContext:<br>
&gt;&gt;&gt;                      [1 halt. aBlock value.<br>
&gt;&gt;&gt;                       Processor terminateActive] asContext<br>
&gt;&gt;&gt;              priority: Processor activePriority.<br>
&gt;&gt;&gt;      proc resume.<br>
&gt;&gt;&gt;      ^ proc<br>
&gt;<br>
&gt;<br>
&gt; Thanks and best regards<br>
&gt; Stefan<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Stefan Marr<br>
&gt; Software Languages Lab<br>
&gt; Vrije Universiteit Brussel<br>
&gt; Pleinlaan 2 / B-1050 Brussels / Belgium<br>
&gt; <a href="http://soft.vub.ac.be/~smarr" target="_blank">http://soft.vub.ac.be/~smarr</a><br>
&gt; Phone: +32 2 629 2974<br>
&gt; Fax:   +32 2 629 3525<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Pharo-project mailing list<br>
&gt; <a href="mailto:Pharo-project@lists.gforge.inria.fr">Pharo-project@lists.gforge.inria.fr</a><br>
&gt; <a href="http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project" target="_blank">http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project</a><br>
<br>
--<br>
Stefan Marr<br>
Software Languages Lab<br>
Vrije Universiteit Brussel<br>
Pleinlaan 2 / B-1050 Brussels / Belgium<br>
<a href="http://soft.vub.ac.be/~smarr" target="_blank">http://soft.vub.ac.be/~smarr</a><br>
Phone: +32 2 629 2974<br>
Fax:   +32 2 629 3525<br>
<br>
<br>
_______________________________________________<br>
Pharo-project mailing list<br>
<a href="mailto:Pharo-project@lists.gforge.inria.fr">Pharo-project@lists.gforge.inria.fr</a><br>
<a href="http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project" target="_blank">http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project</a><br>
</div></div></blockquote></div><br></div>