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. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project PerformTest.st (1K) Download Attachment |
Here's a fix, which now allows to run
any of PerformTest new doPerformXX without failure. On 19 May 2010 00:30, Igor Stasenko <[hidden email]> wrote: > 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. > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project perform-framesize.1.cs (1K) Download Attachment |
- added bug entry http://bugs.squeak.org/view.php?id=7534
-- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |