[Gc] DONT_ADD_BYTE_AT_END and GC_malloc(0) (gc-7.1)

Shiro Kawai shiro at lava.net
Mon May 12 07:12:13 PDT 2008


Oops, sorry, with these patches (including GC_GCJ_SUPPORT case),
I'm still getting SEGV in gctest occasionally, on Ubuntu 8.04/AMD64x2,
although it is less likely than before.

--shiro


From: Shiro Kawai <shiro at lava.net>
Subject: Re: [Gc] DONT_ADD_BYTE_AT_END and GC_malloc(0) (gc-7.1)
Date: Mon, 12 May 2008 03:58:20 -1000 (HST)

> Thanks Hans, but I had a problem with the patch against gc-7.1 tree.
> 
> From: Hans Boehm <Hans.Boehm at hp.com>
> Subject: Re: [Gc] DONT_ADD_BYTE_AT_END and GC_malloc(0) (gc-7.1)
> Date: Sun, 11 May 2008 22:13:53 -0700 (PDT)
> 
> > @@ -291,7 +291,7 @@
> >       ptr_t q;
> >       int j;
> > 
> > -    for (j = 1; j < TINY_FREELISTS; ++j) {
> > +    for (j = 0; j < TINY_FREELISTS; ++j) {
> >         q = p -> ptrfree_freelists[j];
> >         if ((word)q > HBLKSIZE) GC_set_fl_marks(q);
> >         q = p -> normal_freelists[j];
> 
> This caused SEGV for all gc tests.  It seems that gcj_freelists[0]
> shouldn't be marked.  The following, as well as the above patch,
> seems to fix the problem.
> 
> @@ -297,8 +297,10 @@
>        q = p -> normal_freelists[j];
>        if ((word)q > HBLKSIZE) GC_set_fl_marks(q);
>  #     ifdef GC_GCJ_SUPPORT
> +      if (j > 0) {
>          q = p -> gcj_freelists[j];
>          if ((word)q > HBLKSIZE) GC_set_fl_marks(q);
> +      }
>  #     endif /* GC_GCJ_SUPPORT */
>      }
>  }
> 
> > @@ -87,7 +87,7 @@
> >       if (0 != GC_setspecific(GC_thread_key, p)) {
> >   	ABORT("Failed to set thread specific allocation pointers");
> >       }
> > -    for (i = 1; i < TINY_FREELISTS; ++i) {
> > +    for (i = 0; i < TINY_FREELISTS; ++i) {
> >   	p -> ptrfree_freelists[i] = (void *)1;
> >   	p -> normal_freelists[i] = (void *)1;
> >   #	ifdef GC_GCJ_SUPPORT
> 
> OTOH, this doesn't seem necessary, for the size 0 freelists
> are handled just below this for-loop.
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 


More information about the Gc mailing list