<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 17, 2014 at 4:02 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</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"><div class=""><div class="h5">On Fri, Jul 18, 2014 at 12:24:29AM +0200, Nicolas Cellier wrote:<br>

&gt; 2014-07-13 16:22 GMT+02:00 David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;:<br>
&gt;<br>
&gt; &gt; On Sun, Jul 13, 2014 at 09:55:41AM -0400, David T. Lewis wrote:<br>
&gt; &gt; &gt; On Sun, Jul 06, 2014 at 12:47:25PM -0400, David T. Lewis wrote:<br>
&gt; &gt; &gt; &gt; On Sun, Jul 06, 2014 at 12:23:11PM -0400, David T. Lewis wrote:<br>
&gt; &gt; &gt; &gt; &gt; On Sun, Jul 06, 2014 at 10:34:15AM +0200, Nicolas Cellier wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; 2014-07-04 0:47 GMT+02:00 Nicolas Cellier &lt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; <a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt;:<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; 2014-07-04 0:09 GMT+02:00 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a><br>
&gt; &gt; &gt;:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt; On Thu, Jul 3, 2014 at 12:33 PM, Nicolas Cellier &lt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt; <a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt; The bug is repeatable, i simply have to execute this snippet<br>
&gt; &gt; with my<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt; test file:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt; (FileStream fileNamed: &#39;snapshot.bin&#39;) binary<br>
&gt; &gt; contentsOfEntireFile<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt; asString zipped.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt; The file is too big for an attachment here - 7.3 Mbytes - or<br>
&gt; &gt; 1.7 Mbytes<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt; gzipped by external tool.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt; If someone can suggest an upload site, or want it by mail,<br>
&gt; &gt; just ask.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt; You&#39;re welcome to put it on <a href="http://ftp.mirandanamda.org" target="_blank">ftp.mirandanamda.org</a>, cogftpuser,<br>
&gt; &gt; pw cogging<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt; with 0&#39;s &amp; 1&#39;s.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; done, pollution of your site engaged...<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Thanks Eliot!<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; I inquired a bit more about this bug.<br>
&gt; &gt; &gt; &gt; &gt; &gt; An important clue is that it does not happen in Pharo3.0!<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; But Pharo3.0 did not fundamentally change compression<br>
&gt; &gt; &gt; &gt; &gt; &gt; (except some FileSystem related changes, separation of CRC stuff<br>
&gt; &gt; in another<br>
&gt; &gt; &gt; &gt; &gt; &gt; package, some other cosmetic changes like replacing some self<br>
&gt; &gt; assert: ...<br>
&gt; &gt; &gt; &gt; &gt; &gt; by [...] assert and a potential bug in<br>
&gt; &gt; &gt; &gt; &gt; &gt; DeflateStream&gt;&gt;nextPutAll:startingAt: introduced by CamilleTeruel).<br>
&gt; &gt; &gt; &gt; &gt; &gt; Squeak behavior is presumably not due to a Compression change.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; Neither is it a VM problem, the bugs still shows up when running<br>
&gt; &gt; the Squeak<br>
&gt; &gt; &gt; &gt; &gt; &gt; image with Pharo VM.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Yes, it is definite a problem in the Squeak trunk image.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; So the difference lies somewhere else: in our beloved Stream.<br>
&gt; &gt; &gt; &gt; &gt; &gt; I remembered a recent change of Eliot related to handling of<br>
&gt; &gt; Stream created<br>
&gt; &gt; &gt; &gt; &gt; &gt; with on:from:to: (Collections-eem.567).<br>
&gt; &gt; &gt; &gt; &gt; &gt; Reverting those changes just make the snippet pass!<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; Ah ah! At the time, i found the change of Eliot quite minimal and<br>
&gt; &gt; nice.<br>
&gt; &gt; &gt; &gt; &gt; &gt; But I wish I had time to analyze this small innocent change deeper.<br>
&gt; &gt; &gt; &gt; &gt; &gt; Indeed, I remembered I previously broke my teeth on this one 2<br>
&gt; &gt; years or so<br>
&gt; &gt; &gt; &gt; &gt; &gt; ago, and preferred to adopt another strategy: avoid using<br>
&gt; &gt; on:from:to: and<br>
&gt; &gt; &gt; &gt; &gt; &gt; ReadWriteStream as much as possible.<br>
&gt; &gt; &gt; &gt; &gt; &gt; Why? because when analyzing the usage of inst.var. in Stream<br>
&gt; &gt; hierarchy, it<br>
&gt; &gt; &gt; &gt; &gt; &gt; gave me headaches, some subclass are just ignoring superclass<br>
&gt; &gt; variables, or<br>
&gt; &gt; &gt; &gt; &gt; &gt; worse are bending the semantics of superclass variables.<br>
&gt; &gt; &gt; &gt; &gt; &gt; I came to the conclusion that I could not decently master a change<br>
&gt; &gt; of<br>
&gt; &gt; &gt; &gt; &gt; &gt; on:from:to:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; I can not confirm this. I have an image in which I can reliably<br>
&gt; &gt; reproduce the<br>
&gt; &gt; &gt; &gt; &gt; failure in writing the MCZ to a file. I tried reverting the methods<br>
&gt; &gt; that were<br>
&gt; &gt; &gt; &gt; &gt; introduced in Collections-eem.567 and I am still getting the same<br>
&gt; &gt; failure.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Dave<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Oops, I spoke too soon. Indeed the problem appears as of<br>
&gt; &gt; Collections-eem.567,<br>
&gt; &gt; &gt; &gt; and does not appear in Collections-nice.566.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; So I am confirming Nicolas&#39; observations ... now to find the bug :)<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Dave<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; This seems to be a rather tricky bug, and I don&#39;t think any of us knows<br>
&gt; &gt; the<br>
&gt; &gt; &gt; cause right now. In case anyone else wants to have a look at it, here is<br>
&gt; &gt; a<br>
&gt; &gt; &gt; recipe for reproducing the bug in a clean 4.5 image:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Start with a clean Squeak 4.5 image in and empty working directory.<br>
&gt; &gt; &gt;       <a href="ftp://ftp.squeak.org/4.5/Squeak4.5-13680.zip" target="_blank">ftp://ftp.squeak.org/4.5/Squeak4.5-13680.zip</a><br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Open the image, do not update it.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Open an MC browser and add the <a href="http://source.squeak.org/trunk" target="_blank">http://source.squeak.org/trunk</a><br>
&gt; &gt; repository for the Help-Squeak-Project package and Collections package.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Load Help-Squeak-Project-kfr.18 from trunk.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Load Collections-eem.567 from trunk.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Open a browser on class SqueakToolsDebuggerHelp, and delete the class<br>
&gt; &gt; side method #showDebuggerMenuForm.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Remove the <a href="http://source.squeak.org/trunk" target="_blank">http://source.squeak.org/trunk</a> repository form the<br>
&gt; &gt; Help-Squeak-Project package in the MC browser.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Highlight your package-cache repository and try to save<br>
&gt; &gt; Help-Squeak-project to the package-cache repository.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Enter author initials &#39;dtl&#39;.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - For the package comment, enter &#39;Remove unreferenced method&#39;.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - Package save will fail part way through saving the MCZ.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; - To reproduce the failure in this image, do the following in a<br>
&gt; &gt; workspace:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;       mcv := MCVersion allInstances detect: [:e | e name = &#39;a<br>
&gt; &gt; MCVersion(Help-Squeak-Project-dtl.19)&#39;].<br>
&gt; &gt; &gt;       [f := FileStream fileNamed: &#39;junk.mcz&#39;.<br>
&gt; &gt; &gt;       mcv fileOutOn: f]<br>
&gt; &gt; &gt;               ensure: [f close].<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; In addition to the above recipe, here are some other observations:<br>
&gt; &gt;<br>
&gt; &gt; - Reverting from Collections-eem.567 to Collections-nice.566 makes the<br>
&gt; &gt;   problem go away, but ONLY if the DeflatePlugin is active.<br>
&gt; &gt;<br>
&gt; &gt; - The failure appears while executing the fallback code for<br>
&gt; &gt; #primitiveDeflateBlock<br>
&gt; &gt;   in ZipWriteStream&gt;&gt;deflateBlock:chainLength:goodMatch:<br>
&gt; &gt;<br>
&gt; &gt; - If this primitive is deactivate by commenting out the<br>
&gt; &gt;   &lt;primitive: &#39;primitiveDeflateBlock&#39; module: &#39;ZipPlugin&#39;&gt; in<br>
&gt; &gt;   ZipWriteStream&gt;&gt;deflateBlock:chainLength:goodMatch: then the problem will<br>
&gt; &gt;   occur regardless of which version of Collections is loaded.<br>
&gt; &gt;<br>
&gt; &gt; - When Collections-eem.567 is loaded, the primitive will fail on the 22nd<br>
&gt; &gt;   call to #deflateBlock:chainLength:goodMatch: and a debugger appears<br>
&gt; &gt; during<br>
&gt; &gt;   execution of the fallback code.<br>
&gt; &gt;<br>
&gt; &gt; - When Collections-nice.566 is loaded, the primitive does not fail on the<br>
&gt; &gt; 22nd<br>
&gt; &gt;   call to #deflateBlock:chainLength:goodMatch:, the fallback code is never<br>
&gt; &gt; run,<br>
&gt; &gt;   and no error appears.<br>
&gt; &gt;<br>
&gt; &gt; - When Collections-nice.566 is loaded and the primitive is disabled to<br>
&gt; &gt; force<br>
&gt; &gt;   use of the fallback code, the error appears on on the 22nd call to<br>
&gt; &gt;   #deflateBlock:chainLength:goodMatch: in exactlly the same place as when<br>
&gt; &gt;   Collections-eem.567 is loaded.<br>
&gt; &gt;<br>
&gt; &gt; - If I inspect the ZipWriteStream at the failure point (when the debugger<br>
&gt; &gt; pops<br>
&gt; &gt;   up after the problem), I see no obvious difference in the state of the<br>
&gt; &gt; stream<br>
&gt; &gt;   between the Collections-eem.567 case versus the Collections-nice.566 with<br>
&gt; &gt;   primitive disabled case.<br>
&gt; &gt;<br>
&gt; &gt; Dave<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; Very good mining work!<br>
&gt; When I hear  Stream, I think fluid...<br>
&gt; But these snags make it so viscous, it&#39;s like our Stream is going to freeze<br>
&gt; soon.<br>
&gt; Or is it more than frozen? The vein you&#39;re after sounds as hard as diamond,<br>
&gt; we gonna need a sharp peak pickaxe.<br>
&gt;<br>
<br>
</div></div>I keep hoping that your stream fixes will somehow make this problem go away, but<br>
maybe we are not so lucky.<br>
<br>
Whenever I get more time to play with this, I think I will try to catch it with<br>
gdb in the primitive. There is something strange happening that seems to first<br>
be detectable in the primitive failure, but only if Eliot&#39;s image fix is present.<br>
<br>
This kind of problem is a nice way to spend the morning with a good cup of coffee,<br>
as some people do with the NY Times crossword puzzle ;)<br>
<br>
   <a href="http://en.wikipedia.org/wiki/The_New_York_Times_crossword_puzzle" target="_blank">http://en.wikipedia.org/wiki/The_New_York_Times_crossword_puzzle</a><br>
<br>
Another &quot;morning coffee&quot; project is to figure out which version of the LargeIntegersPlugin<br>
should be used, which of course was the original topic that started this thread.<br></blockquote><div> </div><div>So given that the change adds an instance variable to WriteStream could that affect some plugin that somehow accesses a stream?  What plugin could that be?  I don&#39;t see any obvious inst vars in the DeflatePlugin or InflatePlugin.  To remind ourselves, the three changes are</div>
<div><br></div><div>add inst var to WriteStream:</div><div><br></div><div><div>PositionableStream subclass: #WriteStream</div><div><span class="" style="white-space:pre">        </span>instanceVariableNames: &#39;writeLimit initialPositionOrNil&#39;</div>
<div><span class="" style="white-space:pre">        </span>classVariableNames: &#39;&#39;</div><div><span class="" style="white-space:pre">        </span>poolDictionaries: &#39;&#39;</div><div><span class="" style="white-space:pre">        </span>category: &#39;Collections-Streams&#39;</div>
</div><div><br></div><div>use it in two places:</div><div><div>contents</div><div><span class="" style="white-space:pre">        </span>&quot;Answer with a copy of my collection from the start to the current position.&quot;</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>readLimit := readLimit max: position.</div><div><span class="" style="white-space:pre">        </span>^collection copyFrom: (initialPositionOrNil ifNil: [1]) to: position</div>
</div><div><br></div><div><div>on: aCollection from: firstIndex to: lastIndex</div><div><br></div><div><span class="" style="white-space:pre">        </span>| len |</div><div><span class="" style="white-space:pre">        </span>collection := aCollection.</div>
<div><span class="" style="white-space:pre">        </span>readLimit := </div><div><span class="" style="white-space:pre">                </span>writeLimit := lastIndex &gt; (len := collection size)</div><div><span class="" style="white-space:pre">                                                </span>ifTrue: [len]</div>
<div><span class="" style="white-space:pre">                                                </span>ifFalse: [lastIndex].</div><div><span class="" style="white-space:pre">        </span>position := firstIndex &lt;= 1</div><div><span class="" style="white-space:pre">                                </span>ifTrue: [0]</div>
<div><span class="" style="white-space:pre">                                </span>ifFalse: [firstIndex - 1].</div><div><span class="" style="white-space:pre">        </span>initialPositionOrNil := position + 1</div></div><div><br></div><div>What I&#39;ve just found is that if I revert all three changes to WriteStream the bug goes away, but if I only revert the two method changes the bug remains.  So I think the problem is merely the adding of the inst var.  This could break some plugin which was expecting inst vars in subclasses of WriteStream to be at particular offsets determined by WriteStream instSize = 4 now being 5.  The question is which plugin(s)?</div>
</div>-- <br>best,<div>Eliot</div>
</div></div>