Closed gnufied closed 10 years ago
When I was tinkering with the object graph, I realized that rb_class2name works only if this condition is true, else it segfaults :
if (!NIL_P(klass) && BUILTIN_TYPE(v) != T_NONE && BUILTIN_TYPE(v) != T_ZOMBIE && BUILTIN_TYPE(v) != T_ICLASS)
v
is the object.
interesting. May be we can use this as a stop gap measure until, we start storing object details in hash table along with file and line numbers.
Unfortunately crash is still there. try running a rails app with rbkit and hitting it with "ab" to streess test. The app crashes.
Alright, I'll look into this.
This issue seems to be gone now. Was this related to #15 ?
Currently I think
rb_class2name
can segfault under certain conditions. I think the case in point is, when it is called fromfree_obj_i
function.It seems that certain stack frames and data structures are not safe to be used, when
free_obj_i
hook runs. To that in, builtin ruby object tracer actually stores, class name etc in separate hash table, when object was created, it does not attempt to userb_class2name
during free method calls. I have half implemented that work. We need to ensure that, we do this properly.