Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007107 [Squeak] Kernel minor always 07-03-08 11:07 04-18-10 22:05
Reporter SergeStinckwich View Status public  
Assigned To nicolas cellier
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version trunk Product Version 3.10.2
  Product Build
Summary 0007107: 1 printStringBase: 1 generates an infinite loop within Integer>>printStringBase:
Description Integer>>printStringBase: should be corrected to complain if its argument (base) is less than 2. Fix by Oscar include.
Steps To Reproduce
Additional Information
Attached Files  Integer-printStringBase.st [^] (608 bytes) 07-03-08 11:07

- Relationships

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

related to 0006710new  fix for the Method Finder from Ted Kaehler 
related to 0006887closed nicolas cellier Faster printString for LargeInteger 
has duplicate 0006724closed  printStringBase: should be protected against wrong bases 

- Notes
(0012323 - 343 - 385 - 769 - 769 - 769 - 769)
nicolas cellier
07-03-08 15:05

Thank you for the patch Serge, but mind not tri-plicating bug reports.
I warned you two mails above in squeak-dev that bug is already reported
at http://bugs.squeak.org/view.php?id=6724 [^]
and http://bugs.squeak.org/view.php?id=6710 [^]

See also http://bugs.squeak.org/view.php?id=6887 [^] for a more efficient printStringBase: algorithm.

Cheers
 
(0012324 - 599 - 659 - 659 - 745 - 745 - 745)
nicolas cellier
07-03-08 19:30

0006887 is not only more efficient, it fails when feeded with a bad base.

Error Message is not explicit though...
However i find it very boring to assert preconditions.
Why not do it in each and every method ?
1) because we would prevent unknown future extensions to work
2) because we should not spoil efficiency of kernel methods, and printString is a good candidate for tight loop sends.

I would personnally prefer a good comment about base argument prerequisite and a good old Smalltakj-style Debugger session...

So I recommend my personal patch, if of course agreed by the community.
 
(0012332 - 242 - 353 - 353 - 460 - 460 - 460)
matthewf
07-04-08 01:55
edited on: 07-04-08 01:56

From 0006724:

self should: [2 printStringBase: 1] raise: Error.
   "it does infinite loop"

"Found that in methodFinder with 2. 1. 3."


"Funnily, you can even print in non integer base"
(Float pi printStringBase: Float pi). '10.0'.

 
(0012333 - 191 - 197 - 197 - 304 - 304 - 304)
matthewf
07-04-08 01:57

From nicolas cellier, in 0006724:
IMO the patch should be superseded by 0006887 which does not loop infinitely and which offers a much faster printString / printOn: / printStringBase: / etc...
 
(0013326 - 47 - 47 - 47 - 133 - 133 - 133)
nicolas cellier
10-03-09 20:25

This is resolved in trunk by inclusion of 0006887
 

- Issue History
Date Modified Username Field Change
07-03-08 11:07 SergeStinckwich New Issue
07-03-08 11:07 SergeStinckwich File Added: Integer-printStringBase.st
07-03-08 15:05 nicolas cellier Note Added: 0012323
07-03-08 19:30 nicolas cellier Note Added: 0012324
07-04-08 01:47 matthewf Relationship added related to 0006724
07-04-08 01:53 matthewf Relationship added related to 0006704
07-04-08 01:53 matthewf Relationship added related to 0006714
07-04-08 01:53 matthewf Relationship deleted related to 0006704
07-04-08 01:53 matthewf Relationship deleted related to 0006714
07-04-08 01:53 matthewf Relationship added related to 0006710
07-04-08 01:54 matthewf Relationship replaced has duplicate 0006724
07-04-08 01:55 matthewf Note Added: 0012332
07-04-08 01:55 matthewf Note Edited: 0012332
07-04-08 01:56 matthewf Note Edited: 0012332
07-04-08 01:57 matthewf Note Added: 0012333
07-04-08 01:58 matthewf Relationship added related to 0006887
10-03-09 20:25 nicolas cellier Status new => resolved
10-03-09 20:25 nicolas cellier Fixed in Version  => trunk
10-03-09 20:25 nicolas cellier Resolution open => fixed
10-03-09 20:25 nicolas cellier Assigned To  => nicolas cellier
10-03-09 20:25 nicolas cellier Note Added: 0013326
04-18-10 22:05 andreas Status resolved => closed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
87 total queries executed.
48 unique queries executed.
Powered by Mantis Bugtracker