Re: 'conservative' GC == 'risky' GC (David Keppel)
Tue, 24 May 1994 01:29:36 GMT

          From comp.compilers

Related articles
'conservative' GC == 'risky' GC (1994-05-21)
Re: 'conservative' GC == 'risky' GC (1994-05-22)
Re: 'conservative' GC == 'risky' GC (1994-05-23)
Re: 'conservative' GC == 'risky' GC (1994-05-24)
Re: 'conservative' GC == 'risky' GC (1994-05-25)
Re: 'conservative' GC == 'risky' GC (1994-05-26)
Re: 'conservative' GC == 'risky' GC (1994-05-27)
Re: 'conservative' GC == 'risky' GC (1994-05-27)
Re: 'conservative' GC == 'risky' GC chase@Think.COM (1994-05-26)
Re: 'conservative' GC == 'risky' GC (1994-05-31)
[4 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: (David Keppel)
Keywords: GC
Organization: Computer Science & Engineering, U. of Washington, Seattle
References: 94-05-084
Date: Tue, 24 May 1994 01:29:36 GMT (Henry G. Baker) writes:
>[Dangers of `conservative' garbage collection.]

There have been discussions here about trouble spots with conservative GC,
check the archives. Hans Boehm and David Chase have lobbied for,
basically, a `-gcsafe' option for C/C++/etc. compilers to ensure that
compilers will avoid the sorts of optimizations that Henry mentioned (they
have an interesting list). Boehm and Chase also describe a set of
workarounds for systems that don't support the `-gc' option.

It's also worth noting that even with GC-safe code generation practices it
is still trivial to produce unsafe C programs -- the application can
obscure a pointer e.g. by XORing it, or can store it temporarily on disk
(outside of the default root set) and so on (but writing ANSI C is a good
start). The implication here is that only a subset of all C programs are
GC-safe and, in particular, you should be careful both about your code and
the code you link with.

Despite the caveats, though, I still don't think that conservative
garbage collection is inherently risky. I would say instead that
current compilers and libraries don't support GC, but this could be
fixed. I do agree with Henry that you shouldn't use conservative GC
until you've either fixed the compiler and libraries or you have
acknowledged that using it with existing systems is a source of
possibly obscure bugs.

This is all described in more detail in:

%A Hans-J. Boehm
%A David Chase
%T A Proposal for Garbage-Collector-Safe C Compilation
%J Journal of C Language Translation
%D December 1992
%P 126-141

It's well worth a read.

;-D on ( Automatic sanitation engineering ) Pardo

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.