Title: Type object's ob_type does not get set when tp_bases is set before PyType_Ready · Issue #104614 · python/cpython · GitHub
Open Graph Title: Type object's ob_type does not get set when tp_bases is set before PyType_Ready · Issue #104614 · python/cpython
X Title: Type object's ob_type does not get set when tp_bases is set before PyType_Ready · Issue #104614 · python/cpython
Description: Bug report This came up while testing numpy on 3.12. A bug report has been filed on numpy/numpy#23766. It's happening due to #103912, which introduced an additional check for tp_bases not being NULL in type_ready_set_bases, which is call...
Open Graph Description: Bug report This came up while testing numpy on 3.12. A bug report has been filed on numpy/numpy#23766. It's happening due to #103912, which introduced an additional check for tp_bases not being NUL...
X Description: Bug report This came up while testing numpy on 3.12. A bug report has been filed on numpy/numpy#23766. It's happening due to #103912, which introduced an additional check for tp_bases not being...
Opengraph URL: https://github.com/python/cpython/issues/104614
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type object's ob_type does not get set when tp_bases is set before PyType_Ready","articleBody":"\u003c!--\r\n If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not\r\n the right place to seek help. Consider the following options instead:\r\n\r\n - reading the Python tutorial: https://docs.python.org/3/tutorial/\r\n - posting in the \"Users\" category on discuss.python.org: https://discuss.python.org/c/users/7\r\n - emailing the Python-list mailing list: https://mail.python.org/mailman/listinfo/python-list\r\n - searching our issue tracker (https://github.com/python/cpython/issues) to see if\r\n your problem has already been reported\r\n--\u003e\r\n\r\n# Bug report\r\n\r\nThis came up while testing numpy on 3.12. A bug report has been filed on numpy/numpy#23766. It's happening due to #103912, which introduced [an additional check for `tp_bases` not being NULL](https://github.com/python/cpython/blob/cfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2/Objects/typeobject.c#L6977) in `type_ready_set_bases`, which is called from `PyType_Ready`.\r\n\r\nnumpy sets `tp_bases` manually before calling `PyType_Ready`, which means that the afore-mentioned check succeeds, and so, [the line that sets `ob_type`](https://github.com/python/cpython/blob/cfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2/Objects/typeobject.c#L7012) does not get executed (it used to before #103912), which leads to a segmentation fault [later on, when trying to set `mro`](https://github.com/python/cpython/blob/cfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2/Objects/typeobject.c#L2152).\r\n\r\nThis looks like a bug, but I'm not sure whether that's expected and numpy should be adjusted. If the latter is true, should a note be added in the `What's new` document?\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-105122\n* gh-105211\n* gh-105225\n* gh-105248\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/lysnikolaou","@type":"Person","name":"lysnikolaou"},"datePublished":"2023-05-18T15:50:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/104614/cpython/issues/104614"}
| 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:e29d6691-2e41-0c8f-abc9-5338759efdb4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ADB6:A74F2:103B3DC:15974C7:6969928A |
| html-safe-nonce | 995ce2691e2c61673d3390deaa07d4e07cf1d7966e256e911d501635885a0982 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREI2OkE3NEYyOjEwM0IzREM6MTU5NzRDNzo2OTY5OTI4QSIsInZpc2l0b3JfaWQiOiI2MTMwMjM1MDY3MDU0MjY0OTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 774e2c0452dcf76368ca18bf821039c25daf54a4c73f581ba96783436de6774f |
| hovercard-subject-tag | issue:1715864900 |
| 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/104614/issue_layout |
| twitter:image | https://opengraph.githubassets.com/04805eed51ce4f731198deb9d6b7ee4d9c918c184f750dc99d3ae4a590a90b96/python/cpython/issues/104614 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/04805eed51ce4f731198deb9d6b7ee4d9c918c184f750dc99d3ae4a590a90b96/python/cpython/issues/104614 |
| og:image:alt | Bug report This came up while testing numpy on 3.12. A bug report has been filed on numpy/numpy#23766. It's happening due to #103912, which introduced an additional check for tp_bases not being NUL... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lysnikolaou |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| 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 | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width