<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 7, 2016 at 10:27 AM, Tobias Pape <span dir="ltr">&lt;<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
<br>
On 07.07.2016, at 18:44, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
<br>
&gt; On Thu, Jul 7, 2016 at 5:42 AM, Tobias Pape &lt;<a href="mailto:Das.Linux@gmx.de">Das.Linux@gmx.de</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi all<br>
&gt;<br>
&gt; (cc vm-dev)<br>
&gt; On 07.07.2016, at 14:28, David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; I think the problem is in the primitive error code checking. The primitive<br>
&gt; &gt; is failing with #&#39;bad argument&#39; but the fallback code attempts to handle it<br>
&gt; &gt; as #&#39;insufficient object memory&#39;. It then tries to free some memory, fails<br>
&gt; &gt; to correct the problem, and raises a &quot;Space is low&quot; notifier.<br>
&gt; &gt;<br>
&gt;<br>
&gt; I noted that when we moved to Spur initially and I tried to fix tests.<br>
&gt; The AllocationTest failed, and I changed<br>
&gt;<br>
&gt;         ec == #&#39;insufficient object memory&#39; ifTrue:<br>
&gt;<br>
&gt; to<br>
&gt;         (ec == #&#39;insufficient object memory&#39; or: [ec == #&#39;bad argument&#39;]) ifTrue:<br>
&gt;<br>
&gt; in Behavior&gt;&gt;#basicNew:<br>
&gt;<br>
&gt; Maybe that was an error?<br>
&gt;<br>
&gt; @Eliot, why does Spur return #&#39;bad argument&#39; instead of #&#39;insufficient object memory&#39; when<br>
&gt; too much memory is to be allocated?<br>
&gt;<br>
&gt; It doesn&#39;t.  It answers bad argument for anything other than an integer in the range 0 to 2^32-1 or 0 to 2^64-1.<br>
<br>
</span>But logically, it should return #&#39;insufficient object memory&#39; for &gt; 2^64-1.<br></blockquote><div><br></div><div>I disagree.  There are implementation limits.  So answering #&#39;unsupported operation&#39; or #&#39;bad argument &#39;s as logical and defensible as #&#39;out of memory&#39; and actually truer.  The VM does /not/ try and allocate memory beyond the address space size.  So actually the failure for &gt; the range 0 to 2^32-1 or 0 to 2^64-1 as #&#39;out of memory&#39; is untrue; the reason is not because the ysste, os out of memory; the reason is that this is a bad argument, outside of the valid range of the primitive.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Your change to return #&#39;bad argument&#39; with Spur broke AllocationTest&gt;&gt;#testOutOfMemorySignal which<br>
worked on pre-Spur Cog and interpreter.<br></blockquote><div><br></div><div>That&#39;s a problem with the test.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Best regards<br>
        -Tobias<br>
<br>
PS: the test that predates spur:<br>
<br>
testOutOfMemorySignal<br>
        &quot;Ensure that OOM is signaled eventually&quot;<br>
        | sz |<br>
        sz := 512*1024*1024. &quot;work around the 1GB alloc bug&quot;<br>
        self should:[(1 to: 2000) collect:[:i| Array new: sz]] raise: OutOfMemory.<br>
<br>
        &quot;Call me when this test fails, I want your machine&quot;<br>
        sz := 1024*1024*1024*1024.<br>
        self should:[Array new: sz] raise: OutOfMemory.<br>
<br>
The test failed, technically you have to call David lewis now ;)<br></blockquote><div><br></div><div>Sure.  IMO this should be checking Smalltalk wordSize and choosing a value which is within the available address space.  Don&#39;t make the tail wag the dog.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5"><br>
<br>
<br>
&gt;  I think your commit of topa 10/7/2015 20:41 for Behavior&gt;&gt;basicNew: is wrong, and should be reverted.<br>
&gt;<br>
&gt;<br>
&gt; Best regards<br>
&gt;         -Tobias<br>
&gt;<br>
&gt;<br>
&gt; &gt; Dave<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Thu, Jul 07, 2016 at 09:23:14AM +0200, Levente Uzonyi wrote:<br>
&gt; &gt;&gt; Someone seems to have trimmed the versions in the changes file. In Squeak<br>
&gt; &gt;&gt; 4.4 Behavior &gt;&gt; #basicNew: had the following body:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;      &lt;primitive: 71&gt;<br>
&gt; &gt;&gt;      self isVariable ifFalse:<br>
&gt; &gt;&gt;              [self error: self printString, &#39; cannot have variable sized<br>
&gt; &gt;&gt;              instances&#39;].<br>
&gt; &gt;&gt;      (sizeRequested isInteger and: [sizeRequested &gt;= 0]) ifTrue:<br>
&gt; &gt;&gt;              [&quot;arg okay; space must be low.&quot;<br>
&gt; &gt;&gt;              OutOfMemory signal.<br>
&gt; &gt;&gt;              ^ self basicNew: sizeRequested  &quot;retry if user proceeds&quot;].<br>
&gt; &gt;&gt;      self primitiveFailed<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; So, non-integer and negative arguments were primitive failures.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Levente<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On Wed, 6 Jul 2016, David T. Lewis wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;&gt; On Wed, Jul 06, 2016 at 06:43:25AM -0700, marcel.taeumel wrote:<br>
&gt; &gt;&gt;&gt;&gt; Hi, there!<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Is it okay that there is an endless recursion when evaluating &quot;String<br>
&gt; &gt;&gt;&gt;&gt; new: -1&quot;?<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; No, it is not okay. It should fail with a primitive failure.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Dave<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; ...<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;handleFailingFailingBasicNew:<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;handleFailingBasicNew:<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;basicNew:<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;handleFailingFailingBasicNew:<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;handleFailingBasicNew:<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;basicNew:<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;handleFailingFailingBasicNew:<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;handleFailingBasicNew:<br>
&gt; &gt;&gt;&gt;&gt; ByteString class(Behavior)&gt;&gt;basicNew:<br>
&gt; &gt;&gt;&gt;&gt; ...<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; I would like to have an error signaled instead. Note that the -1 is just<br>
&gt; &gt;&gt;&gt;&gt; an<br>
&gt; &gt;&gt;&gt;&gt; example for a bad computation. The error I get is &quot;Space is low&quot; then. :-)<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Best,<br>
&gt; &gt;&gt;&gt;&gt; Marcel<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;<br>
<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>