Skip to content

gh-138122: Simplify Tachyon's macOS and Windows inspection - #161956

Open
pablogsal wants to merge 7 commits into
python:mainfrom
pablogsal:rewrite-profiler-platform-inspection
Open

pablogsal wants to merge 7 commits into
python:mainfrom
pablogsal:rewrite-profiler-platform-inspection

Conversation

@pablogsal

@pablogsal pablogsal commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Rewrite the platform-specific lookup code used by Tachyon. macOS now finds PyRuntime and AsyncioDebug through dyld's loaded images and reads the Mach-O headers from target memory. If loader updates prevent a stable snapshot, the lookup scans executable memory regions. It uses native thread IDs for CPU state, so the inferred pthread offset and cache are gone. The dyld reader and Mach-O parser retain 32-bit and 64-bit formats. Older dyld replies use process metadata to determine pointer width.

Windows now queries each target thread through NtQueryInformationThread. This removes the system-wide process snapshot and its buffer. The query checks the returned process and thread IDs and closes the handle after each call. Native thread IDs remain unsigned throughout the lookup.

Related to #138122 (PEP 799) and #135953 (the original profiler proposal).

@pablogsal pablogsal added skip news needs backport to 3.15 bugs and security fixes labels Nov 14, 2026
@pablogsal

Copy link
Copy Markdown
Member Author

CC @maurycy

@pablogsal pablogsal changed the title Rewrite Tachyon's macOS and Windows inspection code gh-138122: Simplify Tachyon's macOS and Windows inspection Nov 14, 2026
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Nov 14, 2026
@pablogsal
pablogsal marked this pull request as ready for review November 14, 2026 00:59
@pablogsal pablogsal added type-refactor Code refactoring (with no changes in behavior) and removed type-feature A feature request or enhancement labels Nov 14, 2026
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Nov 14, 2026
@pablogsal pablogsal removed the type-feature A feature request or enhancement label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.15 bugs and security fixes skip news type-refactor Code refactoring (with no changes in behavior)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant