Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Apr 2012 23:17:03 +0300
From:      Aleksandr Rybalko <ray@dlink.ua>
To:        Jason Evans <jasone@FreeBSD.org>
Cc:        current@freebsd.org
Subject:   Re: <jemalloc>: jemalloc_arena.c:182: Failed assertion: "p[i] == 0"
Message-ID:  <20120428231703.374bc042.ray@dlink.ua>
In-Reply-To: <C8857CA7-44D5-4EB0-A1E2-DE0E0F6A673E@FreeBSD.org>
References:  <20120421185402.GH1743@albert.catwhisker.org> <7AD8956D-AD18-4CAB-9953-06E00185A7DA@freebsd.org> <20120428150941.e0464900.ray@dlink.ua> <C8857CA7-44D5-4EB0-A1E2-DE0E0F6A673E@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 28 Apr 2012 11:29:01 -0700
Jason Evans <jasone@FreeBSD.org> wrote:

> On Apr 28, 2012, at 5:09 AM, Aleksandr Rybalko wrote:
> >>> On Apr 21, 2012, at 11:54 AM, David Wolfskill wrote:
> >>>> 
> >>>> But contrib/jemalloc/src/arena.c contains a function,
> >>>> arena_chunk_validate_zeroed():
> >>>> 
> >>>>   175 static inline void
> >>>>   176 arena_chunk_validate_zeroed(arena_chunk_t *chunk, size_t
> >>>> run_ind) 177 {
> >>>>   178         size_t i;
> >>>>   179         UNUSED size_t *p = (size_t *)((uintptr_t)chunk +
> >>>> (run_ind << LG_PAGE)); 180
> >>>>   181         for (i = 0; i < PAGE / sizeof(size_t); i++)
> >>>>   182                 assert(p[i] == 0);
> >>>>   183 }
> > 
> > maybe it somehow related to low count of free memory, because I see
> > that very frequently on my box. (Atheros AR7242 mips32be with 32M of
> > RAM)
> > 
> > After "#ifdef" of that function body, box behave good (seems) :)
> 
> Yes, arena_chunk_validate_zeroed() (which is debug-only code) has the
> side effect of faulting in untouched pages, so it potentially
> increases physical memory usage.  In practice, this sanity checking
> has saved jemalloc from regressions that would otherwise manifest as
> mysterious application memory corruption (and would have prevented
> even more regressions, had it existed earlier).  You can disable it
> and many other performance-sacrificing debug features by defining
> MALLOC_PRODUCTION in /etc/make.conf.

Yeah, found it. Thank you.

It is possible to hide such debug code under debug macro, so embedded
guys will be more happy about sizes? :) 

Thank you for that big job!

> 
> Jason_______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to
> "freebsd-current-unsubscribe@freebsd.org"


-- 
Aleksandr Rybalko <ray@dlink.ua>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120428231703.374bc042.ray>