> Anyone got ideas on what could cause the following error message; > /usr/local/lib/ruby/site_ruby/1.6/feldt/ai/ml/Predictions.rb:40: [BUG] > rb_gc_mark(): unknown data type 0x18(0x6107c128) non object > > Predictions is a sub-class of NArray so it's TYPE should probably be > DATA. Line 40 reads: > @sub_predictions_hash[sub_predictions.predictor_id] = sub_predictions Haven't used NArray, so can't say anything for that. > but I'm unsure how rb_gc_mark is used. Do you know: > > * What "actions" can cause rb_gc_mark to be called? Potentially every time an object gets allocated mark&sweep-procedure will be activated. > * Is rb_gc_mark called as part of the gc itself (my guess is not) or > called when objects are marked for gc (my guess)? It's called as a part of the mark&sweep-procedure, as the name says :). It's called when GCing is going on, and after that the sweep will go though the object space. By marking objects seen from "root" or it's "children", the unreferenced objects are found, and sweep is able to free the memory allocated by them. > * If the latter then is the scenario likely that it's the object > that is "overwritten" by sub_predictions that is the faulty object? > * Any known ways that an object can get an invalid type? I'm sorry I can't help you more here as Ruby internals are quite unknown territory for me. - Aleksi