jemallocator icon indicating copy to clipboard operation
jemallocator copied to clipboard

jemalloc 5.1 causes memory corruption with the `max_background_threads` option.

Open awused opened this issue 2 years ago • 0 comments

I'm reporting this even though the crate is unmaintained because it ended up wasting a lot of my own time. 5.2 and 5.2.1 have some fixes for max_background_threads specifically and memory corruption in general. Switching to https://crates.io/crates/tikv-jemallocator appears to have resolved them since it has updated to 5.2.1.

Using this crate and _RJEM_MALLOC_CONF=abort_conf:true,background_thread:true,max_background_threads:1 I was able to corrupt memory in rayon: this line panicked, but only once by luck and I've not been able to reproduce it. More commonly my application just crashed with various errors.

The most common crash is tpp.c:84: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)' failed. and the second most common is a more generic illegal hardware instruction that I haven't bothered to dig deeply into.

awused avatar Jan 11 '22 07:01 awused