Crashes in `_mi_page_free_collect`

オープン
#1,496 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, rust
領域
backend

調査の方向性

Start by comparing the _mi_page_free_collect paths in src/page.c for v3.3.2 and src/alloc/page.c for v3.6.1, then inspect the allocator state at the reported crash locations. The report has no reproducer, so first try to narrow down a reproducible case on Rust and Windows; done means identifying the cause and a way to verify a fix.

索引モデルが issue の本文から書いたものです。

説明

When using mimalloc in Rust on Windows, we've been experiencing rare crashes (1 out of 2000 runs approximately). We did not find a repro case yet.

We first noticed the issue in v3.3.2, then bumped from the no-longer-maintained mimalloc crate to the new in-repo bindings in v3.6.1, but the crashes still occur.

We've been hunting for a possible FFI mishap / wrong memory handling in the rest of the app but did not find anything yet so we're submitting this issue to collect feedback.

The problem seems similar to https://github.com/microsoft/mimalloc/issues/1098.

We've also tried compiling with MI_DEBUG=2 MI_SECURE=4 and running with GFlags "standard heap verification".

Partial backtrace using `v3.3.2`

This one points to https://github.com/microsoft/mimalloc/blob/v3.3.2/src/page.c#L178

0x172872a _mi_page_free_collect(mi_page_s*, bool)+54 C:\project\vendor\libmimalloc-sys\c_src\mimalloc\v3\src\page.c:210
0x173313e mi_page_queue_find_free_ex(mi_theap_s*, mi_page_queue_s*, bool)+9 C:\project\vendor\libmimalloc-sys\c_src\mimalloc\v3\src\page.c:765
0x172708f _mi_malloc_generic(mi_theap_s*, unsigned long long, unsigned long long, unsigned long long*)+13 C:\project\vendor\libmimalloc-sys\c_src\mimalloc\v3\src\page.c:1012
0x1735109 mi_theap_realloc_aligned(mi_theap_s*, void*, unsigned long long, unsigned long long)+231 C:\project\vendor\libmimalloc-sys\c_src\mimalloc\v3\src\alloc-aligned.c:368
0x17385ca alloc::raw_vec::RawVecInner<alloc::alloc::Global>::finish_grow<alloc::alloc::Global>(unsigned long long, core::alloc::layout::Layout)+13 C:\Users\user\.rustup\toolchains\nightly-2026-05-19-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec\mod.rs:556
0x173c47f alloc::raw_vec::RawVec<backtrace::capture::BacktraceFrame,alloc::alloc::Global>::grow_one<backtrace::capture::BacktraceFrame,alloc::alloc::Global>()+54 C:\Users\user\.rustup\toolchains\nightly-2026-05-19-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec\mod.rs:188
0x163c2f hickory_proto::rr::domain::name::Name::trim_to(unsigned long long)+723 C:\project\vendor\hickory-proto\src\rr\domain\name.rs:370
// snip
Partial backtrace using `v3.6.1`

Points to https://github.com/microsoft/mimalloc/blob/v3.6.1/src/alloc/page.c#L361

0x177e934 _mi_page_free_collect(mi_page_s*, bool)+48 C:\project\vendor\mimalloc-sys\mimalloc\src\alloc\page.c:384
0x178c990 mi_page_queue_find_free_ex(mi_theap_s*, mi_page_queue_s*, bool)+9 C:\project\vendor\mimalloc-sys\mimalloc\src\alloc\alloc-generic.c:74
0x178c8da mi_page_queue_find_free(mi_theap_s*, mi_page_queue_s*)+7 C:\project\vendor\mimalloc-sys\mimalloc\src\alloc\alloc-generic.c:211
0x177ccbb _mi_malloc_generic(mi_theap_s*, unsigned long long, unsigned long long, mi_page_s**)+10 C:\project\vendor\mimalloc-sys\mimalloc\src\alloc\alloc-generic.c:494
0x162184a tracing_appender::non_blocking::impl$3::write(tracing_appender::non_blocking::NonBlocking*, ref$<slice2$<u8> >)+23 C:\project\vendor\tracing-appender\src\non_blocking.rs:242
// snip
主要言語
C
スター
13.6k
フォーク
1.2k
平均マージ
18時間 12分
マージ済み PR(30日)
20

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/mimalloc のほかの issue

microsoft/mimalloc の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。