Hi Jorge,<div><br></div><div>    I&#39;ve taken a look at this and its horrible. Basically the debug VM (no optimization, asserts, and so fully debuggable) doesn&#39;t fail.  Only the production and assert (-O1, asserts) show failuresa. But since this is in TestRunner it is extremely difficult to compare the three VMs rto find out where the difference lies becauee TestRunner runs things in a random order.</div>
<div><br></div><div>So could you do me a favour and construct an image where the tests are run in a fixed order and show the error?  Please try and avoid the test that asks for one&#39;s name.  I want to be able to run the image from the C debugger without user intervention to analyse exactly what&#39;s going on.</div>
<div><br></div><div>Thanks in advance<br><br><div class="gmail_quote">On Mon, Aug 8, 2011 at 2:27 PM, Jorge Ressia <span dir="ltr">&lt;<a href="mailto:jorge.ressia@gmail.com">jorge.ressia@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 Eliot,<br>
<br>
I put the image in <a href="http://dl.dropbox.com/u/14991225/Bifrost-Eliot.zip" target="_blank">http://dl.dropbox.com/u/14991225/Bifrost-Eliot.zip</a><br>
I am using VM.r2486.<br>
<br>
The object as method class is called HLMethod. I reverted the change<br>
on flushCache to have the previous implementation that breaks.<br>
If you run the tests in BFBehavioralMetaObjectTest, particularly the<br>
category &quot;test - state write&quot; several time at some point some tests<br>
are going to fail due to a DNU on GMDualCounter&gt;&gt;initialize.<br>
<br>
If you change the HLMethod&gt;&gt;flushCache to<br>
<br>
flushCache<br>
        &lt;primitive: 116&gt;<br>
<br>
This errors disappear.<br>
<br>
Sorry that I do not have a simpler example to reproduce the case but i<br>
tried to simplify it but could not reproduce it. I think that is has<br>
to do with the number of times that I change the compiled method at<br>
runtime.<br>
<br>
Cheers,<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
On Mon, Aug 8, 2011 at 9:32 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi Jorge,<br>
&gt;<br>
&gt; On Mon, Aug 8, 2011 at 12:20 PM, Jorge Ressia &lt;<a href="mailto:jorge.ressia@gmail.com">jorge.ressia@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Eliot,<br>
&gt;&gt;<br>
&gt;&gt; I am experiencing the same problem as Lukas.<br>
&gt;&gt; I was having random DNU on replaced methods.<br>
&gt;&gt; I fixed the problem by flushing the cache on the compiled methods<br>
&gt;&gt; only, before I was flushing on the selector and on the class.<br>
&gt;&gt; It is not yet clear to me what is the right way of flushing the cache.<br>
&gt;&gt; Any explanation on that?<br>
&gt;<br>
&gt; Hmmm, no.  I would have thought that the right thing to do was to flush the selector.  Do you have an image containing a reproducible case I can test?<br>
&gt;&gt;<br>
&gt;&gt; I think that this goes along with<br>
&gt;&gt; <a href="http://code.google.com/p/pharo/issues/detail?id=2255" target="_blank">http://code.google.com/p/pharo/issues/detail?id=2255</a><br>
&gt;&gt; <a href="http://forum.world.st/flushCache-with-MethoWrappers-in-CogVM-td3381310.html" target="_blank">http://forum.world.st/flushCache-with-MethoWrappers-in-CogVM-td3381310.html</a><br>
&gt;&gt;<br>
&gt;&gt; Eliot, if you need help debugging or testing a potential solution let<br>
&gt;&gt; me know, I have a bunch of test working on top of this.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Jul 11, 2011 at 6:31 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hi All,<br>
&gt;&gt; &gt;     I&#39;m in touch with Lukas on this but have no time to address it right now.  worry not :)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Mon, Jul 11, 2011 at 3:05 AM, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Maybe cc&#39;ing VM mailing list can help.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Fri, Jul 1, 2011 at 9:32 AM, Lukas Renggli &lt;<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; Hi Eliot,<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; I am using one of the latest VMs from your site (VM.r2434) and I<br>
&gt;&gt; &gt;&gt;&gt; continue to have subtle problems with objects as methods (#flushCache,<br>
&gt;&gt; &gt;&gt;&gt; #run:with:in:).<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; The issue is that the test coverage in Pharo is kind of broken on Cog<br>
&gt;&gt; &gt;&gt;&gt; for a long time already. It reports methods as not covered that are<br>
&gt;&gt; &gt;&gt;&gt; clearly covered, and tests seem to randomly fail.<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; I suspected that there is something wrong with the coverage code<br>
&gt;&gt; &gt;&gt;&gt; itself. So I started to experiment with TestCoverage&gt;&gt;flushCache and<br>
&gt;&gt; &gt;&gt;&gt; noticed that the current implementation<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;    TestCoverage&gt;&gt;flushCache<br>
&gt;&gt; &gt;&gt;&gt;        self reference methodSymbol flushCache<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; performs not that well: The set of not covered methods is wrong and<br>
&gt;&gt; &gt;&gt;&gt; many tests suddenly fail. If I replace it with<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;    TestCoverage&gt;&gt;flushCache<br>
&gt;&gt; &gt;&gt;&gt;        self reference actualClass flushCache<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; I actually get accurate coverage information, but there are still a<br>
&gt;&gt; &gt;&gt;&gt; few tests constantly failing. I tried to use all possible combinations<br>
&gt;&gt; &gt;&gt;&gt; of #flushCache (also calling it on the compiled method), but only<br>
&gt;&gt; &gt;&gt;&gt; flushing the cache on the class seems to work properly. So far so<br>
&gt;&gt; &gt;&gt;&gt; good, but I really wonder what the correct way is to flush the cache?<br>
&gt;&gt; &gt;&gt;&gt; :-)<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; For my experiments I was using the package &#39;AST-Tests-Semantics&#39;. This<br>
&gt;&gt; &gt;&gt;&gt; is a small package with lots of test methods that cover each method<br>
&gt;&gt; &gt;&gt;&gt; but one (RBSemanticAnnotationMisssing&gt;&gt;#isResumable). Now the &quot;real&quot;<br>
&gt;&gt; &gt;&gt;&gt; problem is that when running these tests in coverage mode, the same 4<br>
&gt;&gt; &gt;&gt;&gt; tests always fail:<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;     RBSemanticTest&gt;&gt;testBlockScope<br>
&gt;&gt; &gt;&gt;&gt;     RBSemanticTest&gt;&gt;testCascadeReceiver<br>
&gt;&gt; &gt;&gt;&gt;     RBSemanticTest&gt;&gt;testClassVariableBinding<br>
&gt;&gt; &gt;&gt;&gt;     RBSemanticTest&gt;&gt;testGlobalVariableBinding<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; Not sure of how to debug that? Do you have an idea why these otherwise<br>
&gt;&gt; &gt;&gt;&gt; passing tests suddenly fail? If you want to try to reproduce you can<br>
&gt;&gt; &gt;&gt;&gt; use any Pharo image with the tests loaded, or use those that I used:<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;     <a href="http://jenkins.lukas-renggli.ch/job/Development/lastSuccessfulBuild/artifact/omnibrowser-tests/omnibrowser-tests.changes" target="_blank">http://jenkins.lukas-renggli.ch/job/Development/lastSuccessfulBuild/artifact/omnibrowser-tests/omnibrowser-tests.changes</a><br>

&gt;&gt; &gt;&gt;&gt;     <a href="http://jenkins.lukas-renggli.ch/job/Development/lastSuccessfulBuild/artifact/omnibrowser-tests/omnibrowser-tests.image" target="_blank">http://jenkins.lukas-renggli.ch/job/Development/lastSuccessfulBuild/artifact/omnibrowser-tests/omnibrowser-tests.image</a><br>

&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; Open the Test Runner, select &#39;AST-Tests-Semantics&#39; and &#39;Run Coverage&#39;.<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; Any help or clarification would be appreciated :-)<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; Lukas<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; --<br>
&gt;&gt; &gt;&gt;&gt; Lukas Renggli<br>
&gt;&gt; &gt;&gt;&gt; <a href="http://www.lukas-renggli.ch" target="_blank">www.lukas-renggli.ch</a><br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; Mariano<br>
&gt;&gt; &gt;&gt; <a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; best,<br>
&gt;&gt; &gt; Eliot<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Jorge Ressia<br>
&gt;&gt; <a href="http://www.jorgeressia.com" target="_blank">www.jorgeressia.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; best,<br>
&gt; Eliot<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Jorge Ressia<br>
<a href="http://www.jorgeressia.com" target="_blank">www.jorgeressia.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>best,<div>Eliot</div><br>
</div>