Error in SortedCollection do:

Andrew P. Black black at cs.pdx.edu
Fri Feb 16 00:10:29 UTC 2007


I'm making a wild guess here, Ron:  are you ABSOLUTELY sure that your  
sortblock represents an ordering relation, that is, for EVERY pair of  
values a and b,  ((sortBlock value: a value: b)  AND  (sortBlock  
value: b value: a)) implies a = b?   If this is not the case, the  
sort will very likely run off the end of the legitimate values in the  
array, and into the nils.

	Andrew


On 12 Feb 2007, at 08:09, Ron Teitelbaum wrote:

> Hi all,
>
> I just ran into an error and was wondering if anyone has ever seen  
> this
> before.  I have a sorted collection with a computationally  
> intensive sorting
> block.
>
> It blew up on a nil.  Low res jpg attached.
>
> It appears to have worked for the first 12 items:
> 	newCollection in SortedCollection>>collect: has 12 items in it.
>
> The 13th item returned a nil.  This is because array on the sorted
> collection starts with 16 nils.  firstIndex is set to 17.
>
> Notice on the jpg it says firstIndex = 17 but index is 13.  So I  
> can only
> conclude that since index is 13 and 12 other objects were processed
> successfully that the array and first index changed during processing.
>
> I am not sure that I can reproduce this error.  I've been running  
> the same
> code for quite a while without seeing it.  If I can I will post it.
>
> Has anyone seen this before or does anyone know why this may have  
> happened?
>
> Thanks for your help!
>
> Ron Teitelbaum
> Ron at USMedRec.com
>
> http://bugs.impara.de/view.php?id=6030
> <SortedCollectionError.jpg>
>




More information about the Squeak-dev mailing list