From: ts Date: 2002-10-01T21:46:49+09:00 Subject: Re: ruby bug in tight loops? (was: Re: Matz, if you're reading, please scan this email) >>>>> "S" == Sean Chittenden writes: S> $ time rubytest -F -i 0 -n xml_parser4 S> =2E/tests/tc_xml_parser4.rb:12: [BUG] Segmentation fault S> ruby 1.7.3 (2002-09-27) [i386-freebsd5] S> Abort (core dumped) Not really convincted that this is a bug in ruby. All core dumped that I've seen actually seems to be all related with one of your objects, for example gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x0809fefe in st_lookup (table=0x2861, key=0x1229
, value=0xbfff6488) at st.c:253 253 hash_val = do_hash(key, table); (gdb) up #1 0x080aa62a in classname (klass=1075359772) at variable.c:153 153 if (ROBJECT(klass)->iv_tbl && (gdb) up #2 0x080aa76a in rb_class_path (klass=1075359772) at variable.c:189 189 VALUE path = classname(klass); (gdb) up #3 0x080aaa51 in rb_class2name (klass=1075359772) at variable.c:288 288 return RSTRING(rb_class_path(klass))->ptr; (gdb) up #4 0x080b65d9 in rb_check_type (x=1075359792, t=34) at error.c:237 237 etype = rb_class2name(CLASS_OF(x)); (gdb) up #5 0x40228c13 in ruby_xml_parser_str_set (self=1075361212, str=1075359812) at ruby_xml_parser.c:716 716 Data_Get_Struct(rxp->ctxt, ruby_xml_parser_context, rxpc); (gdb) Manifestly ruby sometimes try to work with a GC'ed object but why ???? S> 3.027u 0.031s 0:03.12 97.7% 0+0k 0+0io 467pf+0w S> $ time rubytest -i 0 -F -n xml_parser4 S> /usr/lib/ruby/site_ruby/1.7/test/unit/assertions.rb:93: [BUG] Segmentation = S> fault S> ruby 1.7.3 (2002-09-13) [i686-linux] S> Abort (core dumped) Same here, this is this case _wrap_assertion { assert_equal(Class, klass.type, "assert_instance_of takes a Class as its first argument") full_message = build_message(message, object, klass, object.type) { | arg1, arg2, arg3 | this is the call to object#type which give the coredump Guy Decoux