[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conservative GC isn't safe

From: Daniel Colascione
Subject: Conservative GC isn't safe
Date: Sat, 26 Nov 2016 00:11:40 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

I was poking at alloc.c recently and realized that the existing conservative GC code is somewhat unsafe. In particular,

1) mark_maybe_pointer looks only for exact matches on object start. It's perfectly legal for the compiler to keep an interior object pointer and discard the pointer to the object start.

2) INTERVAL is GCed, but it's not represented in the memory tree: struct interval isn't a real lisp object and it's allocated as MEM_TYPE_NON_LISP. Even a direct pointer to the start of an interval won't protect it from GC. Shouldn't we treat intervals like conses?

We've been getting by on dumb luck and the magnanimity of the compiler.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]