Sascha Ebach
2004-Nov-20 17:06 UTC
Stack level too deep on Cygwin and on Debian / Colinux with 0.5.0 - 0.8.5 Beta gems
Hi,
as it is not possible for me to use a sensible development environment
to start with I have to use emulations. I use Cygwin on windows and also
Colinux. (Colinux is really amazing cause it lets you run actual linux
binaries und Windows.) So here is my problem, which by the way exists
since Rails 0.5.0 I think. It was the reason I tried Colinux in the
first place, cause the error first appeared on Cygwin. So here goes:
1) First the the way how to get there.
$ rails stackleveltest
$ cd stackleveltest
$ ruby script/new_controller Stacktest
# edit app/controllers/stacktest_controller.rb to look like:
-----
require ''abstract_application''
class StacktestController < AbstractApplicationController
helper :stacktest
def test; end
end
-----
edit app/views/stacktest/test.rhtml to look like:
-----
<% check_box "password", "secret" %>
-----
$ ruby public/dispatch.servlet -p 4000 -b debian
$ links http://debian:4000/stacktest/test
gives:
-----
Showing /stacktest/test.rhtml where line #1 raised stack level too deep
Show template trace
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_view/helpers/active_record_helper.rb:123:in
`tag_without_error_wrapping''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_view/helpers/active_record_helper.rb:126:in
`tag_without_error_wrapping''
... (this line repeats several hundred times)
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_view/helpers/active_record_helper.rb:126:in
`tag''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_view/helpers/form_helper.rb:135:in
`to_check_box_tag''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_view/helpers/form_helper.rb:100:in
`check_box''
(erb):1:in `render_template''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_view/base.rb:201:in
`render_template''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_view/base.rb:176:in
`render_file''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:369:in
`render_file''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:351:in
`render_without_layout''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/layout.rb:145:in
`render_without_benchmark''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:22:in
`render''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:22:in
`measure''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:22:in
`render''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:589:in
`perform_action_without_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/filters.rb:236:in
`perform_action_without_benchmark''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:30:in
`perform_action_without_rescue''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:30:in
`measure''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:30:in
`perform_action_without_rescue''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/rescue.rb:68:in
`perform_action''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:265:in
`process''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:243:in
`process''
/usr/lib/ruby/gems/1.8/gems/rails-0.8.5/lib/dispatcher.rb:35:in
`dispatch''
/public/dispatch.rb:10
/public/dispatch.rb:1:in `load''
/public/dispatch.rb:1
-:7
-----
2) Second with a unit test
I am uncertain how to best show this with a unit test. Here is my
attempt, which is to simply process the :test action.
edit file test/functional/stacktest_controller_test.rb to read:
-----
require File.dirname(__FILE__) + ''/../test_helper''
require ''stacktest_controller''
# Re-raise errors caught by the controller.
class StacktestController; def rescue_action(e) raise e end; end
class StacktestControllerTest < Test::Unit::TestCase
def setup
@controller = StacktestController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
def test_test
process :test
#assert_success
#assert_rendered_file ''test''
end
end
-----
$ rake
(in /home/Gul/stackleveltest)
ruby1.8 -Ilib:test -e0
ruby1.8 -Ilib:test -e0 -rtest/functional/stacktest_controller_test
Loaded suite -e
Started
E
Finished in 0.049008 seconds.
1) Error:
test_test(StacktestControllerTest):
ActionView::TemplateError: stack level too deep
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_view/base.rb:182:in
`render_file''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:369:in
`render_file''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:351:in
`render_without_layout''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/layout.rb:145:in
`render_without_benchmark''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:22:in
`render''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:22:in
`measure''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:22:in
`render''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:589:in
`perform_action_without_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/filters.rb:236:in
`perform_action_without_benchmark''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:30:in
`perform_action_without_rescue''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:30:in
`measure''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/benchmarking.rb:30:in
`perform_action_without_rescue''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/rescue.rb:68:in
`perform_action''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:265:in
`process''
/usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/test_process.rb:193:in
`process''
./test/functional/stacktest_controller_test.rb:14:in `test_test''
1 tests, 0 assertions, 0 failures, 1 errors
rake aborted!
Command failed with status (1): [ruby1.8 -Ilib:test -e0
-rtest/functional/stacktest_controller_test]
CONCLUSION
I don''t know if it is my machine or if it has something to do with
Cygwin or Colinux. If anyone happens to have a similiar setup I would be
glad to be confirmed. If there is anything else I can do to help with
this bug, pls let me know.
--
Sascha Ebach (Gul on IRC)
