From: "Michael José" Date: 2011-07-14T21:44:06+09:00 Subject: Re: [Ruby/C] Very little piece of code driving me crazy It crashes when trying to access RSTRING(VALUE)->as.heap.ptr. Here is what Ruby outputs during the crash :
: [BUG] Segmentation fault ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux] -- control frame ---------- c:0001 p:0000 s:0002 b:0002 l:000d24 d:000d24 TOP --------------------------- -- C level backtrace information ------------------------------------------- /usr/lib/libruby-1.9.1.so.1.9(rb_vm_bugreport+0x72) [0x5bedf2] /usr/lib/libruby-1.9.1.so.1.9(+0x4d38f) [0x4b838f] /usr/lib/libruby-1.9.1.so.1.9(rb_bug+0x3a) [0x4b842a] /usr/lib/libruby-1.9.1.so.1.9(+0xeda34) [0x558a34] [0x90740c] ./a.out() [0x8048961] /lib/libc.so.6(__libc_start_main+0xe7) [0x126ce7] ./a.out() [0x8048771] [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html I tried using class2name and obj_classname: both of them work fine. -- Posted via http://www.ruby-forum.com/.