Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-138122: Add blocking mode for accurate stack traces in Tachyon#142998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
pablogsal wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
frompablogsal:fixes

Conversation

@pablogsal
Copy link
Member

@pablogsalpablogsal commentedDec 20, 2025
edited
Loading

Non-blocking sampling reads process memory while the target continues
running, which can produce torn stacks when generators or coroutines
rapidly switch between yield points. Blocking mode uses atomic process
suspension (task_suspend on macOS, NtSuspendProcess on Windows,
PTRACE_SEIZE on Linux) to stop the target during each sample, ensuring
consistent snapshots.

Use blocking mode with longer intervals (1ms+) to avoid impacting the
target too much. The default non-blocking mode remains best for most
cases since it has zero overhead.


📚 Documentation preview 📚:https://cpython-previews--142998.org.readthedocs.build/

@pablogsalpablogsal changed the titlegh-142654: Add blocking mode for accurate stack traces in Tachyongh-138122: Add blocking mode for accurate stack traces in TachyonDec 20, 2025
@pablogsalpablogsalforce-pushed thefixes branch 3 times, most recently from6c08254 tobb510c0CompareDecember 20, 2025 02:53
Non-blocking sampling reads process memory while the target continuesrunning, which can produce torn stacks when generators or coroutinesrapidly switch between yield points. Blocking mode uses atomic processsuspension (task_suspend on macOS, NtSuspendProcess on Windows,PTRACE_SEIZE on Linux) to stop the target during each sample, ensuringconsistent snapshots.Use blocking mode with longer intervals (1ms+) to avoid impacting thetarget too much. The default non-blocking mode remains best for mostcases since it has zero overhead.Also fix a frame cache bug: the cache was including the last_profiled_frameitself when extending with cached data, but this frame was executing inthe previous sample and its line number may have changed. For example,if function A was sampled at line 6, then execution continued to line 10and called B→C, the next sample would incorrectly report A at line 6(from cache) instead of line 10. The fix uses start_idx + 1 to only trustframes ABOVE last_profiled_frame — these caller frames are frozen at theircall sites and cannot change until their callees return.Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
@pablogsal
Copy link
MemberAuthor

@ivonastojanovic can you take a look?

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

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@pablogsal

[8]ページ先頭

©2009-2025 Movatter.jp