Title: gh-153210: Do not DECREF ArrayType in array_modexc when errors occur by stestagg · Pull Request #153239 · python/cpython · GitHub
Open Graph Title: gh-153210: Do not DECREF ArrayType in array_modexc when errors occur by stestagg · Pull Request #153239 · python/cpython
X Title: gh-153210: Do not DECREF ArrayType in array_modexc when errors occur by stestagg · Pull Request #153239 · python/cpython
Description: ArrayType is initialized directly on the array module state struct. This means that the reference ownership of ArrayType belongs to the state, NOT the local function. In two error cases, ArrayType was being DECREF'd by the function. Both of these DECREFS unbalanced the refcount because the ArrayType pointer is left populated on the module state. When the module is eventually cleaned up (probably by GC), then ArrayType is DECREF'd again. This change just removes the DECREF's and relies on the module tp_clear to walk the deps and clean up the state for us. Note, the test only catches this issue in a debug build. I don't know enough to know if there's a better way to write this test, but because ArrayType is a Type, reasoning about specific refcount numbers is hard, this approach should be robust. Issue: gh-153210
Open Graph Description: ArrayType is initialized directly on the array module state struct. This means that the reference ownership of ArrayType belongs to the state, NOT the local function. In two error cases, ArrayType ...
X Description: ArrayType is initialized directly on the array module state struct. This means that the reference ownership of ArrayType belongs to the state, NOT the local function. In two error cases, ArrayType ...
Opengraph URL: https://github.com/python/cpython/pull/153239
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:516d6ccd-cce3-e913-b8d9-73b8408bfa5d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CEAC:323BC4:1826E6E:206B5E5:6A535B5E |
| html-safe-nonce | 87946677710c56241a20f0ce2b51d79bdaa473d9afa5c9371b657ff71b583502 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUFDOjMyM0JDNDoxODI2RTZFOjIwNkI1RTU6NkE1MzVCNUUiLCJ2aXNpdG9yX2lkIjoiODE5OTY2MjAyMjM4MTc1NTIzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cae18294ea2f3af27cc625dbb3aed36255854d4af5cf2c45207f843c82fb28d7 |
| hovercard-subject-tag | pull_request:4002823340 |
| 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/python/cpython/pull/153239/files |
| twitter:image | https://avatars.githubusercontent.com/u/704526?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/704526?s=400&v=4 |
| og:image:alt | ArrayType is initialized directly on the array module state struct. This means that the reference ownership of ArrayType belongs to the state, NOT the local function. In two error cases, ArrayType ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width