I've been having a problem with pike going into what seems like an infinite loop while exiting. The problem seems to occur with objects from my Objective-C module, and it's something I noticed before, but "solved" by adding a ref so that the objects were never freed. I fixed that problem last night, and now the problem is back.
The backtrace looks like this:
#0 schedule_really_free_object (o=0x1812038) at /Users/hww3/Pike/7.7/ src/object.c:1068
[...]
and if I step through the code, I eventually get back to the same point with the same object, and Pike never exits. Anyone with some internals experience care to venture a guess as to what the problem might be?
I guess that's me...
schedule_really_free_object() gets called when the object reference count reaches zero. If the object hasn't been destructed, it gets added to the objects_to_destruct queue. Otherwise the object is freed. An object can thus arrive at schedule_really_free_object() twice; once before destruct() and once after. If an object arrives at schedule_really_free_object() more times than that, it's a strong hint that there's a missing add_ref() somewhere.
Bill