<div dir="ltr">Hi Stephan,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 27, 2014 at 1:09 PM, Stephan Eggermont <span dir="ltr">&lt;<a href="mailto:stephan@stack.nl" target="_blank">stephan@stack.nl</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"><br>
I&rsquo;ve been triangulating a long-standing bug in the Pharo VM, which<br>
seems to have been fixed in Squeak.<br>
<br>
1 to: 1000 do: [ :i |<br>
&nbsp; &nbsp; &nbsp; &nbsp; | string |<br>
&nbsp; &nbsp; &nbsp; &nbsp; Transcript show: &#39;Iteration &#39;; show: i; cr.<br>
&nbsp; &nbsp; &nbsp; &nbsp; 1 timesRepeat: [<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (string := String new: 1000 withAll: $a)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reversed.<br>
&nbsp; &nbsp; &nbsp; &nbsp; ].<br>
&nbsp; &nbsp; ].<br>
<br>
reliably managed to trigger the bug. It manifested itself<br>
in a number of different ways. Early VMs just crashed,<br>
later Squeak ones work, Pharo ones show different results.<br>
<br>
<a href="http://www.mirandabanda.org/files/Cog/VM/" target="_blank">http://www.mirandabanda.org/files/Cog/VM/</a><br>
2636 from 16 dec 2012 and earlier crash<br>
2640 from 20 dec 2012 and later work.<br>
<br>
Does anyone remember what changed in that period?<br></blockquote><div><br></div><div>I fixed a bug with compact classes. &nbsp;i don&#39;t remember why that would break things like your snippet but that&#39;s the substantive change:</div>
<div><br></div><div>r2640 | eliot | 2012-12-20 12:39:20 -0800 (Thu, 20 Dec 2012) | 42 lines</div><div><br></div><div>CogVM source as per VMMaker.oscog-eem.240.</div><div><br></div><div><u>Back out of the wrong-headed attempt to give compact class indices</u></div>
<div><u>to long header objects in changeClassOf:to:, and comment why</u></div><div><u>(markAndTrace: reuses header type bits and depends on compact</u></div><div><u>class and size fields to reconstruct type bits after traverse).</u></div>
<div><br></div><div><u>Consequently fix isClassOfNonImm:equalTo:compactClassIndex: so</u></div><div><u>it will still accept long-header objects that are instances of compact</u></div><div><u>classes but don&#39;t have a compact class index.</u></div>
<div><br></div><div>Clean-up accesses to the compactClassesArray so that they go</div><div>through the compactClassAt: where appropriate.</div><div><br></div><div>Use the short-hand class determinators such as isInstanceOfClassFloat:</div>
<div>in place of the long-winded is:instanceOf:compactClassIndex:.</div><div><br></div><div>Remove obsolete use of cCode: &#39;magnitude &gt;&gt; 32&#39; in the integer</div><div>conversion routines signed64BitIntegerFor: et al now that Slang</div>
<div>generates the correct cases for right-shift.</div><div><br></div><div>Eliminate the compactClassTable accessor. &nbsp;CompactClasses and splOb:</div><div>are both in scope in CogObjectRepresentationForSqueakV3.</div><div>
<br></div><div>Override sweepPhase in NewObjectMemory and hence eliminate</div><div>initializeFreeBlocksPreSweep.</div><div><br></div><div>Fix off-by-one error in okayOop:.</div><div><br></div><div>Make longPrintOop: print header type info.</div>
<div><br></div><div>Make allAccessibleObjectsOk answer a result.</div><div><br></div><div>Don&#39;t inline loadInitialContext for gdb breakpointing convenience.</div><div><br></div><div>Declare some constant variables as const in the Cogit.</div>
<div><br></div><div>Don&#39;t use SA_ONSTACK if NEED_SIGALTSTACK is 0. (default is 1, so this isn&#39;t a</div><div>change, except for experimenting).</div><div><br></div><div>Fix nscogbuild/unixbuild/HowToBuild (thanks Bob).</div>
<div><br></div><div>------------------------------------------------------------------------</div><div>r2639 | eliot | 2012-12-18 10:39:16 -0800 (Tue, 18 Dec 2012) | 5 lines</div><div><br></div><div><u>Third time lucky. &nbsp;Fix bug in changeClass:from: so that if receiver has long</u></div>
<div><u>header and class is compact, receiver still gets compact class field set, not</u></div><div><u>cleared. &nbsp;No matter what header an instance has, if its class is compact it</u></div><div><u>should have the compact class index set.</u></div>
<div><br></div><div>------------------------------------------------------------------------</div><div>r2637 | eliot | 2012-12-17 11:51:15 -0800 (Mon, 17 Dec 2012) | 10 lines</div><div><br></div><div>CogVM source as per VMMaker.oscog-eem.238</div>
<div><br></div><div>Restore ThreadedFFIPlugin wanting COGMTVM to be determined on</div><div>command line. &nbsp;Probably broke in VMMaker.oscog-eem.218</div><div><br></div><div><u>Fix bug in changeClass:from: so that if receiver has long header and</u></div>
<div><u>class is compact, receiver still gets compact class field set, not</u></div><div><u>cleared. &nbsp;No matter what header an instance has, if its class is</u></div><div><u>compact it should have the compact class index set.&nbsp;</u></div>
<div><u><br></u></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>
Stephan Eggermont<br>
<br>
<a href="https://pharo.fogbugz.com/default.asp?11130" target="_blank">https://pharo.fogbugz.com/default.asp?11130</a><br></blockquote></div><br clear="all"><div>HTH</div>-- <br>best,<div>Eliot</div>
</div></div>