Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9001319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:25:14+00:00 2026-06-16T00:25:14+00:00

EDIT : (SOLVED) actually it probably was raised BECAUSE OF an infinite loop I

  • 0

EDIT : (SOLVED) actually it probably was raised BECAUSE OF an infinite loop

I was coding and after adding a method I got this :

user_name@the_computer:/media/ECC3-C3B0/Prog/mts/src/mts$ rake test --trace
** Invoke test (first_time)
** Execute test
/home/user_name/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36: stack level too deep (SystemStackError)
rake aborted!
Command failed with status (1): [/home/user_name/.rvm/rubies/ruby-1.9.3-p19...]
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:82:in `ruby'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/testtask.rb:99:in `block (2 levels) in define'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:60:in `verbose'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/testtask.rb:98:in `block in define'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/user_name/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/home/user_name/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
/home/user_name/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/home/user_name/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => test

I’m pretty sure there is no infinite recursive loop involved.

The code is for now somehow gemified, but I also got the error running the ruby file directly.

Thank you for any help on how to (get some information to, run some tests to) fix the problem, if possible without having to rewrite the whole thing…

Environment :

  • ruby 1.9.3p194 / rails 3.2.8, installed via rvm
  • the program at this stage only uses rails string inflexions functions
  • OS : linux kubuntu i386
  • memory 4GO
  • ‘ulimit -s’ : 8192 (stack size in kB)

What I tried unsuccessfully :

  • removed the chunk of code where the exception was initially raised, but it was still raised a tiny bit later at runtime
  • set stack size with command line ‘ulimit -s 20000’, ‘ulimit -s unlimited’. Same error, apparently at the same place (which makes me think the stack size wasn’t actually changed)
  • downgraded to ruby1.9.2 / rails3.1.3, got the same message
  • same error under Windows

Application context :

I’m writing an application that heavily uses ruby mixins.

Besides I created a bunch of classes that generate mixins (instance / class methods modules to be included by other classes).

So all in all I end up with quite a bit of generated named modules with some custom generated code, and classes with many ancestors.

But that should eventually save me quite a bit of pain in the as$ when I write the program that sits on top of this lib (that’s the plan anyway).

Resources I used :

  • How to increase stack size for a ruby app. Recursive app getting: Stack level too deep (SystemStackError)
  • http://dalibornasevic.com/posts/5-ruby-stack-level-too-deep-systemstackerror

EDIT : Until some code is available for the showing/testing, let’s abstract my question down to this one : Are there other cases that raise stack level too deep exception, besides the classical program-execution-tree-is-too-deep scenario (crossing fingers it’s clear and means something…) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:25:15+00:00Added an answer on June 16, 2026 at 12:25 am

    Are there other cases that raise stack level too deep exception, besides the classical program-execution-tree-is-too-deep scenario?

    Yes. Since the stack is not measured in depth, but in bytes, anything stored on the stack will fill it up sooner:

    def recurse(depth=0)
      recurse depth+1
    rescue SystemStackError
      depth
    end
    => nil
    recurse
    => 8717
    
    def recurse(depth=0)
      a,b,c = 1,2,3
      recurse depth+1
    rescue SystemStackError
      depth
    end
    => nil
    recurse
    => 7264
    
    def recurse(depth=0)
      a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z = *(0..25)
      recurse depth+1
    rescue SystemStackError
      depth
    end
    => nil
    recurse
    => 3187
    

    In this example, a function with only one variable can go several thousand calls deep before failing, and adding three more variables does very little; but adding 26 more variables balloons the stack size to a point where only around 3000 levels are available.

    This will, of course depend somewhat on the ruby implementation, and the system it’s running on. But I believe it will always hold as a general rule.

    However, I still think recursion is likely your problem, since the number of variables required to have this happen at small call chain lengths is immense.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[EDIT] I actually solved this adding the following line to my activity manifest: android:configChanges=orientation|keyboardHidden
EDIT: solved, look below for my solution. first of all, this is my very
EDIT: solved it, turns out I should use %c not %s because foodSelect and
Answer solved in edit below I had this piece of code Dictionary<Merchant, int> remaingCards
edit This question is solved! Having something weird. I'm using html { font-size: 100%
EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone
EDIT: While the original problem is solved, the code fails to actually do anything.
edit* I'm dumb... Thanks for helping me this question is solved. * In my
Edit : Solved, there was a trigger with a loop on the table (read
Edit: [Solved] : It seems that the getTableCellRendererComponent of the CustomTableCellRenderer is called every

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.