From: ts Date: 2004-08-29T00:25:03+09:00 Subject: Re: [PATCH] Subtle bug in bignum.c >>>>> "t" == ts writes: t> It's really subtle :-) really, really subtle :-) Breakpoint 4, rb_big_and (x=1074241584, y=1074241584) at bignum.c:1637 1637 y = rb_to_int(y); (gdb) info register ebx ebx 0x4007a030 1074241584 (gdb) printf "0x%x\n", x 0x4007a030 (gdb) the variable `x' is in ebx 1647 get2comp(x, Qtrue); (gdb) info register ebx ebx 0x4007a008 1074241544 (gdb) printf "0x%x\n", x 0x4007a008 (gdb) p *(struct RBignum *)x $8 = {basic = {flags = 13, klass = 1074419244}, sign = 0 '\0', len = 1, digits = 0x8117870} (gdb) it create a new Bignum in rb_big_clone(), `x' is still in ebx 1663 z = bignew(l2, RBIGNUM(x)->sign || RBIGNUM(y)->sign); (gdb) info register ebx ebx 0x8117700 135362304 (gdb) it will call bignew() which will call rb_gc(), but in ebx it has RBIGNUM(x)->digits. This mean that when ruby will mark the registers it will not mark the Bignum created by rb_big_clone() and the GC remove the Bignum created. Guy Decoux