From: halfdan@... Date: 2011-10-24T21:03:32+09:00 Subject: [ruby-core:40303] Re: BitField extension Great thanks! That really was the problem. I'm now having trouble clone'ing my object though. I'm running into a segfault in my code when I call bitfield.clone. I made my sources available at http://xnorfz.de/stuff/BitField.tar Could it be that ruby doesn't now about the memory allocated by the dynamic_bitset::resize? I've also included a test script that segfaults. Cheers, Fabian On Mon, 24 Oct 2011 00:54:20 +0900, Nobuyoshi Nakada wrote: > Hi, > > (11/10/23 20:58), Fabian Becker wrote: >> I'm trying to build a Ruby extension that wraps boost::dynamic_bitfield. My code compiles perfectly but when instantiating an object of my class ruby segfaults. I haven't been able find the source of the problem as the segfault occurs deep inside the ruby core. Does anyone see anything wrong with my code so far? >> >> Code is at: http://pastebin.com/qLkMGYqq > > You don't call the constructor in BitFieldNew() before calling data.resize(). > Seems working if "new(bf) BitField();" is added.