From: Justin Collins Date: 2011-03-04T20:48:04+09:00 Subject: Re: Splat operator gives an SystemStackError On 03/04/2011 03:40 AM, Gunther Diemant wrote: > Hello, > when I'm running this programm > > a1 = (1..150000).to_a > > def splat_test(*args) > puts args.size > end > > splat_test(*a1) > > I get a SystemStackError exception. > > My setup: > Arch Linux > rvm ruby 1.9.2-p0 (also tried with 1.9.2-p180) > > Can anyone reproduce this behavior or is this a problem with my ruby > install? > > PS: I hope this is the right place to ask this question, if not I'm > sorry. > > Greetings > Gunther > You are trying to pass in 150,000 arguments to a method. Surprisingly, this did work for me on 1.8.7-p302. However, 1.9 has very different internals. This is a complete guess, but it may be trying to push all of those arguments onto the stack, giving the resulting error. -Justin