[Gc] security issue with libgc ?

skaller skaller at users.sourceforge.net
Sat Mar 17 20:37:08 PST 2007


On Sat, 2007-03-17 at 22:22 +0100, Christophe Meessen wrote:
> Thank you very much MentalGuy to take the time to answer. Now I start to
> get the picture.

Memory leak isn't the only problem: the gc only works if it can
find ALL the accessible pointers. This means any encoding
is suspicious .. for example an packed structure where a pointer
is simply aligned incorrectly. It also means if you can't
specify ALL the memory regions that might contain pointers,
you're in trouble.

For example if the system holds a pointer, or some library
has a section of static store you don't know about,
or, some library uses a private allocator, eg calls mmap
directly.

So whilst BRD gc algorithm is conservative with respect
to *recognizing* pointers, it fragile with respect to
identifying regions which might contain pointers.

BTW: a simple example of a desirable encoding is a digital
tree such as a Judy Array, which isn't compatible with 
conservative collectors, since it encodes pointer keys
in an unrecognizable way. Strangely my intended use
of them was actually to implement a garbage collector .. :)

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


More information about the Gc mailing list