Title: Allow reentrant ctypes OUT construction by youknowdot · Pull Request #9620 · RustPython/RustPython · GitHub
Open Graph Title: Allow reentrant ctypes OUT construction by youknowdot · Pull Request #9620 · RustPython/RustPython
X Title: Allow reentrant ctypes OUT construction by youknowdot · Pull Request #9620 · RustPython/RustPython
Description: Summary Release the pointer type's storage-info read lock before calling the pointed-to type's Python constructor for an implicit ctypes OUT parameter. The constructor may re-enter pointer type setup, which needs the same metadata's write lock. Retaining the selected type through the call preserves its lifetime. Scope This addresses constructor reentrancy only; existing implicit-OUT from_param and array handling differences are separate. The constructor runs before FFI and can interact with earlier arguments. This change does not pin their buffers or resolve the pre-existing possibility of a later callback resizing storage after an address was captured. Validation A CPython 3.15 libc time reproduction constructed a Structure whose __new__ calls the enclosing pointer type's set_type; the call completed and filled the output. Independent source review and normal commit hooks (including rustfmt) passed. Local sequential three-way file merges with #9611, #9613, #9615, #9616 and #9618 were clean at their then-current heads. RustPython was not built or executed locally. No tests were added or changed; hosted CI is expected to run the existing ctypes tests. Summary by CodeRabbit Bug Fixes Improved output buffer handling for pointer arguments, including cases without type metadata.
Open Graph Description: Summary Release the pointer type's storage-info read lock before calling the pointed-to type's Python constructor for an implicit ctypes OUT parameter. The constructor may re-enter pointer ...
X Description: Summary Release the pointer type's storage-info read lock before calling the pointed-to type's Python constructor for an implicit ctypes OUT parameter. The constructor may re-enter ...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9620
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e5656c71-7f6c-27b4-0db4-35719a0ac4c1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BFA2:187C1E:11641B5:17037D5:6B01E40F |
| html-safe-nonce | d28e7d61f8b514d753dd6ba1442d0a14255d3079f3f5bd3be00b59f8068ce228 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkEyOjE4N0MxRToxMTY0MUI1OjE3MDM3RDU6NkIwMUU0MEYiLCJ2aXNpdG9yX2lkIjoiMjk1NDU4NDk0MDQ2Mjg1OTI3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1a986f525bd5bcc96a861c3f281e9b57d2a35908c1cf8d02d176e6e74a5b2174 |
| hovercard-subject-tag | pull_request:5137878835 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9620/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Summary Release the pointer type's storage-info read lock before calling the pointed-to type's Python constructor for an implicit ctypes OUT parameter. The constructor may re-enter pointer ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width