#706 √ invalid
coren

Console loading is broken on recursive module

Reported by coren | July 25th, 2008 @ 04:25 PM | in 2.x

Hi,

It seems the console loader was somehow broken on some modules. When launching console, the error line :

/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/console_with_helpers.rb:8:in `include_all_modules_from':SystemStackError: stack level too deep

is displayed. The console is launched, but the error is ugly.

I have investigated it and found the bug. The console loader can be confused when a module include its parent, like GetText does for Rails. There's something like this in it :

module GetText
module Rails
include GetText
//...
end
end

The fix is simple and attached to this ticket. I have tried to follow the guidelines about git patch submission.

Would you please review and integrate it ?

Regards,

Comments and changes to this ticket

  • Ramon Salvadó
  • Tristan Leo
  • Pratik

    Pratik August 22nd, 2008 @ 02:53 AM

    • → State changed from “new” to “invalid”
    • → Assigned user changed from “” to “Pratik”

    I'm not able to reproduce this. Could you please add steps to reproduce on a new rails app ?

    Thanks.

  • coren

    coren August 22nd, 2008 @ 09:08 AM

    Hi,

    Here is a sample step to reproduce : 1. make a rails app rails test 2. Install gem gettext sudo gem install gettext 3. Add it to your new app, in config/environment.rb : config.gem "gettext", :lib => "gettext/rails" 4. Install gettext_localize plugin script/plugin install svn://rubyforge.org/var/svn/gettextlocalize/trunk/gettext_localize 5. Launch the console ./script/console 6. you will see the ugly error this issue & the fix is about : "/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/console_with_helpers.rb:5:in include_all_modules_from':SystemStackError: stack level too deep "

  • coren

    coren August 22nd, 2008 @ 09:11 AM

    Hi,

    Another try where I hope to have a good formatting (there's no preview and no way to edit comments :/):

    Here is a sample step to reproduce : 1. make a rails app 1. * rails test 2. Install gem gettext 2. * sudo gem install gettext 3. Add it to your new app, in config/environment.rb : 3. * config.gem "gettext", :lib => "gettext/rails" 4. Install gettext_localize plugin 4. * script/plugin install svn://rubyforge.org/var/svn/gettextlocalize/trunk/gettext_localize 5. Launch the console 5. * ./script/console 6. you will see the ugly error this issue & the fix is about : 6. * "/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/console_with_helpers.rb:5:in include_all_modules_from':SystemStackError: stack level too deep "

  • coren

    coren August 22nd, 2008 @ 09:14 AM

    Hi,

    Last try :

    Here is a sample step to reproduce :

    
    1. make a rails app
    > rails test
    2. Install gem gettext
    > sudo gem install gettext
    3. Add it to your new app, in config/environment.rb :
    > config.gem "gettext", :lib => "gettext/rails"
    4. Install gettext_localize plugin
    >  script/plugin install svn://rubyforge.org/var/svn/gettextlocalize/trunk/gettext_localize
    5. Launch the console
    >  ./script/console
    6. you will see the ugly error this issue & the fix is about :
    > "/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/console_with_helpers.rb:5:in include_all_modules_from':SystemStackError: stack level too deep "
    
  • coren

    coren August 22nd, 2008 @ 09:16 AM

    It seems I've managed to have something working.

    -> Pratik: Would you please test try the steps and update this issue accordingly ?

    Thanks,

  • Jorge Calás

    Jorge Calás August 22nd, 2008 @ 01:01 PM

    I have the same problem.

  • Eduardo

    Eduardo September 21st, 2008 @ 05:02 PM

    • → Tag changed from “bug helper patch railties” to “bug helper patch railties”

    Same thing here. Anybody knows how to make the bug valid again? I guess nobody will be following an invalid bug.

  • coren

    coren September 22nd, 2008 @ 12:51 PM

    I am the author of the bug, but I cannot change it to valid again :/. Maybe I should open a new one ?

  • Eduardo

    Eduardo September 22nd, 2008 @ 01:19 PM

    Yes, good idea. You can mention the original bug and the inability to make it valid again. Please post here the new bug number for the other people with the same problem. And thanks for the original report!

    By the way, I think that even without changing environment.rb you get the error. I had to move the whole plugin out of the way to be able to use the console.

  • coren

    coren September 24th, 2008 @ 03:40 PM

    Hi, The new bug is #1103. You can comment and see what's happening on this new issue. You can consider this one as closed.

    Regards,

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Source available from github

Repository is at http://github.com/rails/rails

Check out the development master (Edge Rails):

git clone git://github.com/rails/rails.git

Creating or reviewing a patch

See the contributor guide.

Creating a feature request

Please don't. If you want a new feature in Rails, you'll have to pull up your sleeves and get busy yourself. Or convince someone else to do it. See the contributor guide on how to get going. But posting them here is just going to lead to ticket root.

Creating a bug report

When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.

Security vulnerabilities should be reported via an email to security@rubyonrails.org, do not use trac for reporting security vulnerabilities. All content in trac is publicly available as soon as it is posted.

Then don't get your hopes up. Unless you have a "Code Red, Mission Critical, The World is Coming to an End" kinda bug, you're creating this ticket in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the ticket automatically will see any activity or that others will jump to fix it. Creating a ticket like this is mostly to help yourself start on the path of fixing the problem and for others to sign on to with a "I'm having this problem too"..

Shared Ticket Bins

Attachments