From: Danie Roux Date: 2006-02-22T01:54:00+09:00 Subject: Re: GC Bug? Ruby 1.8.4 core dumps on a very small extension On 2/20/06, Ross Bamford wrote: > On Mon, 2006-02-20 at 07:47 +0900, Danie Roux wrote: > > Hi all, > > > > Long (and tiring) story short: > > > > I have an extension that is 40 lines* in total, the C code and Ruby > > code that exercise it. It core dumps, while I repeatedly call a method > > that just returns Qtrue. > > Please try making this change: > - rb_iv_set(self, "@v", 100); > + rb_iv_set(self, "@v", INT2FIX(100)); Ross, Thank you. Moral of the story: Explicitly cast any C value into a Ruby one. It still strikes me odd that it would run a couple of hundred iterations before breaking, though. -- Danie Roux *shuffle* Adore Unix http://blog.acolyte.co.za