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

David T. Lewis lewis at mail.msen.com
Wed May 26 23:23:22 UTC 2004


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).

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.
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.

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

Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: EmptyLargeIntegerFix-dtl.cs.gz
Type: application/x-gunzip
Size: 1315 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040526/387447f8/EmptyLargeIntegerFix-dtl.cs.bin


More information about the Squeak-dev mailing list