microsoft / microsoft/mimalloc

Application using redirection to mimalloc crashes on Windows 11 when opening a file dialog

Open
#498 25 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

A minimal program was created to reproduce the issue (look code sniped below).
The program opens a file dialog using GetOpenFileName. The crash occurs right after the file dialog displays.

On Windows 10, the program runs successfully both with and without the mimalloc.
On Windows 11, the program crashes when the mimalloc allocator is used. [Callstack](https://github.com/microsoft/mimalloc/files/7713264/callstack.txt) is attached.

Windows 11 Home single language
Version 21H2
OS Build 22000.348
Windows Feature Experience Pack 1000.22000.348.0

Shell32.dll ver. 10.0.22000.348
ucrtbase.dll ver. 10.0.22000.1
ucrtbased.dll ver. 10.0.19041.685

Visual Studio 2022 ver. 17.0.2
MSVC ver. 143 x86/x64 14.30.30705
Windows SDK 10.0.19041.0

```
#include
#include

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
OPENFILENAME ofn;
char szFile[500];
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL;
ofn.lpstrFile = szFile;
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
GetOpenFileName(&ofn);

MessageBox(NULL, ofn.lpstrFile, "File Name", MB_OK);
return 0;
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the minimal C reproducer using GetOpenFileName and the attached callstack.txt. Compare behavior on Windows 10 and Windows 11 with and without mimalloc redirection, focusing on the file-dialog crash after it appears. Done means identifying and resolving the Windows 11 crash while preserving the successful Windows 10 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.