microsoft / microsoft/mimalloc

Assert on first thread allocation on 3.5.2

Open
#1,398 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

Hey.
Just updated to 3.5.2 and it asserts about missing theap in the very first allocation on new thread.

Editor_debug.exe!_mi_assert_fail(const char * assertion, const char * fname, unsigned int line, const char * func) Line 572 C++
Editor_debug.exe!mi_theap_malloc(mi_theap_s * theap, unsigned __int64 size) Line 278 C++
Editor_debug.exe!mi_theap_alloc_new(mi_theap_s * theap, unsigned __int64 size) Line 830 C++
Editor_debug.exe!mi_new(unsigned __int64 size) Line 837 C++
Editor_debug.exe!operator new(unsigned __int64 n) Line 40 C++

mi_new() -> _mi_theap_default() seems to return nullptr. 100% occurrence. 3.5.1 verified to behave correct.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported stack through mi_new, _mi_theap_default(), mi_theap_alloc_new(), and mi_theap_malloc(). Reproduce the first allocation on a new thread with 3.5.2, compare against 3.5.1, and trace why _mi_theap_default() returns nullptr; done means the assertion no longer occurs in the reported scenario.

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
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.