Skip to content

gh-162484: Check mimalloc segment is in use before marking it abandoned - #162608

Open
corona10 wants to merge 1 commit into
python:mainfrom
corona10:gh-162484
Open

corona10 wants to merge 1 commit into
python:mainfrom
corona10:gh-162484

Conversation

@corona10

@corona10 corona10 commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

@corona10

Copy link
Copy Markdown
Member Author

@vstinner
This is actually an upstream bug and not the actual bug, only racy assertion issue.. (But v3 use different approach so not worth to pile the issue)
When mi_assert_internal(_mi_bitmap_is_claimed(arena->blocks_inuse, arena->field_count, 1, bitmap_idx)); is called, another thread can modify the abandoned segments and make them free (blocks_inuse: 0, blocks_abandoned: 0).

So the assertion could be true only before _mi_bitmap_is_claimed is called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant