GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-128400: Stop-the-world when manually calling `faulthandler` by ZeroIntensity · Pull Request #128422 · python/cpython

Conversation

@ZeroIntensity

@ZeroIntensity ZeroIntensity commented Jan 2, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Crash when using _Py_DumpTracebackThreads #128400

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ZeroIntensity added 3 commits January 2, 2025 13:04
@ZeroIntensity
pythongh-128400: Stop the world when calling manually
a8cf48a
@ZeroIntensity
Add blurb
b9e4d48
@ZeroIntensity
Add a test.
b19d49f
@ZeroIntensity ZeroIntensity added topic-free-threading needs backport to 3.13 only security fixes labels Jan 2, 2025
@ZeroIntensity
ZeroIntensity requested review from colesbury and nascheme January 2, 2025 18:11
@bedevere-app bedevere-app Bot mentioned this pull request Jan 2, 2025
Crash when using _Py_DumpTracebackThreads #128400
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Jan 2, 2025
colesbury
colesbury approved these changes Jan 2, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jan 2, 2025
@colesbury
colesbury merged commit c9356fe into python:main Jan 2, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 2, 2025
@miss-islington-app

miss-islington-app Bot commented Jan 2, 2025

Copy link
Copy Markdown

Thanks @ZeroIntensity for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 2, 2025
@ZeroIntensity @miss-islington
pythongh-128400: Stop-the-world when manually calling faulthandler (p…
6577af1
…ythonGH-128422)

(cherry picked from commit c9356fe)

Co-authored-by: Peter Bierma <[email protected]>
@colesbury

colesbury commented Jan 2, 2025

Copy link
Copy Markdown
Contributor

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Jan 2, 2025

Copy link
Copy Markdown

GH-128423 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jan 2, 2025
@nascheme

nascheme commented Jan 2, 2025

Copy link
Copy Markdown
Member

I'm not sure including the test is a good idea. It looks a bit expensive to me. That code was intended to reliability trigger a crash when using git bisect. I would suspect you could reduce the loop count from 100 to 20 and still reliability trigger it. Maybe even 10 would be enough. OTOH, I don't think the SEGV happened when the dump output was sent to a file, only to the terminal. So with a unit test, when stdout is captured by default, I think that test code will not actually trigger the crash. The existing FaultHandlerTests.test_dump_traceback_threads was triggering the bug, just not very consistently. Maybe that would be good enough? Or, maybe add a couple loops there?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nascheme

nascheme commented Jan 2, 2025

Copy link
Copy Markdown
Member

I tested by backing out the change to faulthandler.c. That test case does trigger a crash but not on every run. So, reducing the loop iterations is probably not a good idea. So, I think we can just leave that test as is.

Thanks for fixing this bug!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity

ZeroIntensity commented Jan 2, 2025

Copy link
Copy Markdown
Member Author

Ah wait, I did forget @support.requires_resource("cpu")--will the test break due to RuntimeError: can't start new thread on some buildbots?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity
ZeroIntensity deleted the stop-the-world-faulthandler branch January 2, 2025 19:13
@colesbury

colesbury commented Jan 2, 2025

Copy link
Copy Markdown
Contributor

I think @threading_helper.requires_working_threading() should be sufficient. The test takes ~110 ms on my machine so I don't think it needs a @support.requires_resource("cpu").

ZeroIntensity reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

colesbury pushed a commit that referenced this pull request Jan 2, 2025
@miss-islington @ZeroIntensity
[3.13] gh-128400: Stop-the-world when manually calling faulthandler (…
ebadfd1
…GH-128422) (GH-128423)

(cherry picked from commit c9356fe)

Co-authored-by: Peter Bierma <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
@ZeroIntensity @srinivasreddy
pythongh-128400: Stop-the-world when manually calling faulthandler (p…
f5bb36b
…ythonGH-128422)
@sergey-miryanov sergey-miryanov mentioned this pull request Nov 1, 2025
SEGV in faulthandler.dump_traceback_later #140815
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@colesbury colesbury colesbury approved these changes
@nascheme nascheme Awaiting requested review from nascheme

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

topic-free-threading

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ZeroIntensity @colesbury @nascheme
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.