Skip to content

Fix refleak tracking in free-threaded build #115184

Closed
@colesbury

Description

@colesbury

Bug report

There are a few bugs with refleak tracking in the free-threaded build uncovered in #114824:

  • We should account for blocks in abandoned segments
  • We should stop-the-world before traversing mimalloc heaps in case there are still other threads running
  • The mimalloc heap and segment traversal must call _mi_page_free_collect(page, true); to properly account for blocks that were deferred freed by other threads. We need to call this earlier than we currently do (before computing page stats).
  • _Py_DecRefSharedDebug was missing a _Py_IncRefTotal

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions