<span class="Apple-style-span" style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);">there is a race in the jemalloc implementation of huge realloc's. the code mremap's without holding a lock, and then removes the old address from the extent tree. the mremap makes the old address available for mmap, thus allowing another thread to get its hands on the old address before the first thread is done with it.</span><div>
<font class="Apple-style-span" face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif">the attached test program will hit an assert in the red black tree after a while when jemalloc is configured with debug enabled.</font></div>