mimalloc: Assertion failed on armv7 using musl based libraries

Hello there,

I’m trying to use mimalloc for a project using Rust ( https://github.com/dani-garcia/vaultwarden ). Specifically for the Alpine base builds which uses musl libc this could be a huge improvement.

I am using a Rust crate/library to embed the support of mimalloc into the application ( https://github.com/purpleprotocol/mimalloc_rust ), and it seems to work fine. I did however forked it so that i could also test the dev and dev-slice branches which all gave the same results.

I did the tests on a Raspberry Pi 2B and also using qemu via binfmt to start the docker container of a different architecture.

For the amd64/x86_64 builds using the musl-libc it works great, huge improvement compared to the default malloc. But for the armv7 it fails everytime, except it sometimes keeps working if i configure Vaultwarden to only use 1 worker process it sometimes keeps working during the test, but most of the time it also fails.

The message returned on the screen is the following:

mimalloc: assertion failed: at "c_src/mimalloc_dev/src/page.c":101, mi_page_is_valid_init
  assertion: "page->used + free_count == page->capacity"

The message is the same for both running it via qemu or on the actual hardware.

I already saw an earlier report and PR regarding someting like this #376 and #384, but these do not seem to work for this specific situation. I even tried to change the if statement my self but that also didn’t worked out, and I’m not that familiar with C/C++.

How can i help to debug this issue?

PS: I did not yet tried this for armv6 or arm64/aarch64 architectures, since i do not have the hardware to test it on.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21

Commits related to this issue

Most upvoted comments

I did a quick test using your latest commits, and it seems to work great out-of-the-box 😄 . Works fine on the following platforms (All Static MUSL via qemu and via Alpine Docker):

  • x86_64
  • aarch64
  • armv7
  • armv6
  • armv5te