Skip to content

gh-149009: Validate thread_count in profiling.sampling binary reader#149147

Open
maurycy wants to merge 3 commits intopython:mainfrom
maurycy:remote-debugger-thread-count-max
Open

gh-149009: Validate thread_count in profiling.sampling binary reader#149147
maurycy wants to merge 3 commits intopython:mainfrom
maurycy:remote-debugger-thread-count-max

Conversation

@maurycy
Copy link
Copy Markdown
Contributor

@maurycy maurycy commented Apr 29, 2026

The profiling.sampling binary reader reads thread_count stored in the file header but replay does not validate if there's more (thread_id, interp_id) pairs than declared.

To make it clear: that's just a validation.

Resolves gh-149009

}
}

if (reader->thread_state_count >= reader->thread_count) {
Copy link
Copy Markdown
Contributor Author

@maurycy maurycy Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pablogsal

Wondering if there should be no hard cap but it's pairs and...

const size_t MAX_THREADS_PER_INTERP = 8192;

const size_t MAX_INTERPRETERS = 256;

...the multiplication is still large.

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.

_remote_debugging: binary reader does not enforce thread_count

1 participant