The value associated with arenas_tsd is set before the key is created. This can corrupt some other library that is using key 0. Attached is a program that demonstrates the problem and a proposed fix to the problem. We are not experts on jemalloc internals, and we would appreciate any feedback about the fix. <div>
<br></div><div>Run "make check_arena_key" to reproduce the crash.</div><div><br></div><div>See jemalloc.c for the fix.</div>