[Vm-dev] mantis http://bugs.squeak.org/view.php?id=7349

David T. Lewis lewis at mail.msen.com
Wed May 6 11:49:36 UTC 2009


On Wed, May 06, 2009 at 12:34:27PM +0200, Bert Freudenberg wrote:
> 
> On 06.05.2009, at 02:36, David T. Lewis wrote:
> >
> >Yes there are sure to be more unbalanced stack bugs, and yes  
> >somebody should
> >probably check all the plugin code. Most likely nobody will get  
> >around to doing
> >that but no worries, the stack VM seems to do an excellent job of  
> >finding
> >these bugs :)
> 
> 
> How costly would it be to always do this:
> 
> 	interpreterProxy pop: interpreterProxy methodArgumentCount + 1  
> thenPush: result
> 
> or
> 
> 	interpreterProxy pop: interpreterProxy methodArgumentCount
> 
> to return self?

The main concern seems to be existing bugs in the code base that are
just now being exposed. I don't know of any easy way out; as far as
I know you have to either inspect the code manually, or wait for it
to fail at run time.

Note, it is common in many plugins to pop things off the stack early
in the method, so you cannot just patch the last line of the method.
You need to check senders to determine the expected argument count,
then make sure that the plugin matches this.

SmartSyntaxInterpreterPlugin automates much of this, so it's less
of a concern for plugins that use it. Also, I think that Eliot has
some ideas for making the problem go away entirely.

Dave



More information about the Vm-dev mailing list