[BUG][FIX] Integer>>printOn:base: fix prevents VM crash

Stephan Rudlof sr at evolgo.de
Fri May 28 02:17:33 UTC 2004


thank you for the workaround.

David T. Lewis wrote:
> Inspecting the special objects array (Smalltalk specialObjectsArray) has
> the annoying side effect of crashing the VM.
> The offending element of the
> special objects array is

> an uninitialized instance of LargePositiveInteger
> intended for use as a template for fast large integer creation (but not
> actually used in the present Squeak image or VM).

How should this mechanism work?
Note: currently creating a LargeInteger by the VM fills its bytes with
zeroes (see ObjectMemory>>instantiateClass:indexableSize:).

> This change set corrects the problem with a small change to
> Integer>>printOn:base:
> Test case methods are provided to confirm reasonableness of the new
> #printOn:base: method.

> Related note: The VM crash occurs in the LargeIntegers plugin. If the
> plugin is disabled, other errors occur but are contained to image side
> problems that throw up a debugger. This means that some additional
> bounds checking in the LargeInteger plugin would be a good idea.

I'll make it.

> This change set does not address that issue, but it does eliminate
> the symptoms and considerably reduces the likelihood of someone
> accidentally causing a crash during normal Squeak usage.

After fixing the plugin: what do you think about printing 'non
normalized!' or similar added to the digits if this problem occurs then?
Your change would cover a potential problem then (now this is the right
thing, of course).

> This problem was originally reported as:
>   "[BUG] Pathological LargePositiveInteger instance discovered in the wild"

See also my previous mail regarding this topic.


> Dave
> ------------------------------------------------------------------------

Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3

More information about the Squeak-dev mailing list