Title: PyType_FromSpec may leak memory with repeated slot IDs · Issue #93466 · python/cpython · GitHub
Open Graph Title: PyType_FromSpec may leak memory with repeated slot IDs · Issue #93466 · python/cpython
X Title: PyType_FromSpec may leak memory with repeated slot IDs · Issue #93466 · python/cpython
Description: If a slot ID is repeated in PyType_Spec, the current PyType_FromSpec implementation happens to usually use the last one and ignore earlier ones, but: if Py_tp_doc is repeated, PyType_FromSpec may leak memory, and if Py_tp_members is repe...
Open Graph Description: If a slot ID is repeated in PyType_Spec, the current PyType_FromSpec implementation happens to usually use the last one and ignore earlier ones, but: if Py_tp_doc is repeated, PyType_FromSpec may l...
X Description: If a slot ID is repeated in PyType_Spec, the current PyType_FromSpec implementation happens to usually use the last one and ignore earlier ones, but: if Py_tp_doc is repeated, PyType_FromSpec may l...
Opengraph URL: https://github.com/python/cpython/issues/93466
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PyType_FromSpec may leak memory with repeated slot IDs","articleBody":"If a slot ID is repeated in `PyType_Spec`, the current `PyType_FromSpec` implementation happens to *usually* use the last one and ignore earlier ones, but:\r\n- if `Py_tp_doc` is repeated, `PyType_FromSpec` may leak memory, and\r\n- if `Py_tp_members` is repeated, `PyType_FromSpec` may memcpy unintialized memory (if slot specifies fewer members than the last one).\r\n\r\nWe chould:\r\n- clarify in the docs that repeated slot IDs are not supported\r\n- raise an exception for duplicate slots (at least when it's easy to detect, as in the cases above)\r\n\r\nAlternatively, we could formalize that the last slot of a given ID “wins” and fix the leak/mem issue, but I don't see a use case for this more complex behavior.\r\n","author":{"url":"https://github.com/encukou","@type":"Person","name":"encukou"},"datePublished":"2022-06-03T12:35:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/93466/cpython/issues/93466"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d8d9e5d-dc87-542a-8e1c-2e52e6623a0f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8BC:2D0DCE:99BAC7:CE6096:69697E1F |
| html-safe-nonce | f2a0e1ab5c71224ad326de5eeb7bb4a85f21e2eadb6b07a6d8911dce77c32d07 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEJDOjJEMERDRTo5OUJBQzc6Q0U2MDk2OjY5Njk3RTFGIiwidmlzaXRvcl9pZCI6IjQyNDU3OTQ3MTExMTc4NTYyODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7207f83724e04f66f854b9762dd439760a2307dd8253ed9dade86952b48d1ba4 |
| hovercard-subject-tag | issue:1259859941 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/93466/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6fa1cfe8270615f8f5def90c7c353ab53c1328463c48a208183ec90f6d7888ab/python/cpython/issues/93466 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6fa1cfe8270615f8f5def90c7c353ab53c1328463c48a208183ec90f6d7888ab/python/cpython/issues/93466 |
| og:image:alt | If a slot ID is repeated in PyType_Spec, the current PyType_FromSpec implementation happens to usually use the last one and ignore earlier ones, but: if Py_tp_doc is repeated, PyType_FromSpec may l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | encukou |
| hostname | github.com |
| expected-hostname | github.com |
| None | f33e4b94c8824ab2b434d82a94139432fb5ebee9df4b75304140ad22508c4a77 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 48f380098b30acbb700b04f1724481ca10d574fc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width