<div dir="ltr">Hi Ben,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 5, 2014 at 10:27 AM, Ben Coman <span dir="ltr">&lt;<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><u></u>


  

<div bgcolor="#ffffff" text="#000000">
Just reporting, while looking into a query on [pharo-users] (which is
attached for initial context only and can probably be deleted from any
replies) I managed to crash the VM by evaluating the following in
Workspace:<br>
<br>
a := SequenceableCollection new.<br>
a add: 1.<br>
a , SequenceableCollection new.<br></div></blockquote><div><br></div><div>What&#39;s the image, the OS and the VM version?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#ffffff" text="#000000">
<br>
Now the interesting thing is that while the system becomes immediately
sluggish, Pharo.exe crashes about 20 seconds later. <br>
<br>
This is with Pharo 3.0 Release (30846)
<a href="http://files.pharo.org/platform/Pharo3.0-win.zip" target="_blank">http://files.pharo.org/platform/Pharo3.0-win.zip</a> (dated 2014-04-30)<br>
on Windows Home Premium 64-bit SP1.<br>
<br>
cheers -ben<br>
<br>
Ben Coman wrote:
<blockquote type="cite">
  
  <br>
Thanks. That info made it much easier to try.  Sorry I didn&#39;t end up
with an answer for you, but I confirm there is some issue here, or
something new I can learn when other chip in. <br>
  <br>
Here is what I tried.<br>
  <br>
* Installed XMLParser (monty.58) from Configuration Browser in Pharo 3.<br>
  <br>
* Ran your code. Got the same error.<br>
  <br>
* From the call stack I observed that
XMLOrderedCollection(SequenceableCollection)&gt;&gt;copyReplaceFrom:to:with:<br>
has the line &quot;newSequenceableCollection := self species new: newSize.&quot;
such that it seems your error might be reduced to the question of why
the following two snippets fail:<br>
    d := OrderedCollection new: 1.<br>
    d at: 1 put: 1.<br>
  <br>
    e := OrderedCollection new: 3.<br>
    e at: 2 put: 1.<br>
  <br>
However I&#39;m sorry that is beyond my knowledge, and I&#39;m hoping someone
else can chip in so I can learn something.<br>
  <br>
Pushing on, I noticed that XMLOrderedList has an instance variable
/collection/ which holds the OrderedCollection.<br>
  <br>
Now I wonder (without great experience and hoping to learn something)
if it smells funny that XMLOrderedList inherits all of
SequencableCollection methods that can not operate on /collection/. <br>
  <br>
I noticed that XMLOrderedList was using an
inherited SequenceableCollection&gt;&gt;copyReplaceFrom:to:with <br>
while OrderedCollection overrode that method with its own. So taking
inspiration XMLOrderedList&gt;&gt;copyFrom:to: to override
SequencableCollection&gt;&gt;copyReplaceFrom:to:with: to work with
/collection/<br>
seems to solve your problem:<br>
    XMLOrderedList&gt;&gt;copyReplaceFrom: start to: stop with:
replacementCollection <br>
        ^ self newWithCollection:<br>
            (collection copyReplaceFrom: start to: stop with:
replacementCollection )<br>
  <br>
  <br>
Along the way I noticed a few (possible) bugs that seems not related to
your problem:<br>
  <br>
* When stepping through XMLOrderedList&gt;&gt;setCollection:<br>
there is a red-box-of-death for the instance variables, which can be
solved by defining the following.<br>
    XMLOrderedList&gt;&gt;size<br>
        ^ collection ifNil: [ 0 ] ifNotNil: [ collection size]<br>
  <br>
* In the debugger the /collection/ instance variable is not shown!
(e.g. line XMLOrderedList&gt;&gt;at:put:). <br>
Can someone confirm this should show?<br>
  <br>
HTH<br>
cheers -ben<br>
  <br>
Thushar G R wrote:
  <blockquote type="cite">
    <div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">XMLOrderedList</span> belongs
to package XML-Parser-Nodes.<br>
    <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
    </span></div>
    <div><span style="font-family:arial,sans-serif;font-size:13px">a
:= XMLOrderedList new.</span></div>
    <span style="font-family:arial,sans-serif;font-size:13px">a
add:&#39;1&#39;.</span><br style="font-family:arial,sans-serif;font-size:13px">
    <span style="font-family:arial,sans-serif;font-size:13px">a ,
XMLOrderedList new.</span>
    <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
    </span></div>
    <div><span style="font-family:arial,sans-serif;font-size:13px">Here
select all and Do it. On line 3 (</span><span style="font-family:arial,sans-serif;font-size:13px">a ,
XMLOrderedList new.</span><span style="font-family:arial,sans-serif;font-size:13px">)  i am
expected to get a copy of &#39;a&#39; , but instead it throws an error </span><font face="arial, sans-serif">SubscriptOutOfBounds. </font></div>
    <div><font face="arial, sans-serif"><br>
    </font></div>
    <div><font face="arial, sans-serif"><br>
    </font></div>
    <div><font face="arial, sans-serif"><br>
    </font></div>
    <div><font face="arial, sans-serif"><br>
    </font></div>
    <div><font face="arial, sans-serif">
    <div>OrderedCollection(Object)&gt;&gt;errorSubscriptBounds:</div>
    <div>OrderedCollection&gt;&gt;ensureBoundsFrom:to:</div>
    <div>OrderedCollection&gt;&gt;at:put:</div>
    <div>OrderedCollection(SequenceableCollection)&gt;&gt;replaceFrom:to:with:startingAt:</div>
    <div>XMLOrderedList&gt;&gt;replaceFrom:to:with:startingAt:</div>
    <div>XMLOrderedList(SequenceableCollection)&gt;&gt;copyReplaceFrom:to:with:</div>
    <div>XMLOrderedList(SequenceableCollection)&gt;&gt;,</div>
    <div>UndefinedObject&gt;&gt;DoIt</div>
    <div>OpalCompiler&gt;&gt;evaluate</div>
    <div>SmalltalkEditor&gt;&gt;evaluateSelectionAndDo:</div>
    <div>PluggableTextMorph&gt;&gt;inspectIt in Block: [ textMorph
editor
evaluateSelectionAndDo: [ :resu...etc...</div>
    <div>PluggableTextMorph&gt;&gt;handleEdit: in Block: [ result :=
editBlock value ]</div>
    <div>TextMorphForEditView(TextMorph)&gt;&gt;handleEdit:</div>
    <div>PluggableTextMorph&gt;&gt;handleEdit:</div>
    <div>PluggableTextMorph&gt;&gt;inspectIt</div>
    <div>SmalltalkEditor
class&gt;&gt;buildSmalltalkEditorKeymappingsOn:
in Block: [ :morph | morph inspectIt ]</div>
    <div>BlockClosure&gt;&gt;cull:</div>
    <div>BlockClosure&gt;&gt;cull:cull:</div>
    <div>BlockClosure&gt;&gt;cull:cull:cull:</div>
    <div>KMCategoryBinding&gt;&gt;completeMatch:buffer:</div>
    <div>KMKeymap&gt;&gt;notifyCompleteMatchTo:buffer: in Block: [ :l |
l
completeMatch: self buffer: aBuffer ]</div>
    <div>Array(SequenceableCollection)&gt;&gt;do:</div>
    <div>KMKeymap&gt;&gt;notifyCompleteMatchTo:buffer:</div>
    <div>KMKeymap&gt;&gt;onMatchWith:notify:andDo:</div>
    <div>KMCategory&gt;&gt;onMatchWith:notify:andDo: in Block: [ :entry
|
entry onMatchWith: anEventBuffer notify...etc...</div>
    <div>Set&gt;&gt;do:</div>
    <div>KMCategory&gt;&gt;onMatchWith:notify:andDo:</div>
    <div>KMCategoryBinding&gt;&gt;verifyMatchWith:notifying:thenDoing:</div>
    <div>KMDispatcher&gt;&gt;dispatch: in Block: [ :aTarget | ...</div>
    <div>OrderedCollection&gt;&gt;do:</div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div>Plese refer to the above stack.</div>
    <div><br>
    </div>
    <div>Thanks in advance.</div>
    <div><br>
    </div>
    <div>thushar</div>
    </font></div>
    </div>
    <div class="gmail_extra"><br>
    <br>
    <div class="gmail_quote">On Mon, May 5, 2014 at 6:28 PM, Ben Coman <span dir="ltr">&lt;<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>&gt;</span>
wrote:<br>
    <blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
      <div>
      <div>Thushar G R wrote:<br>
      <blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">Hi,<br>
        <br>
I am getting an error while doing this.<br>
        <br>
a := XMLOrderedList new.<br>
a add:&#39;1&#39;.<br>
a , XMLOrderedList new.<br>
        <br>
Thanks,<br>
        <br>
Thushar<br>
      </blockquote>
      </div>
      </div>
I could give you &quot;an answer&quot; ;) - but it would be what you wanted.  It
would help if you told what the error was, where it occurs (which of
the three lines), and what you expect each line is doing (especially
the third line).<br>
      <br>
Also I don&#39;t see XMLOrderedList in the default Pharo image, so it would
help if you describe where you got that from and how you installed it.<br>
      <br>
cheers -ben<br>
      <br>
    </blockquote>
    </div>
    <br>
    </div>
  </blockquote>
  <br>
</blockquote>
<br>
</div>


<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>