Skip to content

fix: bump mimalloc to 0.1.51 to fix win-arm64 process-exit crash#6176

Merged
ruben-arts merged 2 commits into
prefix-dev:mainfrom
baszalmstra:claude/fix-pixi-info-win-arm64-XCuNp
May 21, 2026
Merged

fix: bump mimalloc to 0.1.51 to fix win-arm64 process-exit crash#6176
ruben-arts merged 2 commits into
prefix-dev:mainfrom
baszalmstra:claude/fix-pixi-info-win-arm64-XCuNp

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

Description

Any pixi command exits with STATUS_ACCESS_VIOLATION (0xC0000005, decimal 3221225477) on win-arm64 in 0.69.0. The crash happens after pixi has finished its work and printed all output, in a process-exit destructor, not in pixi logic. setup-pixi surfaces it because the runner treats the non-zero exit as a failure:

The process 'C:\Users\runneradmin\.pixi\bin\pixi.exe' failed with exit code 3221225477

Root cause. The crash is in mimalloc, our global allocator on Windows (crates/pixi_allocator/src/lib.rs). Between 0.68.1 and 0.69.0, uv bumps transitively raised the resolved versions:

  • mimalloc: 0.1.48 -> 0.1.50
  • libmimalloc-sys: 0.1.44 -> 0.1.47

That bump silently flipped the bundled C library from mimalloc v2 to mimalloc v3.3.1. The wrapper's opt-in feature flag was renamed from v3 to v2 in 0.1.49, inverting the default; pixi pins no features, so we tracked whatever the new default was.

mimalloc v3.3.0 / v3.3.1 has a known win-arm64 bug (microsoft/mimalloc#1277): the MSVC C atomic wrapper on ARM64 uses compare-exchange (a write-capable instruction) to implement loads of read-only sentinel objects, which triggers an access violation on read-only pages. The symptom in the linked issue matches byte-for-byte: exit code: 0xc0000005, STATUS_ACCESS_VIOLATION. uv and ruff hit the same bug (astral-sh/uv#19192, astral-sh/ruff#24880); they pinned to mimalloc/v2 before v3.3.2 shipped.

Fix. Upstream fixed it in microsoft/mimalloc@60a1f3b, shipped in mimalloc C v3.3.2 (verified git compare v3.3.2...60a1f3b shows v3.3.2 contains the commit). That vendored C version landed in libmimalloc-sys 0.1.48 / mimalloc 0.1.51. This PR:

  1. Bumps libmimalloc-sys 0.1.47 -> 0.1.48 and mimalloc 0.1.50 -> 0.1.51 in Cargo.lock.
  2. Raises the floor in crates/pixi_allocator/Cargo.toml to 0.1.51 so future resolutions can't drop back to a buggy version.

No source code changes.

How Has This Been Tested?

  • CI: standard build + test matrix.
  • Win-arm64: needs validation on a real Windows-on-ARM machine. Easiest repro is the setup-pixi step from the bug report (pixi info --manifest-path ...); should exit 0 with this branch where 0.69.0 exits 3221225477.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude Code

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

claude added 2 commits May 21, 2026 12:54
mimalloc 0.1.50 / libmimalloc-sys 0.1.47 (resolved in pixi 0.69.0)
bundle mimalloc C v3.3.1, which crashes at process exit on Windows
ARM64 with STATUS_ACCESS_VIOLATION (0xC0000005). Root cause: the
MSVC C atomic wrapper on ARM64 used compare-exchange (a write-capable
instruction) to implement loads of read-only sentinel objects, which
triggers an access violation on read-only pages.

Upstream fix: microsoft/mimalloc@60a1f3b, shipped in mimalloc v3.3.2,
vendored into libmimalloc-sys 0.1.48 / mimalloc 0.1.51.

Refs: microsoft/mimalloc#1277, astral-sh/uv#19192.
Prevent regressions to the buggy mimalloc 0.1.49 / 0.1.50 wrappers
(which bundle the broken mimalloc C v3.3.0 / v3.3.1) by raising the
minimum version requirement. The Cargo.lock already pins 0.1.51.
@baszalmstra baszalmstra requested a review from ruben-arts May 21, 2026 14:20
Copy link
Copy Markdown
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the dive!

@ruben-arts ruben-arts enabled auto-merge (squash) May 21, 2026 14:28
@ruben-arts ruben-arts merged commit d063342 into prefix-dev:main May 21, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants