Project

General

Profile

Actions

Bug #5719

closed

Hash::[] can't handle 100000+ args

Added by qrush (Nick Quaranto) almost 13 years ago. Updated almost 8 years ago.

Status:
Closed
Target version:
[ruby-core:41511]

Description

I couldn't pin down an exact size for when/how this occurs, but I have code that was creating hashes just fine with Hash::[] with 300k+ arguments.

irb(main):056:0> (0...140000).map { |n| [:a, n] }.tap { |a| Hash[*a] }.size
SystemStackError: stack level too deep
from /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/irb/workspace.rb:80
Maybe IRB bug!
irb(main):057:0> (0...130000).map { |n| [:a, n] }.tap { |a| Hash[*a] }.size
=> 130000


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #4040: SystemStackError with Hash[*a] for Large _a_Closedko1 (Koichi Sasada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0