[Vm-dev] Array new: SmallInteger maxVal

John M McIntosh johnmci at smalltalkconsulting.com
Wed Oct 7 21:09:32 UTC 2009


It's a issue of what is insane, plus adding boundary checks everywhere  
that is rarely needed.

The correct response for the issue is to throw a out of memory  
exception when the VM figures out it
can't allocate the 4GB of memory here.

I a quick check shows the primitive fails, then the image side  
primitive failure code does the wrong thing...

In this case I get a MethodContext claiming to be  
"RunArray>>copyFrom:to:"
which if you attempt to work further with, causes problems.

On 2009-10-07, at 1:37 PM, Michael van der Gulik wrote:

>
>
> On Wed, Oct 7, 2009 at 9:17 PM, Torsten Bergmann <astares at gmx.de>  
> wrote:
>
> VisualWorks throws an exception "Size exceeds implementation limit  
> of 2^28 elements".
>
> Pharo and Squeak also crash the VM when you evaluate:
>
>   (Array new: SmallInteger maxVal) last
>
> What is interesting is that when you doIt in Squeak trunk:
>
> (Array new: SmallInteger maxVal) last
>
> nothing happens, but VM crashes when you printIt
>
> In Pharo VM already crashes when you just doIt.
>
> It crashes in both when you inspectIt.
>
>
> ...should this be fixed in the image or the VM?
>
> Is it the responsibility of the image to make sure that the VM isn't  
> passed insane values, or is the responsibility of the VM to not  
> crash when the image asks for insane values.
>
> Gulik.
>
>
>
> -- 
> http://gulik.pbwiki.com/

--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:   
squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================






More information about the Vm-dev mailing list