# Odd stack error

**URL:** <https://www.ruby-forum.com/t/odd-stack-error/131948>\
**Category:** Ruby\
**Created:** [March 14, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/odd-stack-error/131948 "2008-03-14T17:10:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 14, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/odd-stack-error/131948/1 "2008-03-14T17:10:17Z")

</div>

Anybody have any ideas as to what might be going on here? It yields a  
stack level too deep exception after like 15 method calls. Note that I  
do have one function call that is

large\_hash\_like\_20000\_members.each{|key, value| …}

Is that all going on the stack as an array, maybe?  
This is on OS X.  
Thanks!  
-R

exceptionstack level too deepSystemStackError: stack level too deep  
from  
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:1983:in  
`==' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1983:in`===’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:1983:in  
`convert_number_column_value' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1973:in`write\_attribute’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/attribute\_methods.rb:67:in  
`attribute=' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1855:in` **send** ’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:1855:in  
`method_missing' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1672:in`send’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:1672:in  
`attributes=' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1671:in`each’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:1671:in  
`attributes=' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1505:in`initialize\_without\_callbacks’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/callbacks.rb:225:in  
`initialize' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:449:in`new’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:449:in  
`create' from ./db/add_single_zips.rb:3918 from ./db/add_single_zips.rb:3908:in`each\_line’  
from ./db/add\_single\_zips.rb:3908  
from ./db/add\_single\_zips.rb:3888:in `each_line' from ./db/add_single_zips.rb:3888 from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:493:in`load’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:493:in  
`load' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:345:in`new\_constants\_in’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:493:in  
`load’  
from (irb):9\>\>

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 14, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/odd-stack-error/131948/2 "2008-03-14T17:54:22Z")

</div>

Roger P. wrote:

> Note that I  
> do have one function call that is
> 
> large\_hash\_like\_20000\_members.each{|key, value| …}
> 
> Is that all going on the stack as an array, maybe?  
> This is on OS X.  
> Thanks!

This works fine for me on OS X and ruby 1.8.2:

def test

h = Hash.new  
1.upto(100\_000) do |i|  
h[i] = i  
end

puts h[100\_000]

h.each do |key, val|  
puts key, val  
end

end

test
