From: Brian Candler Date: 2009-02-16T06:39:02+09:00 Subject: Re: Got SystemStackError exception: stack level too deep Bezan Kapadia wrote: > 2) Just a Side Note - Am trying to run this background child process for > days / may be even weeks something like a cron job that sleeps , wakes > up, polls the status and goes to sleep. > > Is it robust way to Run a detached child process in the background for > weeks ...? Yes, I have written systems like that. They have been robust enough not to need any sort of supervisor. (If you do want to use a supervisor, something like 'monit' should do the job) > 3) Ok I have got hold of my backtrace if you folks want to take closer > look... > > I, [06:12:05#22059] INFO -- : Sleeping for 2 Minutes > I, [06:13:05#22059] INFO -- : Finished Sleeping for 2 Minutes > E, [06:13:05#22059] ERROR -- : In MES_monitor check_for_running_jobs : > Got SystemStackError exception: stack level too deep > E, [06:13:05#22059] ERROR -- : > /usr/pkgs/ruby/1.8.5-p12/lib/ruby/1.8/monitor.rb:273:in > `mon_check_owner' > /usr/pkgs/ruby/1.8.5-p12/lib/ruby/1.8/monitor.rb:220:in `mon_exit' > /usr/pkgs/ruby/1.8.5-p12/lib/ruby/1.8/monitor.rb:240:in `synchronize' > /usr/pkgs/ruby/1.8.5-p12/lib/ruby/1.8/logger.rb:496:in `write' > /usr/pkgs/ruby/1.8.5-p12/lib/ruby/1.8/logger.rb:326:in `add' > /usr/pkgs/ruby/1.8.5-p12/lib/ruby/1.8/logger.rb:374:in `info' Two things strike me from this: 1. You're using a rather old version of Ruby 2. You're using thread primitives (monitor / synchronize) and there are known problems with them in older versions of Ruby. I'd strongly suggest you upgrade to ruby-1.8.6p287. (Or you could try 1.8.6p114, but I'm not sure if all the thread issues were resolved by then). As an alternative, there's a separate library called "fastthread" which you could try installing under your old version of Ruby. http://groups.google.com/group/ruby-talk-google/browse_thread/thread/7933e7e987dad1c3 But I'd strongly recommend going 1.8.6 instead. Regards, Brian. -- Posted via http://www.ruby-forum.com/.