It's been nearly a week since my last post, and not a lot has changed. chromatic suggested an idea that I had kicked around a while back, but rejected because of the sheer expense. His idea was to call contained_in_pool in my sweep function, to ensure we were actually sweeping objects. I did end up implementing it though, if only as a temporary measure.
Almost immediately I identified a problem with the sweep code, it was attempting to sweep one more object per arena then there were. I fixed the bounds conditions and fixed a segfault I've been having.
However, it brought me back to a problem I was having previously, where a class PMC was apparently being collected early. We could tell it has been through the collector because all it's pointers were 0xdeadbeef. So I added a few diagnostics messages into src/vtables.c:mark_vtables to print out the addresses of the class PMCs are they are marked. The funny thing is that the particular class PMC I'm having troubles with is never being marked in the first place.
What I think is happening with my collector is that the vtables are being marked at the very beginning of the run. I think a new vtable is being created after the vtables have been marked, but after the call to mark_vtables. However, what really makes this a puzzle is that the class PMCs are created constant, and I never sweep the contstant PMC pool. This makes me think that maybe, somewhere, a vtable is being created and initialized with a class PMC that isn't constant. I haven't figured out yet where such a thing could be happening, but I'm looking hard.
I really do think that we're getting to the end of the troubles. At least, I hope we are. The google summer of code is ending soonish, but I say to damn the torpedos and full speed ahead! I'm going to get this GC working if it takes me another year.