René's URL Explorer Experiment


Title: Avoid locking registration state in unchained faulthandler signals by youknowdot · Pull Request #9902 · RustPython/RustPython · GitHub

Open Graph Title: Avoid locking registration state in unchained faulthandler signals by youknowdot · Pull Request #9902 · RustPython/RustPython

X Title: Avoid locking registration state in unchained faulthandler signals by youknowdot · Pull Request #9902 · RustPython/RustPython

Description: Summary Fix the unchained user-signal registration deadlock on Unix targets with native 64-bit atomics, without changing the descriptor number or adding allocation/reclamation to signal handlers. get_user_signal() currently locks the same mutex used by registration. A signal delivered while that thread holds the mutex can wait on itself. Publish the small (fd, enabled, all_threads, chain) configuration in a single atomic word instead; registration bookkeeping and previous dispositions remain separate. Restore entry errno on all normal user-handler exits. This is a narrowly scoped safety fix, not completion of max_threads/C-stack/all-thread parity. No expected-failure markers are removed, dependencies changed, or CI configuration altered. Scope and remaining limitations Applies to Unix target_has_atomic="64". Other Unix targets retain the old implementation and its limitation; Windows is unchanged. chain=True still uses the existing mutex-based disposition path and can deadlock. Its restore/raise/reinstall versus unregister race is not solved. CPython v3.15.2 also uses restore/raise/reinstall; that is not evidence of race-free behavior in RustPython. Original descriptor identity is preserved, including dup2 redirection. This does not fix existing Python-file keepalive or concurrent descriptor-close/reuse lifetime issues. First installation has a narrow publication window: a handler may observe disabled state and return before registration finishes. This is not advertised as delivery guarantees during concurrent installation. Post-fork normal registration/writer-lock behavior remains unchanged. No new fork restriction or descriptor duplication is introduced. The previously explored heap snapshots/duplicated descriptors are not used: duplicated descriptors would change observable redirection semantics, while reclamation introduces unrelated lifetime/fork problems. Validation Fresh Linux release build passed; all 32 host_env unit tests passed, including the new packed-config and interrupted-bookkeeping checks. Targeted host_env release Clippy with -D warnings passed. Full workspace/C-API tests and Clippy were not run. Canonical test_faulthandler: 51 tests, 11 skips, 4 existing expected failures, passed twice. Registration/file/fd/unregister/thread-label/chaining tests ran successfully. Skips cover Windows-only cases, unavailable _testcapi, disabled walltime resource, unavailable stack-overflow hook and the existing GIL-disabled fatal-all-thread restriction. Existing extension-module/C-stack/native-thread-fatal/max-thread failures remain marked unchanged. Actual RustPython no-chain stress: baseline 3/3 timed out after 8 seconds; candidate 3/3 completed in 0.26–0.34 seconds, registering 100,000 times while another thread sent SIGUSR1. The equivalent CPython 3.15.2 probe completed 3/3. ptrace was unavailable, so exact lock-site attribution is source-supported rather than debugger-proven. Original-fd dup2 redirection and ordinary post-fork unregister/re-register/dump probes match baseline behavior. These do not prove race-free concurrent descriptor closure or fork while a writer holds its mutex. Native 64-bit-atomic target configuration checked for Linux/macOS; non-atomic64 armv5te fallback inspected. Other OS execution/cross-compilation remains for CI. Draft only. Performance review needed Seven alternating local release-binary pairs, same Lib and setup: Case Baseline median Candidate median Change 100,000 registrations 0.1683 s 0.1796 s +6.7% 200,000 delivered signals 0.4523 s 0.4726 s +4.5% A shorter 20,000-signal measurement also showed +8.3%. These are narrow microbenchmarks, not zero-regression evidence. The available baseline has identical pre-change faulthandler code and build features but includes unrelated sampling-profiler changes; binary layout/noise and the separate errno correction prevent attributing all timing differences solely to the atomic load. Treat this as a safety improvement with performance still requiring review, not merge-ready.

Open Graph Description: Summary Fix the unchained user-signal registration deadlock on Unix targets with native 64-bit atomics, without changing the descriptor number or adding allocation/reclamation to signal handlers. g...

X Description: Summary Fix the unchained user-signal registration deadlock on Unix targets with native 64-bit atomics, without changing the descriptor number or adding allocation/reclamation to signal handlers. g...

Opengraph URL: https://github.com/RustPython/RustPython/pull/9902

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:8e006134-031f-d7f7-c223-94dd2ae8f472
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id88A8:2270F4:3016719:3FD008D:6B01DE32
html-safe-nonce5d65d9e85685e4dc23ff33b5d8a9338b17e7f6f72251a216261fbe27e46d257e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEE4OjIyNzBGNDozMDE2NzE5OjNGRDAwOEQ6NkIwMURFMzIiLCJ2aXNpdG9yX2lkIjoiNjU0ODQ2NDIzNzc0Mjc3NTg1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace5e9552b2b8fa6f00eb49ca7d44db720955dbeee1da9cd5e459e2d35bb59cc0c
hovercard-subject-tagpull_request:5350347563
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9902/files
twitter:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
og:image:altSummary Fix the unchained user-signal registration deadlock on Unix targets with native 64-bit atomics, without changing the descriptor number or adding allocation/reclamation to signal handlers. g...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9902/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9902%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9902%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/9902/files
Reloadhttps://github.com/RustPython/RustPython/pull/9902/files
Reloadhttps://github.com/RustPython/RustPython/pull/9902/files
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowdot:fix/faulthandler-signal-snapshot-20261117https://github.com/youknowdot/RustPython/tree/fix/faulthandler-signal-snapshot-20261117
Conversation 2 https://github.com/RustPython/RustPython/pull/9902
Commits 1 https://github.com/RustPython/RustPython/pull/9902/commits
Checks 27 https://github.com/RustPython/RustPython/pull/9902/checks
Files changed https://github.com/RustPython/RustPython/pull/9902/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9902/files
Avoid locking registration state in unchained faulthandler signals https://github.com/RustPython/RustPython/pull/9902/files#top
Show all changes 1 commit https://github.com/RustPython/RustPython/pull/9902/files
d0009ac Avoid locking registration state in unchained faulthandler signals codex Nov 17, 2026 https://github.com/RustPython/RustPython/pull/9902/commits/d0009ac4367560ecf28d9b1d46c0c4887d1d42f2
Clear filters https://github.com/RustPython/RustPython/pull/9902/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9902/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9902/files
faulthandler.rs https://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
faulthandler.rs https://github.com/RustPython/RustPython/pull/9902/files#diff-b15b38e1d9030b5f032e0ff01700ac4b9da28b3ec08365b65e5387dbd74ec39f
crates/host_env/src/faulthandler.rshttps://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
View file https://github.com/youknowdot/RustPython/blob/d0009ac4367560ecf28d9b1d46c0c4887d1d42f2/crates/host_env/src/faulthandler.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9902/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
https://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
https://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
https://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
https://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
https://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
https://github.com/RustPython/RustPython/pull/9902/files#diff-151f9a6d3c66de01df945eaaa8c12036c05372f6d3c47e889b28db5897e3615b
crates/stdlib/src/faulthandler.rshttps://github.com/RustPython/RustPython/pull/9902/files#diff-b15b38e1d9030b5f032e0ff01700ac4b9da28b3ec08365b65e5387dbd74ec39f
View file https://github.com/youknowdot/RustPython/blob/d0009ac4367560ecf28d9b1d46c0c4887d1d42f2/crates/stdlib/src/faulthandler.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9902/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9902/files#diff-b15b38e1d9030b5f032e0ff01700ac4b9da28b3ec08365b65e5387dbd74ec39f
https://github.com/RustPython/RustPython/pull/9902/files#diff-b15b38e1d9030b5f032e0ff01700ac4b9da28b3ec08365b65e5387dbd74ec39f
https://github.com/RustPython/RustPython/pull/9902/files#diff-b15b38e1d9030b5f032e0ff01700ac4b9da28b3ec08365b65e5387dbd74ec39f
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9902/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.