Skip to content

guard theap->tld NULL deref in reclaim path and _mi_subproc#3

Open
dylan-conway wants to merge 1 commit into
bun-dev3-v2from
claude/theap-tld-null-guards
Open

guard theap->tld NULL deref in reclaim path and _mi_subproc#3
dylan-conway wants to merge 1 commit into
bun-dev3-v2from
claude/theap-tld-null-guards

Conversation

@dylan-conway
Copy link
Copy Markdown
Member

_mi_theap_free (called from _mi_thread_done) sets theap->tld = NULL. A later mi_free() on the same thread (e.g., from another TLS destructor) can reach mi_abandoned_page_try_reclaim where _mi_page_associated_theap_peek returns that theap, and theap->tld->is_in_threadpool SEGVs at free.c:349/352.

Adds the tld==NULL check alongside the existing theap==NULL check there, and ports microsoft#1289 which fixes the same hazard in _mi_subproc().

Upstream: microsoft#1288, microsoft#1289

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