Title: Crash with an evil custom `mro()` on a metaclass · Issue #92112 · python/cpython · GitHub
Open Graph Title: Crash with an evil custom `mro()` on a metaclass · Issue #92112 · python/cpython
X Title: Crash with an evil custom `mro()` on a metaclass · Issue #92112 · python/cpython
Description: Crash report There is a path in type_mro_modified that results in double-free of *mro_meth: cpython/Objects/typeobject.c Line 362 in ad5e852 Py_XDECREF(mro_meth); cpython/Objects/typeobject.c Line 371 in ad5e852 goto clear; A reproducer:...
Open Graph Description: Crash report There is a path in type_mro_modified that results in double-free of *mro_meth: cpython/Objects/typeobject.c Line 362 in ad5e852 Py_XDECREF(mro_meth); cpython/Objects/typeobject.c Line ...
X Description: Crash report There is a path in type_mro_modified that results in double-free of *mro_meth: cpython/Objects/typeobject.c Line 362 in ad5e852 Py_XDECREF(mro_meth); cpython/Objects/typeobject.c Line ...
Opengraph URL: https://github.com/python/cpython/issues/92112
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash with an evil custom `mro()` on a metaclass","articleBody":"**Crash report**\r\n\r\nThere is a path in `type_mro_modified` that results in double-free of `*mro_meth`:\r\n* https://github.com/python/cpython/blob/ad5e8520f3e117f45481513014548a39879d30d2/Objects/typeobject.c#L362\r\n* https://github.com/python/cpython/blob/ad5e8520f3e117f45481513014548a39879d30d2/Objects/typeobject.c#L371\r\n\r\nA reproducer:\r\n```\r\nclass B:\r\n pass\r\n\r\nclass M(type):\r\n def mro(cls):\r\n del M.mro\r\n return (B,)\r\n\r\nclass C(metaclass=M):\r\n pass\r\n```\r\n\r\nCrash with the debug CPython:\r\n```\r\n$ ./python mro-crasher.py\r\n/home/test/cpython/Include/object.h:601: _Py_NegativeRefcount: Assertion failed: object has negative ref count\r\n\u003cobject at 0x7f88c12d1a90 is freed\u003e\r\nFatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed\r\nPython runtime state: initialized\r\n\r\nCurrent thread 0x00007f88c13cb080 (most recent call first):\r\n File \"/home/test/mro-crasher.py\", line 9 in \u003cmodule\u003e\r\nAborted (core dumped)\r\n```\r\n\r\nThis bug was introduced in #73052.","author":{"url":"https://github.com/izbyshev","@type":"Person","name":"izbyshev"},"datePublished":"2022-05-01T10:55:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/92112/cpython/issues/92112"}
| 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:7e62bc29-559b-c6b5-e139-9a7aafdce69e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E8C0:1348C2:232DB9:2FEE87:6969CB62 |
| html-safe-nonce | 1137445fa925189fcc844358944181b06ae76c549821d1242e586a6e20d9bbdc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEMwOjEzNDhDMjoyMzJEQjk6MkZFRTg3OjY5NjlDQjYyIiwidmlzaXRvcl9pZCI6IjQyNDc2MzUxOTkwOTM0OTI1NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 14261e79ebbde54dceb25c67c2d88f9e685e0ff444fcf9db62a889f4b17ee659 |
| hovercard-subject-tag | issue:1222112753 |
| 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/92112/issue_layout |
| twitter:image | https://opengraph.githubassets.com/421a638e882a0c505782ddbeb2515ed030338a1f56ab65cc7673e973f31a2c6b/python/cpython/issues/92112 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/421a638e882a0c505782ddbeb2515ed030338a1f56ab65cc7673e973f31a2c6b/python/cpython/issues/92112 |
| og:image:alt | Crash report There is a path in type_mro_modified that results in double-free of *mro_meth: cpython/Objects/typeobject.c Line 362 in ad5e852 Py_XDECREF(mro_meth); cpython/Objects/typeobject.c Line ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | izbyshev |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| 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 | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width