René's URL Explorer Experiment


Title: Fix object.__getstate__ deadlock and panic on __slotnames__ by luantaraschi · Pull Request #8981 · RustPython/RustPython · GitHub

Open Graph Title: Fix object.__getstate__ deadlock and panic on __slotnames__ by luantaraschi · Pull Request #8981 · RustPython/RustPython

X Title: Fix object.__getstate__ deadlock and panic on __slotnames__ by luantaraschi · Pull Request #8981 · RustPython/RustPython

Description: This PR follows our AI policy Summary object_getstate_default held the __slotnames__ read lock while it looked up each slot attribute. If a getter or __getattr__ mutates the list during that lookup, which is exactly what test_descr.test_issue24097 does, it blocks on the write lock forever. On main that test hangs until the runner's 30 s timeout, so it was skipped. A non-str entry in a cached __slotnames__ hit downcast_ref::().unwrap() instead: class C: __slotnames__ = [1] C().__getstate__() thread 'main' panicked at crates/vm/src/builtins/object.rs:234:70: called `Option::unwrap()` on a `None` value The loop now clones each name out of the list and drops the lock before the lookup, and raises TypeError: attribute name must be string, not 'int' for a non-str name. Only AttributeError is ignored now (through get_attribute_opt): before, any exception from the lookup was swallowed, so a __getattr__ raising ValueError gave a state of None where CPython raises. The size check runs after each item, as CPython does. Compared with CPython 3.14.7: the non-str and ValueError cases now raise the same exception and message. The mutating case raises RuntimeError like CPython does, with our existing message (CPython spells it __slotsname__). A missing attribute is still skipped. test_issue24097 in test_descr.py is unskipped and passes. Full test_descr: OK. 4 cases added to extra_tests/snippets/builtin_object.py. test_copy, test_copyreg, test_pickle, test_collections, test_dataclasses, test_enum, test_xml_etree, test_functools, test_deque and test_io pass as on main. cargo test for the workspace (with the AGENTS.md exclusions), clippy -Dwarnings, cargo fmt --check and check_redundant_patches.py are clean. Linux only. Written with Claude Code (claude-opus-5-5) as a tool. I reviewed the diff and reproduced the hang and the panic before and after the change myself. Summary by CodeRabbit Bug Fixes Improved object.__getstate__ handling of slot names: invalid entries and changes to the list during lookup now raise clear errors, and errors reading slot values are no longer suppressed. Missing slots remain omitted, while available slot values are included in the returned state.

Open Graph Description: This PR follows our AI policy Summary object_getstate_default held the __slotnames__ read lock while it looked up each slot attribute. If a getter or __getattr__ mutates the list during that looku...

X Description: This PR follows our AI policy Summary object_getstate_default held the __slotnames__ read lock while it looked up each slot attribute. If a getter or __getattr__ mutates the list during that looku...

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

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:d99f5d28-b1f7-f93a-0823-f7b957c8a5c4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA736:76F02:39C7FEE:49E38CD:6B01FAC3
html-safe-nonce6d69015755dcf165392bace44a27dd94d1e2084dc1b69947c04b16a11b3659db
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzM2Ojc2RjAyOjM5QzdGRUU6NDlFMzhDRDo2QjAxRkFDMyIsInZpc2l0b3JfaWQiOiI2MDA2MTYzNzQ0MDUxMjk2OTYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac06597d95bcba9a628135a9a165b4d0b751aa5a368d3bb428d84187b87443af08
hovercard-subject-tagpull_request:4754510431
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/8981/files
twitter:imagehttps://avatars.githubusercontent.com/u/130802253?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/130802253?s=400&v=4
og:image:altThis PR follows our AI policy Summary object_getstate_default held the __slotnames__ read lock while it looked up each slot attribute. If a getter or __getattr__ mutates the list during that looku...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/8981/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F8981%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%2F8981%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/8981/files
Reloadhttps://github.com/RustPython/RustPython/pull/8981/files
Reloadhttps://github.com/RustPython/RustPython/pull/8981/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
luantaraschi:fix/object-getstate-guardhttps://github.com/luantaraschi/RustPython/tree/fix/object-getstate-guard
Conversation 7 https://github.com/RustPython/RustPython/pull/8981
Commits 1 https://github.com/RustPython/RustPython/pull/8981/commits
Checks 20 https://github.com/RustPython/RustPython/pull/8981/checks
Files changed https://github.com/RustPython/RustPython/pull/8981/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8981/files
Fix object.__getstate__ deadlock and panic on __slotnames__ https://github.com/RustPython/RustPython/pull/8981/files#top
Show all changes 1 commit https://github.com/RustPython/RustPython/pull/8981/files
e66a99c Fix object.__getstate__ deadlock and panic on __slotnames__ luantaraschi Oct 6, 2026 https://github.com/RustPython/RustPython/pull/8981/commits/e66a99cdd139903f2d870adb8867004070796ba9
Clear filters https://github.com/RustPython/RustPython/pull/8981/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8981/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8981/files
test_descr.py https://github.com/RustPython/RustPython/pull/8981/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
object.rs https://github.com/RustPython/RustPython/pull/8981/files#diff-ec7721ead0f46e1973ab4e3083a62519b403b8cf2503e4a94d82e00cee8d521b
builtin_object.py https://github.com/RustPython/RustPython/pull/8981/files#diff-edf28ac9db89942fd4e725257fe461bc136a3c44e594d03264cde9d7b74791e2
Lib/test/test_descr.pyhttps://github.com/RustPython/RustPython/pull/8981/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
View file https://github.com/luantaraschi/RustPython/blob/e66a99cdd139903f2d870adb8867004070796ba9/Lib/test/test_descr.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8981/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8981/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
https://github.com/RustPython/RustPython/pull/8981/files#diff-6b813570d02ae3544e7e0233ae21d647f8e2dc47486495557e8d16c80460e85b
crates/vm/src/builtins/object.rshttps://github.com/RustPython/RustPython/pull/8981/files#diff-ec7721ead0f46e1973ab4e3083a62519b403b8cf2503e4a94d82e00cee8d521b
View file https://github.com/luantaraschi/RustPython/blob/e66a99cdd139903f2d870adb8867004070796ba9/crates/vm/src/builtins/object.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8981/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8981/files#diff-ec7721ead0f46e1973ab4e3083a62519b403b8cf2503e4a94d82e00cee8d521b
https://github.com/RustPython/RustPython/pull/8981/files#diff-ec7721ead0f46e1973ab4e3083a62519b403b8cf2503e4a94d82e00cee8d521b
extra_tests/snippets/builtin_object.pyhttps://github.com/RustPython/RustPython/pull/8981/files#diff-edf28ac9db89942fd4e725257fe461bc136a3c44e594d03264cde9d7b74791e2
View file https://github.com/luantaraschi/RustPython/blob/e66a99cdd139903f2d870adb8867004070796ba9/extra_tests/snippets/builtin_object.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8981/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8981/files#diff-edf28ac9db89942fd4e725257fe461bc136a3c44e594d03264cde9d7b74791e2
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8981/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.