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 2a/1][BZ #12486] Remove assert in malloc statistic.


On 10/17/2013 01:33 PM, OndÅej BÃlka wrote:
> A bug https://sourceware.org/bugzilla/show_bug.cgi?id=12486 is nearly
> duplicate of 11087.
> 
> A bugzilla contains patch that adds locking around calculating maxima.
> As these asserts are almost useless for finding memory corruption a
> second possibility is to disable them.
> 
> Comments?
> 
> 	* malloc/malloc.c: remove checks for statistics.
> 
> diff --git a/malloc/malloc.c b/malloc/malloc.c
> index 2938234..1a18c3f 100644
> --- a/malloc/malloc.c
> +++ b/malloc/malloc.c
> @@ -2216,15 +2216,6 @@ static void do_check_malloc_state(mstate av)
>    /* top chunk is OK */
>    check_chunk(av, av->top);
>  
> -  /* sanity checks for statistics */
> -
> -  assert(mp_.n_mmaps <= mp_.max_n_mmaps);
> -
> -  assert((unsigned long)(av->system_mem) <=
> -	 (unsigned long)(av->max_system_mem));
> -
> -  assert((unsigned long)(mp_.mmapped_mem) <=
> -	 (unsigned long)(mp_.max_mmapped_mem));
>  }
>  #endif
>  
> 

I agree that the asserts should be removed.

If we need more asserts later they can be added later
to solve a specific problem.

Adding locking for this is too much for little to no
reward.

Cheers,
Carlos.


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