Hi, On Sun, Feb 05, 2012 at 12:51:25PM +0100, Adriaan de Jong wrote: > Signed-off-by: Adriaan de Jong <[email protected]> > --- > buffer.c | 29 ++++++++++------------------- > 1 files changed, 10 insertions(+), 19 deletions(-) > > diff --git a/buffer.c b/buffer.c > index 2f8e4b8..c39bbcb 100644 > --- a/buffer.c > +++ b/buffer.c > @@ -310,28 +310,19 @@ gc_malloc (size_t size, bool clear, struct gc_arena *a) > #endif > { > void *ret; > - if (a) > - { > - struct gc_entry *e;
NACK on that. We discovered that there are use cases where "second-level"
callers pass NULL, seemingly on purpose to allocate global memory instead
of "in the GC".
main(), in openvpn.c:
/* initialize environmental variable store */
c.es = env_set_create (NULL);
... which calls into misc.c:
struct env_set *
env_set_create (struct gc_arena *gc)
{
struct env_set *es;
ALLOC_OBJ_CLEAR_GC (es, struct env_set, gc);
es->list = NULL;
es->gc = gc;
return es;
}
... and boom, assert() fail.
Adriaan saw the crash ("my nice OpenBSD test run!!!") and promised to work
on this on the way back in the train.
gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]
fax: +49-89-35655025 [email protected]
pgpujUS98Vp2T.pgp
Description: PGP signature
