Related articles |
---|
[17 earlier articles] |
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22) |
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22) |
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-25) |
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-27) |
Re: how to generate code for (a,b):=(b,a) fjh@murlibobo.cs.mu.OZ.AU (1997-05-30) |
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-30) |
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-06-11) |
conservative GC (was Re: how to generate code for (a,b):=(b,a)) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-06-13) |
From: | Dave Lloyd <Dave@occl-cam.demon.co.uk> |
Newsgroups: | comp.compilers |
Date: | 11 Jun 1997 00:05:26 -0400 |
Organization: | Compilers Central |
References: | 97-05-058 97-05-129 97-05-148 97-05-262 97-05-272 97-05-300 97-05-312 |
Keywords: | storage, C, GC |
Fergus Henderson <fjh@murlibobo.cs.mu.OZ.AU> wrote:
> > While a conservative GC works in a similar way to mark-and-sweep,
> > you do not have a guaranteed set of top-level pointers as you do in
> > Lisp, Algol, Fortran.
>
> Sure you do. This guaranteed set of roots consists (normally) of the
> registers, the stack, and the global data. Of course, each element of
> this set is not guaranteed to be a pointer, but that's why you call it
> "conservative".
Oh no! C programs under Windows can, and indeed are recommended to,
hide pointers to data structures in the operating system (this is
bound with the window handle and is not visible in user address
space). Indeed C programs can hide pointers anywhere and get away
with it - I came across some code once that wrote blocks of memory
holding pointers to disk and read them back in later (a simple manual
VM subsequently abused to be a persistent store). You just can't do
this in type secure programs, so no guarantees that you have all
pointers and as we have also seen there are no guarantees that your
pointers haven't been munged some way (another devious trick is to
take advantage of 'spare bits' in the address space to blend in some
flags with pointers).
Conservative GCs are a good stopgap, but don't confuse them for the real
thing with real security.
Regards,
----------------------------------------------------------------------
Dave Lloyd mailto:Dave@occl-cam.demon.co.uk
Oxford and Cambridge Compilers Ltd http://www.occl-cam.demon.co.uk/
Cambridge, England http://www.chaos.org.uk/~dave/
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.