From: Peter Zotov Date: 2009-03-25T06:26:33+09:00 Subject: Re: Strange bug in irb1.9 Quoting "Dmitry Severin" : > Peter, this is bug in your code, not ext lib or ruby-1.9 > > Actually, your problem is that in your code (rconfig.c) you create > some intermediate objects that *can* be garbage collected in IRB > session (and *will be* under some conditions, as crash.rb shows): > > [skipped] > > as these values are never references from other objects, they die in > GC, receive junk data, and lead to crash: > Thanks, fixed everything. Added these arrays as constants. > 2) just curious, why C extension, and not FFI, as you use quite a > bunch of Ruby methods and few libconfig structs/calls? (see > http://kenai.com/projects/ruby-ffi ) Libconfig is a bit Cxx-specific, so I decided to make binding behaviour more rubyish, for example added value caching to allow creation of unattached nodes or deletion of existing (how can I force destroying of Ruby object? :). Also, as I seen, FFI doesn't work on Windows, and that isn't good for me. If anyone is interested, you can view my final version in repository at http://git.whitequark.ru/libconfig-ruby.git -- WBR, Peter Zotov