Title: Memory leak when reading co_code attribute of deepfrozen code objects · Issue #93728 · python/cpython · GitHub
Open Graph Title: Memory leak when reading co_code attribute of deepfrozen code objects · Issue #93728 · python/cpython
X Title: Memory leak when reading co_code attribute of deepfrozen code objects · Issue #93728 · python/cpython
Description: Reproducer: import os os.path.join.__code__.co_code Relevant Valgrind Report: ==21416== HEAP SUMMARY: ==21416== in use at exit: 397 bytes in 1 blocks ==21416== total heap usage: 19,728 allocs, 19,727 frees, 2,629,532 bytes allocated ==21...
Open Graph Description: Reproducer: import os os.path.join.__code__.co_code Relevant Valgrind Report: ==21416== HEAP SUMMARY: ==21416== in use at exit: 397 bytes in 1 blocks ==21416== total heap usage: 19,728 allocs, 19,7...
X Description: Reproducer: import os os.path.join.__code__.co_code Relevant Valgrind Report: ==21416== HEAP SUMMARY: ==21416== in use at exit: 397 bytes in 1 blocks ==21416== total heap usage: 19,728 allocs, 19,7...
Opengraph URL: https://github.com/python/cpython/issues/93728
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Memory leak when reading co_code attribute of deepfrozen code objects ","articleBody":"Reproducer:\r\n```py\r\nimport os\r\nos.path.join.__code__.co_code\r\n```\r\n\r\nRelevant Valgrind Report:\r\n```console\r\n==21416== HEAP SUMMARY:\r\n==21416== in use at exit: 397 bytes in 1 blocks\r\n==21416== total heap usage: 19,728 allocs, 19,727 frees, 2,629,532 bytes allocated\r\n==21416== \r\n==21416== 397 bytes in 1 blocks are still reachable in loss record 1 of 1\r\n==21416== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==21416== by 0x2FA6DD: _PyMem_RawMalloc (obmalloc.c:101)\r\n==21416== by 0x2FC5CD: PyObject_Malloc (obmalloc.c:713)\r\n==21416== by 0x287BDC: _PyBytes_FromSize (bytesobject.c:103)\r\n==21416== by 0x2881A6: PyBytes_FromStringAndSize (bytesobject.c:136)\r\n==21416== by 0x29F609: _PyCode_GetCode (codeobject.c:1374)\r\n==21416== by 0x29F69B: code_getcode (codeobject.c:1728)\r\n==21416== by 0x2A31B2: getset_get (descrobject.c:202)\r\n==21416== by 0x2F86E6: _PyObject_GenericGetAttrWithDict (object.c:1269)\r\n==21416== by 0x2F8F14: PyObject_GenericGetAttr (object.c:1357)\r\n==21416== by 0x2F9864: PyObject_GetAttr (object.c:912)\r\n==21416== by 0x3B5B16: _PyEval_EvalFrameDefault (ceval.c:3472)\r\n==21416== \r\n==21416== LEAK SUMMARY:\r\n==21416== definitely lost: 0 bytes in 0 blocks\r\n==21416== indirectly lost: 0 bytes in 0 blocks\r\n==21416== possibly lost: 0 bytes in 0 blocks\r\n==21416== still reachable: 397 bytes in 1 blocks\r\n==21416== suppressed: 0 bytes in 0 blocks\r\n==21416== \r\n\r\n```\r\n This is a 3.12 only regression caused by #93382.","author":{"url":"https://github.com/kumaraditya303","@type":"Person","name":"kumaraditya303"},"datePublished":"2022-06-11T16:03:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/93728/cpython/issues/93728"}
| 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:f59c1763-b128-a78a-671f-8b6b958739ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8BC4:1EAB80:532497:6EE973:6969C9D3 |
| html-safe-nonce | 175ad79dec13afe4ed2e01199ddc21b7e54abea7c226166a71bebd255e896a4c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkM0OjFFQUI4MDo1MzI0OTc6NkVFOTczOjY5NjlDOUQzIiwidmlzaXRvcl9pZCI6IjYzNjAyNTI3Mjc3ODYzMjY0ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 66731970e3d64b3e4da9d486cca8944cc6bc09386e55075ade4167d65f49916d |
| hovercard-subject-tag | issue:1268312551 |
| 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/93728/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b0559e64155f79503961c295f1c58af9fcd3381687a5b076b07af84de54290d7/python/cpython/issues/93728 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b0559e64155f79503961c295f1c58af9fcd3381687a5b076b07af84de54290d7/python/cpython/issues/93728 |
| og:image:alt | Reproducer: import os os.path.join.__code__.co_code Relevant Valgrind Report: ==21416== HEAP SUMMARY: ==21416== in use at exit: 397 bytes in 1 blocks ==21416== total heap usage: 19,728 allocs, 19,7... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kumaraditya303 |
| 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