[squeak-dev] [BUG] in VM perform primitive

Igor Stasenko siguctua at gmail.com
Tue May 18 21:30:06 UTC 2010


Hello,

i just discovered a serious bug,  which prevents from performing a
methods which having many args
(but not too many for compiler and run normally).

The problem is, that VM tries to using the currently active context to push
all of the arguments on it, and then just do normal send.
But a sender context may be not big enough (small frame) to accomodate
all pushed values.

In the attachment you can find that running any of

PerformTest new doPerformXX

leads to primitive failure.


I think that we could fix that at the image side,
by telling the compiler to always use a big stack frame for following method:

Object>>perform: selector withArguments: argArray
	"Send the selector, aSymbol, to the receiver with arguments in argArray.
	Fail if the number of arguments expected by the selector
	does not match the size of argArray.
	Primitive. Optional. See Object documentation whatIsAPrimitive."

	<primitive: 84>
	^ self perform: selector withArguments: argArray inSuperclass: self class


so, when prim 84 fails, it will activate this method
and then, there should be enough space to push all method's arguments.

-- 
Best regards,
Igor Stasenko AKA sig.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PerformTest.st
Type: application/octet-stream
Size: 1400 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100519/f4185e86/PerformTest.obj


More information about the Squeak-dev mailing list