Skip to content

fix: safely free over-aligned small allocations - #1401

Merged
Daan (daanx) merged 2 commits into
microsoft:dev3from
shubhambhar007:fix/1400-free-size-aligned
Sep 14, 2026
Merged

Daan (daanx) merged 2 commits into
microsoft:dev3from
shubhambhar007:fix/1400-free-size-aligned

Conversation

@shubhambhar007

Copy link
Copy Markdown
Contributor

Fixes #1400 by preventing mi_free_size_aligned from using the small-page fast path for over-aligned allocations that may reside in non-small pages. Adds a regression test covering 8-byte allocations with 16 KiB alignment; all 51 API tests pass in release and debug builds.

@daanx
Daan (daanx) changed the base branch from main3 to dev3 September 14, 2026 17:19
@daanx
Daan (daanx) merged commit 9c36a82 into microsoft:dev3 Sep 14, 2026
1 check was pending
@daanx

Copy link
Copy Markdown
Collaborator

Thank you! (I merged against dev3). I also added an extra comment explaining why it is safe now.

@shubhambhar007

Copy link
Copy Markdown
Contributor Author

Thanks Daan (@daanx) !

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.

SegFault: mi_free_size_aligned / mi_free_size on small over-aligned allocations v3

2 participants