From: Mathieu Bouchard Date: 2003-04-19T14:17:29+09:00 Subject: Re: problem with rb_rescue2() ? On Sat, 19 Apr 2003, Yukihiro Matsumoto wrote: > |Now I want to ask you how much the ruby internals are resistant to a > |non-VALUE being passed in a VALUE parameter? Especially the GC and such... > |Is that looking for trouble ? (segfault ?) > It's OK to pass non Ruby object pointer casting to VALUE. Ruby's > conservative GC can handle them. > matz. Good. But in the meanwhile I thought about it and figured out I can use Fixnums anyway -- my pointers are 0 mod 4 so i can >>2 them and then pass them to INT2NUM() like I'm doing alot in other parts of my program. But I have to report a problem I have. I'll try to make a summary of the stack: (eval):1: [BUG] rb_gc_mark(): unknown data type 0x20(0xbfffa560) non object ruby 1.8.0 (2003-03-31) [i586-linux] Abandon (core dumped) (gdb) bt #0 0x40352a51 in kill () from /lib/libc.so.6 [...] #5 0x404776fa in rb_gc_mark (ptr=3221202272) at gc.c:513 [...] #13 0x4047834b in rb_gc () at gc.c:1240 #14 0x404769a7 in rb_newobj () at gc.c:323 [...] #19 0x4049da49 in ruby_yylex () at parse.y:3295 [...] #25 0x4045c00e in rb_eval_string ( str=0x400142a0 "[\"ruby #{$!.class}: #{$!}\",*($!.backtrace)]") at eval.c:1382 #26 0x400137f3 in make_error_message () from /home/projects/scite-ruby/scite-ruby.so #27 0x400138a0 in rb_rescue_funcall_3 () from /home/projects/scite-ruby/scite-ruby.so #28 0x40464167 in rb_rescue2 ( b_proc=0x40013804 , data1=3758085209, r_proc=0x40013864 , data2=3758085209) at eval.c:4356 [...] and then the rest are SciTE/Scintilla/GTK functions. I'm also embedding Ruby in other apps and I'm having the same kind of problems, though since it has the "heisenbug" type of behaviour, this bug tends to be latent for long periods of time, be sensitive to small changes to irrelevant portions of code, and tends to disappear while i try to observe it. (e.g. the Valgrind debugger prevents the bug from happening at all!) My perfect nightmare. ________________________________________________________________ Mathieu Bouchard http://artengine.ca/matju