From: "aktxyz@..." Date: 2007-11-17T05:40:06+09:00 Subject: OpenStruct, OpenObject both seg fault, this does not, anything wrong? Ok, I am using 1.8.6 p110 with rails 1.2.5 and I use alot of OpenStructs. Well, it seg faults pretty regularly: >> 0.upto(100) {|n| member.driver_process_member} > /usr/lib/ruby/1.8/ostruct.rb:75: [BUG] Segmentation fault > ruby 1.8.6 (2007-09-23) [i686-linux] So I tried ruby 1.8.5, same thing. So I tried OpenObject in the facets lib, seg faults in a different place now: >> member = Account.get(6).member;0.upto(100) {|n| member.driver_process_member} /usr/lib/ruby/gems/1.8/gems/facets-2.1.1/lib/more/facets/openobject.rb: 183: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i686-linux] class HashDot < Hash def method_missing(sym, arg=nil) type = sym.to_s[-1,1] key = sym.to_s.sub(/[=?!]$/,'').to_sym if type == "=" self[key] = arg return self[key] else return self[key] end end end So I created this minimalist class that extends hash, and it does not segfault. The questions are: - how to figure out what's wrong with OpenStruct (I am not a gdb guy but could follow instructions) - why is the source for OpenStruct and OpenObject so complicated (compared to HashDot)?