René's URL Explorer Experiment


Title: Serialize bytearray exports with resizing by youknowdot · Pull Request #9087 · RustPython/RustPython · GitHub

Open Graph Title: Serialize bytearray exports with resizing by youknowdot · Pull Request #9087 · RustPython/RustPython

X Title: Serialize bytearray exports with resizing by youknowdot · Pull Request #9087 · RustPython/RustPython

Description: Summary Fix a main-common bytearray buffer race surfaced by #8951 macOS CI: decoding used a buffer descriptor of 4 MiB after the underlying bytearray had been cleared. Keep the bytearray read lock through descriptor creation and export retention; preserve early export rejection and recheck exports after acquiring the resize lock. Route initializer replacement and sequence-slot deletion through the resize guard. Clear before initializer conversion, while preserving the successful zero-index callback's no-write behavior without calling __index__ twice. Make RawIOBase.read validate the count, perform a guarded resize, and take the temporary buffer, following pinned CPython 3.15.0 source and preserving retained-view errors. Add bounded Python export-lifetime and concurrent decode/memoryview regressions. No Lib/ files or existing assertions are changed. Base: f39da82d9d38cd5bdceb9e645205e830f65126fb. Head: d0819a2fabf2017c5603e089acc7c3a22020f241. Validation Independent source review of lock ordering, callback/reentry boundaries, retain/release ownership, and each changed mutation path. Native default-feature debug build and cargo check passed; root and matching-feature VM-library Clippy passed with -D warnings; normal commit hooks passed. Both new snippets and existing builtin_bytearray.py / builtin_bytes.py passed on the exact stamped candidate, each in a timeout-controlled subprocess. The unchanged current-main test_bytes.FreeThreadingTest.test_free_threading_bytearray passed once in an isolated subprocess. Its body predates final CPython's additional take_bytes cases; this is validation of the failing CI method, not full final-bytearray API coverage. Both new snippets passed on certified CPython 3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc). Constructor and raw-I/O error/order semantics were checked against that source. A qualified pre-fix #8951 native binary with source-identical affected runtime files fails the new exported-initializer regression. Local contention and canonical race runs passed on the baseline too; the actual race-before evidence is the hosted macOS panic and source interleavings, not a claimed deterministic local reproduction. Candidate executable stamp, own embedded standard-library path, imported module origins, and artifact hashes were verified. Full workspace/C-API suites, release validation and non-Linux runtime coverage were not run locally. Existing incremental-iterable constructor differences, the public Rust mutable-vector API boundary and final take_bytes API additions remain outside this repair. The sequence-slot deletion change has source review rather than direct C-API runtime coverage. Keep this PR draft and unmerged pending hosted CI and maintainer review. AI assistance OpenAI Codex implemented, reviewed and validated this change under maintainer direction. The exact model identifier is unavailable in this environment; the commit includes an Assisted-by trailer. This draft does not claim completed human validation. Summary by CodeRabbit Bug Fixes Improved bytearray behavior when buffers are actively exported or modified during operations, including searching, comparisons, translation, padding, initialization, and deletion. Improved handling of temporary buffers during reads, including resizing and allocation failures. Tests Added coverage for bytearray exports, callbacks, and concurrent resizing.

Open Graph Description: Summary Fix a main-common bytearray buffer race surfaced by #8951 macOS CI: decoding used a buffer descriptor of 4 MiB after the underlying bytearray had been cleared. Keep the bytearray read lock...

X Description: Summary Fix a main-common bytearray buffer race surfaced by #8951 macOS CI: decoding used a buffer descriptor of 4 MiB after the underlying bytearray had been cleared. Keep the bytearray read lock...

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

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:3552e847-59c9-544b-7fee-e3e206ffdcd0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE8DC:21BD98:3333868:40E87FB:6B020B9F
html-safe-noncea3789f36785379cca55606f23554cce5f12e708a8ddea7c664e1082b34547671
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOERDOjIxQkQ5ODozMzMzODY4OjQwRTg3RkI6NkIwMjBCOUYiLCJ2aXNpdG9yX2lkIjoiNjcxMDIwNzc5Njk2MjUyODE1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacccb5ace875a55f5884f88d12d929a8c6573b5c3726bce0cb23d18f94d103b7f7
hovercard-subject-tagpull_request:4822211812
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/9087/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 a main-common bytearray buffer race surfaced by #8951 macOS CI: decoding used a buffer descriptor of 4 MiB after the underlying bytearray had been cleared. Keep the bytearray read lock...
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/9087/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9087%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%2F9087%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/9087/files
Reloadhttps://github.com/RustPython/RustPython/pull/9087/files
Reloadhttps://github.com/RustPython/RustPython/pull/9087/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-bytearray-buffer-racehttps://github.com/youknowdot/RustPython/tree/fix-bytearray-buffer-race
Conversation 21 https://github.com/RustPython/RustPython/pull/9087
Commits 5 https://github.com/RustPython/RustPython/pull/9087/commits
Checks 29 https://github.com/RustPython/RustPython/pull/9087/checks
Files changed https://github.com/RustPython/RustPython/pull/9087/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9087/files
Serialize bytearray exports with resizing https://github.com/RustPython/RustPython/pull/9087/files#top
Show all changes 5 commits https://github.com/RustPython/RustPython/pull/9087/files
d0819a2 Serialize bytearray exports with resizing youknowdot Oct 11, 2026 https://github.com/RustPython/RustPython/pull/9087/commits/d0819a2fabf2017c5603e089acc7c3a22020f241
fcd4f4c Release bytearray initializer storage and check deletion indices youknowdot Oct 12, 2026 https://github.com/RustPython/RustPython/pull/9087/commits/fcd4f4c8ae18b220168147b8d2c3fd5946636255
9fdae0a Fix bytearray concatenation buffer callback reentrancy youknowdot Oct 12, 2026 https://github.com/RustPython/RustPython/pull/9087/commits/9fdae0a3f7b443d38589c8d36497f823212e1c40
a0fec1f Stage bytearray buffer callbacks outside receiver locks youknowdot Oct 12, 2026 https://github.com/RustPython/RustPython/pull/9087/commits/a0fec1f8c0a6ad66a10cd751c18bc261f0b5a3a6
f163e13 Consolidate bytearray regressions in the builtin snippet youknowdot Oct 12, 2026 https://github.com/RustPython/RustPython/pull/9087/commits/f163e1371018275e40b4651108818d722b02368c
Clear filters https://github.com/RustPython/RustPython/pull/9087/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9087/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9087/files
anystr.rs https://github.com/RustPython/RustPython/pull/9087/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
bytearray.rs https://github.com/RustPython/RustPython/pull/9087/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
bytes_inner.rs https://github.com/RustPython/RustPython/pull/9087/files#diff-94a4e578864d9ec94d59e2b7f57ea8f5a67aa734d28847c8921202237f2156b7
_io.rs https://github.com/RustPython/RustPython/pull/9087/files#diff-90825edc73ec293e0ed3b2dbed7f0a492b1f8e51c25747326089a912267bdd3e
builtin_bytearray.py https://github.com/RustPython/RustPython/pull/9087/files#diff-75a9ae9b0f5a55a46c1c1f573db7804fd2e108752b6a2e16a363c8a9614e120c
crates/vm/src/anystr.rshttps://github.com/RustPython/RustPython/pull/9087/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
View file https://github.com/youknowdot/RustPython/blob/f163e1371018275e40b4651108818d722b02368c/crates/vm/src/anystr.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9087/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9087/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/9087/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9087/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9087/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.