Skip to content

StackOverflowError overriding Array.each since 1.7.5 #1265

@carlossg

Description

@carlossg

Simplified code taken from fog gem to reproduce the issue. Works on jruby 1.7.4, but not since then

class Collection < Array
  def each
    super
  end
end

Collection.new.all? {|x| true}
puts "OK"
$ rvm jruby-1.7.8 do ruby test.rb
Error: Your application used more stack memory than the safety cap of 2048K.
Specify -J-Xss####k to increase it (#### = cap size in KB).
Specify -w for full StackOverflowError stack trace

$ rvm jruby-1.7.5 do ruby test.rb
Error: Your application used more stack memory than the safety cap of 2048K.
Specify -J-Xss####k to increase it (#### = cap size in KB).
Specify -w for full StackOverflowError stack trace

$ rvm jruby-1.7.4 do ruby test.rb
OK

a section of the stacktrace

at org.jruby.RubyArray.all_p(RubyArray.java:4009)
at org.jruby.RubyEnumerable.all_pCommon(RubyEnumerable.java:1397)
at org.jruby.RubyArray.all_p(RubyArray.java:4009)
at org.jruby.RubyEnumerable.all_pCommon(RubyEnumerable.java:1397)
at org.jruby.RubyArray.all_p(RubyArray.java:4009)
at org.jruby.RubyEnumerable.all_pCommon(RubyEnumerable.java:1397)
at org.jruby.RubyArray.all_p(RubyArray.java:4009)

java "1.7.0_45" OS X Mavericks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions