Title: Segfault on frame.f_back when frame is created with PyFrame_New() · Issue #99110 · python/cpython · GitHub
Open Graph Title: Segfault on frame.f_back when frame is created with PyFrame_New() · Issue #99110 · python/cpython
X Title: Segfault on frame.f_back when frame is created with PyFrame_New() · Issue #99110 · python/cpython
Description: Python segfaults when frame.f_back is accessed on a frame created with PyFrame_New() c api. Calling the PyFrame_GetBack() c api also segfaults, at least in debug builds and on win32 (it depends on the contents of uninitialized memory). T...
Open Graph Description: Python segfaults when frame.f_back is accessed on a frame created with PyFrame_New() c api. Calling the PyFrame_GetBack() c api also segfaults, at least in debug builds and on win32 (it depends on ...
X Description: Python segfaults when frame.f_back is accessed on a frame created with PyFrame_New() c api. Calling the PyFrame_GetBack() c api also segfaults, at least in debug builds and on win32 (it depends on ...
Opengraph URL: https://github.com/python/cpython/issues/99110
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Segfault on frame.f_back when frame is created with PyFrame_New()","articleBody":"Python segfaults when frame.f_back is accessed on a frame created with PyFrame_New() c api. Calling the PyFrame_GetBack() c api also segfaults, at least in debug builds and on win32 (it depends on the contents of uninitialized memory). Tested with 3.11.0 and git 3.11 branch as of Nov 4, 2022\r\n\r\nCause is that the -\u003eprevious field of the _PyInterpreterFrame is never set to NULL and when PyFrame_GetBack() runs, it tries to dereference the pointer value of -\u003eprevious and segfaults. A test case using ctypes is attached.\r\n\r\nAdding a frame-\u003eprevious = NULL; line to init_frame() in frameobject.c fixes this, though I don't know if it's the best place for it.\r\n\r\n[f_back_segfault.py.txt](https://github.com/python/cpython/files/9942212/f_back_segfault.py.txt)\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-100182\n* gh-100478\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/jpe","@type":"Person","name":"jpe"},"datePublished":"2022-11-04T22:01:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/99110/cpython/issues/99110"}
| 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:aff1175a-5553-7bf5-ce08-bc267dc176cf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B504:22117D:B651E8:FE0013:6968DB3E |
| html-safe-nonce | f1b749b3fd311864992539bdfef9a165ca6f88f5e9dea6644a26f6a5db0a1c06 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTA0OjIyMTE3RDpCNjUxRTg6RkUwMDEzOjY5NjhEQjNFIiwidmlzaXRvcl9pZCI6Ijc5ODgzMDE0NTA0NjAwNjA0NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2b0a5e6dc0d32620d1e094107bf71d1cd96609a54ddaceffbf478ac662139113 |
| hovercard-subject-tag | issue:1436683816 |
| 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/99110/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc93e8836da3b686be87ed6d03f506b2fdfab0e34bfb35e2585636f03a80ffc8/python/cpython/issues/99110 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc93e8836da3b686be87ed6d03f506b2fdfab0e34bfb35e2585636f03a80ffc8/python/cpython/issues/99110 |
| og:image:alt | Python segfaults when frame.f_back is accessed on a frame created with PyFrame_New() c api. Calling the PyFrame_GetBack() c api also segfaults, at least in debug builds and on win32 (it depends on ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jpe |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3c4e9f2fc1db52c609205138be6a397cfde4574cb54d53015014de30dd49f27e |
| 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 | 1fb1ea11f8c37dd4dd50347cca70d89824e93788 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width