[gclist] What to say about GC.

Giuliano Carlini giuliano@ix.netcom.com
Tue, 30 Jul 1996 10:21:11 -0700


Roy Ward wrote:
> I suppose that I could turn this into a question, and ask
> "What techniques have people found useful in GC debugging,
> as some of the usual methods don't work well?"

There following are the three main errors I've dealt
with in my GC:
	1) A block is not marked when it should be
	2) A block is marked when it should not be
	3) Internal bookkeeping data is stomped on
The first two I deal with by logging all actions when
marking. It's easy to spot a mistaken mark. It takes
a little longer to find out why a pointer is missed
causing a block not to be marked.

The third I don't handle yet, but I've got an idea for
attacking it. Segregate all bookkeeping data onto pages
used only by the GC. Write protect those pages. On entry
to a memory manager function, unprotect the bookkeeping
pages, and on exit reprotect.

Another difficulty is the non repeatability of some
failures. So, I've got flags that make the GC function
repeatably. When I have an intermittent problem, I
enable these flags, and run tests until I induce the
error. Then I can repeat the test case until I find the
bug.

Of course, I still get the occasional bug that beats
all of the above. Then life is tough for a few days.
But, it is much easier than the bugs in other classes
of software: OS's, compilers, etc.

g