fix: update mimalloc for thread lifecycle safety - #48
Merged
Conversation
hadronzoo
marked this pull request as ready for review
August 20, 2026 14:06
hadronzoo
enabled auto-merge (squash)
August 20, 2026 14:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SIGSEGVat address0x18.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.