[squeak-dev] Bug in Method Finder dating from 3.8

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Bug in Method Finder dating from 3.8

Damien Cassou-3
On Thu, Jul 3, 2008 at 9:53 AM, Serge Stinckwich
<[hidden email]> wrote:
> There is a bug with the Method finder tool. Try for example : 1. 1. 2.
> It runs forever ...

Try the same thing in any base Squeak image starting from Squeak 3.8.
It seems you found a long-standing bug.


--
Damien Cassou
Peter von der Ahé: «I'm beginning to see why Gilad wished us good
luck». (http://blogs.sun.com/ahe/entry/override_snafu)

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

SergeStinckwich
Damien Cassou a écrit :
> On Thu, Jul 3, 2008 at 9:53 AM, Serge Stinckwich
> <[hidden email]> wrote:
>> There is a bug with the Method finder tool. Try for example : 1. 1. 2.
>> It runs forever ...
>
> Try the same thing in any base Squeak image starting from Squeak 3.8.
> It seems you found a long-standing bug.
>


I usually show the method finder to Smalltalk beginners. It's the first
time, i see this one ;-)
There is another one. Try : 'abc'. 'ab' and choose the method found to
launch an error.

--
Serge Stinckwich
http://blog.doesnotunderstand.org/


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Bug in Method Finder dating from 3.8

onierstrasz

I found the source of the bug.

1 . 1 . 2

will cause the MethodFinder to try:

1 perform: #printStringBase: withArguments: #(1)

i.e., 1 printStringBase: 1

This generates an infinite loop within Integer>>printStringBase:

Integer>>printStringBase: should be corrected to complain if its  
argument (base) is less than 2.

I tried the obvious "self assert: base > 1.", but the Method Finder  
does not like this since it only catches Errors, not  
AssertionFailures, so the fix is as follows:

Integer>>printStringBase: base
        | stream integer next |
        (base < 2) ifTrue: [Error signal: 'base must be >= 2'].
        ... "rest as before"

I did not find any error in the example 'abc' . 'ab' .

- on

On Jul 3, 2008, at 10:27, Serge Stinckwich wrote:

> Damien Cassou a écrit :
>> On Thu, Jul 3, 2008 at 9:53 AM, Serge Stinckwich
>> <[hidden email]> wrote:
>>> There is a bug with the Method finder tool. Try for example : 1.  
>>> 1. 2.
>>> It runs forever ...
>> Try the same thing in any base Squeak image starting from Squeak 3.8.
>> It seems you found a long-standing bug.
>
>
> I usually show the method finder to Smalltalk beginners. It's the  
> first time, i see this one ;-)
> There is another one. Try : 'abc'. 'ab' and choose the method found  
> to launch an error.
>
> --
> Serge Stinckwich
> http://blog.doesnotunderstand.org/
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Bug in Method Finder dating from 3.8

Damien Cassou-3
In reply to this post by SergeStinckwich
On Thu, Jul 3, 2008 at 10:27 AM, Serge Stinckwich
<[hidden email]> wrote:

> Damien Cassou a écrit :
>>
>> On Thu, Jul 3, 2008 at 9:53 AM, Serge Stinckwich
>> <[hidden email]> wrote:
>>>
>>> There is a bug with the Method finder tool. Try for example : 1. 1. 2.
>>> It runs forever ...
>>
>> Try the same thing in any base Squeak image starting from Squeak 3.8.
>> It seems you found a long-standing bug.
>>
>
>
> I usually show the method finder to Smalltalk beginners. It's the first
> time, i see this one ;-)
> There is another one. Try : 'abc'. 'ab' and choose the method found to
> launch an error.

I think this one is related to 3.10. I told them at least 5 times to
include the existing fix, but nobody did it.


--
Damien Cassou
Peter von der Ahé: «I'm beginning to see why Gilad wished us good
luck». (http://blogs.sun.com/ahe/entry/override_snafu)

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

Nicolas Cellier-3
In reply to this post by onierstrasz
Oscar Nierstrasz <oscar.nierstrasz <at> gmail.com> writes:

>
>
> I found the source of the bug.
>
> 1 . 1 . 2
>
> will cause the MethodFinder to try:
>
> 1 perform: #printStringBase: withArguments: #(1)
>
> i.e., 1 printStringBase: 1
>
> This generates an infinite loop within Integer>>printStringBase:
>

Good find Oscar but already on Mantis, see http://bugs.squeak.org/view.php?id=6724
See also http://bugs.squeak.org/view.php?id=6710 and search MethodFinder on Mantis.

Nicolas







Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

Nicolas Cellier-3
In reply to this post by Damien Cassou-3
Damien Cassou <damien.cassou <at> gmail.com> writes:

>
> >
> > I usually show the method finder to Smalltalk beginners. It's the first
> > time, i see this one
> > There is another one. Try : 'abc'. 'ab' and choose the method found to
> > launch an error.
>
> I think this one is related to 3.10. I told them at least 5 times to
> include the existing fix, but nobody did it.
>

I think Edgar was confused by too many different reports/fixes

http://bugs.squeak.org/view.php?id=5641
http://bugs.squeak.org/view.php?id=6402
http://bugs.squeak.org/view.php?id=6418
http://bugs.squeak.org/view.php?id=6691

Nicolas


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Bug in Method Finder dating from 3.8

Edgar J. De Cleene
In reply to this post by Damien Cassou-3



El 7/3/08 6:30 AM, "Damien Cassou" <[hidden email]> escribió:

> I think this one is related to 3.10. I told at least 5 times to
> include the existing fix, but nobody did it.


them ? whose them ?
Remember me the Mantis bug report, please.

I wish put all relevant fixes and enhancements to 3.10, but Ralph goes and I
was displaced.

Edgar



Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

SergeStinckwich
In reply to this post by onierstrasz
Oscar Nierstrasz a écrit :

>
> I found the source of the bug.
>
> 1 . 1 . 2
>
> will cause the MethodFinder to try:
>
> 1 perform: #printStringBase: withArguments: #(1)
>
> i.e., 1 printStringBase: 1
>
> This generates an infinite loop within Integer>>printStringBase:
>
> Integer>>printStringBase: should be corrected to complain if its
> argument (base) is less than 2.
>
> I tried the obvious "self assert: base > 1.", but the Method Finder does
> not like this since it only catches Errors, not AssertionFailures, so
> the fix is as follows:
>
> Integer>>printStringBase: base
>     | stream integer next |
>     (base < 2) ifTrue: [Error signal: 'base must be >= 2'].
>     ... "rest as before"


Ok, thank you Oscar.
To follow, on the bug trackers :
- for Squeak : http://bugs.squeak.org/view.php?id=7107
- for Pharo : http://code.google.com/p/pharo/issues/detail?id=113

> I did not find any error in the example 'abc' . 'ab' .
>

I have this error with the last image : sq3.10.2-7179dev08.07.1

--
Serge Stinckwich
http://blog.doesnotunderstand.org/


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Bug in Method Finder dating from 3.8

Eliot Miranda-2
In reply to this post by Nicolas Cellier-3
Hi Nicolas,

    there is no patch file on the Mantis page.  Where can I find a patch with an "approved" version stamp, if anywhere?

On Thu, Jul 3, 2008 at 2:54 AM, nicolas cellier <[hidden email]> wrote:
Oscar Nierstrasz <oscar.nierstrasz <at> gmail.com> writes:

>
>
> I found the source of the bug.
>
> 1 . 1 . 2
>
> will cause the MethodFinder to try:
>
> 1 perform: #printStringBase: withArguments: #(1)
>
> i.e., 1 printStringBase: 1
>
> This generates an infinite loop within Integer>>printStringBase:
>

Good find Oscar but already on Mantis, see http://bugs.squeak.org/view.php?id=6724
See also http://bugs.squeak.org/view.php?id=6710 and search MethodFinder on Mantis.

Nicolas










Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

Nicolas Cellier-3
Eliot Miranda a écrit :

> Hi Nicolas,
>
>     there is no patch file on the Mantis page.  Where can I find a patch
> with an "approved" version stamp, if anywhere?
>
> On Thu, Jul 3, 2008 at 2:54 AM, nicolas cellier <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Oscar Nierstrasz <oscar.nierstrasz <at> gmail.com
>     <http://gmail.com>> writes:
>

My "approval" is neither required nor authoritative. Any other opinion
counts.
I suppose Oscar's patch is OK, didn't check because pipermail did scrub
the attachment.

My image does not need such patch because MethodFinder for 1. 1. 2. does
not fail anymore thanks to http://bugs.squeak.org/view.php?id=6887

And for the same price, i have faster integer printString.

Of course, this change should be approved by someone else but me.

Cheers

Nicolas


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Bug in Method Finder dating from 3.8

Eliot Miranda-2


On Thu, Jul 3, 2008 at 12:09 PM, nicolas cellier <[hidden email]> wrote:
Eliot Miranda a écrit :
Hi Nicolas,

   there is no patch file on the Mantis page.  Where can I find a patch with an "approved" version stamp, if anywhere?

On Thu, Jul 3, 2008 at 2:54 AM, nicolas cellier <[hidden email] <mailto:[hidden email]>> wrote:

   Oscar Nierstrasz <oscar.nierstrasz <at> gmail.com
   <http://gmail.com>> writes:


My "approval" is neither required nor authoritative. Any other opinion counts.
I suppose Oscar's patch is OK, didn't check because pipermail did scrub the attachment.

My image does not need such patch because MethodFinder for 1. 1. 2. does not fail anymore thanks to http://bugs.squeak.org/view.php?id=6887

And for the same price, i have faster integer printString.

Of course, this change should be approved by someone else but me.

Cheers

Hi Nicolas,

    I'm asking to avoid the "source same but rev changed" issue.  I don;t want to fix the method myself with my own timestamp.  Isn;t there a place where an original fix can be found with a timestamp we can all use?
 


Nicolas





Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

SergeStinckwich
In reply to this post by Damien Cassou-3
Damien Cassou a écrit :

> On Thu, Jul 3, 2008 at 10:27 AM, Serge Stinckwich
> <[hidden email]> wrote:
>> Damien Cassou a écrit :
>>> On Thu, Jul 3, 2008 at 9:53 AM, Serge Stinckwich
>>> <[hidden email]> wrote:
>>>> There is a bug with the Method finder tool. Try for example : 1. 1. 2.
>>>> It runs forever ...
>>> Try the same thing in any base Squeak image starting from Squeak 3.8.
>>> It seems you found a long-standing bug.
>>>
>>
>> I usually show the method finder to Smalltalk beginners. It's the first
>> time, i see this one ;-)
>> There is another one. Try : 'abc'. 'ab' and choose the method found to
>> launch an error.
>
> I think this one is related to 3.10. I told them at least 5 times to
> include the existing fix, but nobody did it.

Ok and where is the fix, Damien ?

--
Serge Stinckwich
http://blog.doesnotunderstand.org/


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

Nicolas Cellier-3
In reply to this post by Eliot Miranda-2
Eliot Miranda a écrit :
>
>
> Hi Nicolas,
>
>     I'm asking to avoid the "source same but rev changed" issue.  I
> don;t want to fix the method myself with my own timestamp.  Isn;t there
> a place where an original fix can be found with a timestamp we can all use?
>  

My own solution is:

Installer ensureFix: '6887 Faster printString for LargeInteger'.

which is currently equivalent to doing this:

"fix begin"
Installer mantis ensureFix: 6512.
Installer mantis bug: 6887 fix:'Integer-fastPrint-M6887-nice.5.cs'.
"fix test"
Installer mantis bug: 6887 fix:'Integer-fastPrint-test-M6887-nice.1.cs'.
"fix end"

Or see directly http://bugs.squeak.org/view.php?id=6887.

Cheers


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

Nicolas Cellier-3
In reply to this post by SergeStinckwich
Serge Stinckwich a écrit :
> Damien Cassou a écrit :
>>
>> I think this one is related to 3.10. I told them at least 5 times to
>> include the existing fix, but nobody did it.
>
> Ok and where is the fix, Damien ?
>
> --

Serge, are you black listing me?

http://bugs.squeak.org/view.php?id=5641
http://bugs.squeak.org/view.php?id=6402
http://bugs.squeak.org/view.php?id=6418
http://bugs.squeak.org/view.php?id=6691

My image is patched with my own:
      Installer mantis bug: 6691 fix: 'StringVersion-Patch-M6691.2.cs'.

But, maybe Keith did correct other things too...
Since he pushed his own corrections for his own bug, so you should trust
him and try:
     Installer ensureFix: 6402.

Nicolas


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

SergeStinckwich
In reply to this post by Nicolas Cellier-3
nicolas cellier a écrit :

> Oscar Nierstrasz <oscar.nierstrasz <at> gmail.com> writes:
>
>>
>> I found the source of the bug.
>>
>> 1 . 1 . 2
>>
>> will cause the MethodFinder to try:
>>
>> 1 perform: #printStringBase: withArguments: #(1)
>>
>> i.e., 1 printStringBase: 1
>>
>> This generates an infinite loop within Integer>>printStringBase:
>>
>
> Good find Oscar but already on Mantis, see http://bugs.squeak.org/view.php?id=6724
> See also http://bugs.squeak.org/view.php?id=6710 and search MethodFinder on Mantis.


With your patch, Method Finder works but :

1 printStringBase: 1 reply a divide by zero with is a bit strange ...

--
Serge Stinckwich
http://blog.doesnotunderstand.org/


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

Nicolas Cellier-3
Serge Stinckwich a écrit :

> nicolas cellier a écrit :
>>
>> Good find Oscar but already on Mantis, see
>> http://bugs.squeak.org/view.php?id=6724
>> See also http://bugs.squeak.org/view.php?id=6710 and search
>> MethodFinder on Mantis.
>
>
> With your patch, Method Finder works but :
>
> 1 printStringBase: 1 reply a divide by zero with is a bit strange ...
>
> --

Yes, you are right. Oscar answers with a more explicit error message,
which seems better also to me.

I asked to myself whether i should assert preconditions in my code, and
decided not to do so for several reasons.

1) I generally avoid preconditions in Smalltalk but in a few protected
places, because it's like locking the code against future extensions.

2) because the pre-condition is not needed to solve MethodFinder problem

3) because i cannot find a good reason to put a precondition
specifically in this method and not into any other

4) because i can find good reasons to not put preconditions uniformely
in the Kernel: it spoils both efficiency and extensibility - see 1)
(printing numbers in tight loops is not that rare).

5) because in Smalltalk violated preconditions are rarely fatal

6) because the limitation is trivial and any user with decent culture
should find it quickly with the Debugger

7) because even a kid opening the Debugger would maybe have a great
lesson initiated on arithmetic with proper guiding (agree, not by himself)

8) because Oscar preconditions are not enough, he didn't handle this (15
printStringBase: Float pi)... Even if he checks for an Integer, did you
try (100000000000 printStringBase: 123456789). Tell me, where to stop
preconditions?

Of course, on this specific example, maybe i'm just wrong and your
opinion may diverge.
A system made for learners should better have explicit rules.
Feel free to add a precondition in the code, that's what MIT is for!
or just add a comment about base expectations...
I won't change a bit.

Cheers

Nicolas


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

Nicolas Cellier-3
nicolas cellier a écrit :
>
> 8) because Oscar preconditions are not enough, he didn't handle this (15
> printStringBase: Float pi)... Even if he checks for an Integer, did you
> try (100000000000 printStringBase: 123456789). Tell me, where to stop
> preconditions?
>

100000000000 printStringBase: 123456789)

Ah Ah, damnit, I found another infinite loop in my printStringBase: !

I am trapped by my own lessons!

Finally, i will change some bits, thank you Serge!

Nicolas


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Bug in Method Finder dating from 3.8

Nicolas Cellier-3
nicolas cellier a écrit :

>
> 100000000000 printStringBase: 123456789
>
> Ah Ah, damnit, I found another infinite loop in my printStringBase: !
>
> I am trapped by my own lessons!
>
> Finally, i will change some bits, thank you Serge!
>
> Nicolas
>

OK, i updated http://bugs.squeak.org/view.php?id=6887