[#1611] set_trace_func/Array#fetch error — "Nathaniel Talbott" <nathaniel@...>

I've reduced the error I reported in ruby-talk:84013 to the following code:

17 messages 2003/10/11

SystemStackError in embedding

From: Sentinel <sentinel27@...>
Date: 2003-10-18 22:34:20 UTC
List: ruby-core #1640
Hi, I am just now trying to embed ruby into my apprication
(xpertmud.sf.net if anyone cares)

and I got a little problem:
my apprication loads the ruby interpreter jsut find, and calling up the 
procedures works most of the time.Error in calling timer (6)
But sometimes my funccall jist croaks, and throws up this:

Error in calling timer (6)
class = SystemStackError
message = stack level too deep
backtrace =     from /usr/lib/ruby/1.8/delegate.rb:36

this stack backtrace does not look like a stackoverflow to me...

the code I use to generate this output is this:

void XMRuby::reportError(const QString &function, int err) {
  std::cout << "Error in calling " << function << " (" << err << ")" << 
std::endl;
  VALUE lasterr = rb_gv_get("$!");
  
  // class
  VALUE klass = rb_class_path(CLASS_OF(lasterr));
  std::cout << "class = " << RSTRING(klass)->ptr << std::endl; 
  
  // message
  VALUE message = rb_obj_as_string(lasterr);
  std::cout << "message = " << RSTRING(message)->ptr << std::endl;
  if(!NIL_P(ruby_errinfo)) {
    std::ostringstream o;
    VALUE ary = rb_funcall(ruby_errinfo, rb_intern("backtrace"), 0);
    int c;
    for (c=0; c<RARRAY(ary)->len; c++) {
      o << "\tfrom " << 
	RSTRING(RARRAY(ary)->ptr[c])->ptr << 
	"\n";
    }
    std::cout << "backtrace = " << o.str() << std::endl;
  } else {
    std::cout << "backtrace = Qnil" << std::endl;
  }
}


any pointers to where to look ?


Thanx 

Peter


In This Thread

Prev Next