Skip to content

fix: update mimalloc for thread lifecycle safety - #48

Merged
hadronzoo merged 1 commit into
mainfrom
fix/mimalloc-thread-lifecycle
Aug 20, 2026
Merged

fix: update mimalloc for thread lifecycle safety#48
hadronzoo merged 1 commit into
mainfrom
fix/mimalloc-thread-lifecycle

Conversation

@hadronzoo

Copy link
Copy Markdown
Member

This change pins the Rust mimalloc wrapper to commit 6d4c41bb10c6d9da1d1b6f07b38c4cc051667f11. That commit embeds mimalloc v3.4.5.

Mimalloc v3.3.2 can identify the first worker that loads a shared library as its main thread. The worker can exit while the process remains active. Mimalloc then frees its static main heap. A later allocation can dereference a null thread-data pointer and cause SIGSEGV at address 0x18.

This failure affects shared libraries that hosts load from worker threads. The defect is not specific to Prosody or its client wrappers.

The update fixes microsoft/mimalloc#1287. The pinned wrapper commit comes from purpleprotocol/mimalloc_rust#169.

The dependency remains pinned until the wrapper publishes the fixed source on crates.io. A TODO comment records that removal condition.

@hadronzoo
hadronzoo marked this pull request as ready for review August 20, 2026 14:06
@hadronzoo
hadronzoo enabled auto-merge (squash) August 20, 2026 14:07
@hadronzoo
hadronzoo merged commit 7b08b16 into main Aug 20, 2026
14 checks passed
@hadronzoo
hadronzoo deleted the fix/mimalloc-thread-lifecycle branch August 20, 2026 14:14
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.

mimalloc >= 3.3.0 causes segmentation faults when used from multiple threads

1 participant