Skip to content

bugfix: add theap->tld null check#1289

Open
p2kyc0ng wants to merge 1 commit intomicrosoft:dev3from
p2kyc0ng:p/yc0ng/bugfix_theap_tld_null
Open

bugfix: add theap->tld null check#1289
p2kyc0ng wants to merge 1 commit intomicrosoft:dev3from
p2kyc0ng:p/yc0ng/bugfix_theap_tld_null

Conversation

@p2kyc0ng
Copy link
Copy Markdown

@p2kyc0ng p2kyc0ng commented May 9, 2026

related to issues 1288

possible trigger condition:

after _mi_thread_done (the pthread destructor) completes execution on a thread, the same thread continues to execute other destructors or callbacks. this triggers a mi_free on an abandoned page, which then enters mimalloc re-entrantly via __emutls_get_address → malloc. at this point, the theap returned by _mi_theap_default() is already in a corrupted/invalid state.

changes:

added a temporary null check for theap->tld. under this edge case, the allocator can safely fall back to subproc_main.

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.

1 participant