This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [v6] malloc: Consistently apply trim_threshold to all heaps [BZ #17195]


On Fri, Feb 20, 2015 at 01:27:47PM +0000, Mel Gorman wrote:
> 2015-02-10  Mel Gorman  <mgorman@suse.de>
> 
>   [BZ #17195]
>   * malloc/arena.c (free): Apply trim threshold to per-thread heaps
>     as well as the main arena.
> ---
>  malloc/arena.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/malloc/arena.c b/malloc/arena.c
> index 886defb074a2..fec339819309 100644
> --- a/malloc/arena.c
> +++ b/malloc/arena.c
> @@ -696,7 +696,7 @@ heap_trim (heap_info *heap, size_t pad)
>      }
>    top_size = chunksize (top_chunk);
>    extra = (top_size - pad - MINSIZE - 1) & ~(pagesz - 1);
> -  if (extra < (long) pagesz)
> +  if ((unsigned long) extra < mp_.trim_threshold)
>      return 0;
>  
>    /* Try to shrink. */

Looks like this exposes some kind of a race.  I ran the testsuite with
this patch and intl/tst-gettext4 and intl/tst-gettext5 fail with a
segfault.  From a quick peek it looks like a malloc trying to tinker
with the part of an arena that has not yet been allocated, i.e. does
not have any permissions.  Can you please look into it?  I can't push
this till that problem is solved.

Thanks,
Siddhesh

Attachment: pgpd7MoHRZgOC.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]