odd stack error

R

Roger Pack

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>>
 
7

7stud --

Roger said:
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
end

puts h[100_000]

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

end

test
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top