Title: Crash when detaching dict from inline values and no memory is available · Issue #124547 · python/cpython · GitHub
Open Graph Title: Crash when detaching dict from inline values and no memory is available · Issue #124547 · python/cpython
X Title: Crash when detaching dict from inline values and no memory is available · Issue #124547 · python/cpython
Description: Bug report Bug description: Add to test_class.py in TestInlineValues: def test_detach_materialized_dict_no_memory(self): a = WithAttrs() d = a.__dict__ _testcapi.set_nomemory(0) del a print(d["a"]) This will crash because the dictionary ...
Open Graph Description: Bug report Bug description: Add to test_class.py in TestInlineValues: def test_detach_materialized_dict_no_memory(self): a = WithAttrs() d = a.__dict__ _testcapi.set_nomemory(0) del a print(d["a"])...
X Description: Bug report Bug description: Add to test_class.py in TestInlineValues: def test_detach_materialized_dict_no_memory(self): a = WithAttrs() d = a.__dict__ _testcapi.set_nomemory(0) del a print(d["...
Opengraph URL: https://github.com/python/cpython/issues/124547
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash when detaching dict from inline values and no memory is available","articleBody":"# Bug report\n\n### Bug description:\n\nAdd to `test_class.py` in `TestInlineValues`:\n\n```python\n def test_detach_materialized_dict_no_memory(self):\n a = WithAttrs()\n d = a.__dict__\n _testcapi.set_nomemory(0)\n del a\n print(d[\"a\"])\n\n```\nThis will crash because the dictionary will no longer points to valid memory:\n```\n#0 Py_XINCREF (op=\u003cunknown at remote 0xdddddddddddddddd>) at ./Include/refcount.h:456\n#1 _Py_XNewRef (obj=\u003cunknown at remote 0xdddddddddddddddd>) at ./Include/refcount.h:488\n#2 _Py_dict_lookup_threadsafe (mp=mp@entry=0x7ffff778ff50, key=key@entry='a', hash=\u003coptimized out>, value_addr=value_addr@entry=0x7fffffffb078) at Objects/dictobject.c:1544\n#3 0x0000000000518457 in dict_subscript (self={'b': \u003cunknown at remote 0xdddddddddddddddd>, 'd': \u003cunknown at remote 0xdddddddddddddddd>, 'a': \u003cunknown at remote 0xdddddddddddddddd>, 'c': \u003cunknown at remote 0xdddddddddddddddd>}, key='a')\n at Objects/dictobject.c:3325\n#4 0x000000000049d8c6 in PyObject_GetItem (o=o@entry={'b': \u003cunknown at remote 0xdddddddddddddddd>, 'd': \u003cunknown at remote 0xdddddddddddddddd>, 'a': \u003cunknown at remote 0xdddddddddddddddd>, 'c': \u003cunknown at remote 0xdddddddddddddddd>},\n key=key@entry='a') at Objects/abstract.c:158\n```\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-124627\n* gh-124714\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/DinoV","@type":"Person","name":"DinoV"},"datePublished":"2024-09-25T20:41:42Z","url":"https://github.com/python/cpython/issues/124547"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:183b799e-cc7e-85ec-95e0-3277e848e572 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C56E:2F543F:17B80E2:1F59BC3:6B020975 |
| html-safe-nonce | 47969a2b6859028946cbc05b6c0bdbdacd9e8818e01b37f10855acc2fecaddf0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTZFOjJGNTQzRjoxN0I4MEUyOjFGNTlCQzM6NkIwMjA5NzUiLCJ2aXNpdG9yX2lkIjoiOTkwOTAxNDQ1Nzc3ODIwMDIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ad4489134ce0931b35aa7325f5f98cc9c348a693b15ee04307710a962ea1cb39 |
| hovercard-subject-tag | issue:2548962069 |
| 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/124547/issue_layout |
| twitter:image | https://opengraph.githubassets.com/289b82b84b6d3d00df622f02a30c4c184d663a7d8805bec8ebfd4658c24d598a/python/cpython/issues/124547 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/289b82b84b6d3d00df622f02a30c4c184d663a7d8805bec8ebfd4658c24d598a/python/cpython/issues/124547 |
| og:image:alt | Bug report Bug description: Add to test_class.py in TestInlineValues: def test_detach_materialized_dict_no_memory(self): a = WithAttrs() d = a.__dict__ _testcapi.set_nomemory(0) del a print(d["a"])... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DinoV |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width