New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash on Intel CPUs with FSRM #807
Comments
I've done some testing, and it seems mimalloc v2.0.0 does not suffer from the same issue in an otherwise identical setup. The same FSRM optimizations are present in v2.0.0. |
Possibly related https://news.ycombinator.com/item?id=38266773 -> https://lock.cmpxchg8b.com/reptar.html |
@KonradMagnusson - Do you have the binaries (.dll) of the mimalloc, or at least how they were compiled? (Internally we are also using it, and I want to ensure we are alright - we haven't seen the issue though - but probably by the sheer luck that I've compiled mimalloc with TRACKING support, and for some reason this codepath got disabled there. |
Hi @malkia, sorry about the late reply We compile mimalloc as an (unmodified) external CMake library, that we then link to statically. We set the following defines:
|
It at the very least does not sound far-fetched to my ears. I updated my CPU microcode to 20231114, and have not been able to reproduce the crash yet 👀 edit: I updated the µcode and locally reverted the removal of FSRM the same day it rolled out - November 14th. |
Hello!
We (Paradox Interactive, Victoria 3 team) have been receiving player reports of a crash that we've now narrowed down the source of to memory allocations using mimalloc 2.1.1 on 10th gen and newer Intel CPUs.
I am only sporadically able to reproduce the crash, and only in optimized release builds so I can sadly not provide much debug information. I'm using an Intel i9-13900k.
The top of the stack looks like this:
The line numbers are likely misleading since things are inlined, and I'm not getting any values for the
page
pointer passed tomi_heap_malloc(...)
. Howeverheap
is null, and I'm not sure what's causing this.Since our user reports and in-house testing hints at this only happening on newer Intel CPUs, I did some digging and found this CPU feature check (
mi_detect_cpu_features
) that sets a bool that is checked here (_mi_memcpy
and_mi_memzero
), resulting in hardware-dependent implementations of_mi_memcpy
and_mi_memzero
.If I disable the FSRM-based code (see diff below), we are no longer able to reproduce the crash.
The crash is not OS-dependent, and our QA has confirmed it to happen on an i7-10700k too.
Victoria 3 uses mimalloc in version 1.2 and onwards. We will be applying the patch below, disabling the FSRM implementations, as a workaround for the crash in 1.4.
The text was updated successfully, but these errors were encountered: