Title: Evaluation stack bounds are not checked in debug builds. · Issue #120982 · python/cpython · GitHub
Open Graph Title: Evaluation stack bounds are not checked in debug builds. · Issue #120982 · python/cpython
X Title: Evaluation stack bounds are not checked in debug builds. · Issue #120982 · python/cpython
Description: Bug report Bug description: Prior to the generating code for the interpreter(s), we had a set of macros for stack manipulation, PUSH, POP, etc. The code generator does not use these any more, which improves readability, but we have lost ...
Open Graph Description: Bug report Bug description: Prior to the generating code for the interpreter(s), we had a set of macros for stack manipulation, PUSH, POP, etc. The code generator does not use these any more, which...
X Description: Bug report Bug description: Prior to the generating code for the interpreter(s), we had a set of macros for stack manipulation, PUSH, POP, etc. The code generator does not use these any more, which...
Opengraph URL: https://github.com/python/cpython/issues/120982
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Evaluation stack bounds are not checked in debug builds.","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nPrior to the generating code for the interpreter(s), we had a set of macros for stack manipulation, `PUSH`, `POP`, etc.\r\nThe code generator does not use these any more, which improves readability, but we have lost the runtime checking of bounds.\r\nHaving those bounds checks would have identified the issue with #120793 almost immediately.\r\n\r\nWe should add bounds checking asserts in the generated code.\r\nE.g.\r\n`stack_pointer +=1` should be\r\n```\r\nstack_pointer += 1;\r\nassert(WITH_STACK_BOUNDS(stack_pointer));\r\n```\r\n\r\nThis bulks out the generated code a bit, but I think making the limit checks explicit is more readable than using stack adjustment macros.\r\n\r\n\r\n### CPython versions tested on:\r\n\r\nCPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-120992\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2024-06-25T07:35:36Z","url":"https://github.com/python/cpython/issues/120982"}
| 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:f0d94579-4de7-3f87-6679-141d58604ece |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C5F6:14EB6E:219B8B8:2C0540C:6B023C43 |
| html-safe-nonce | f9390f36e58fb0fe5d9211f689c20ad3bfc7f25cca880f4e5bc3c747bf660022 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUY2OjE0RUI2RToyMTlCOEI4OjJDMDU0MEM6NkIwMjNDNDMiLCJ2aXNpdG9yX2lkIjoiNjQ0MDEzNDk1NzY5NTM4NDY0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | be606199cbe46670e59836b35e1b18e9246fdc2f267fdb6a39c8b5579b24d6d4 |
| hovercard-subject-tag | issue:2371924825 |
| 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/120982/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b499a599409d89d3b366ea62658db2f6b55468cac07e7a2f20f34624412e84e1/python/cpython/issues/120982 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b499a599409d89d3b366ea62658db2f6b55468cac07e7a2f20f34624412e84e1/python/cpython/issues/120982 |
| og:image:alt | Bug report Bug description: Prior to the generating code for the interpreter(s), we had a set of macros for stack manipulation, PUSH, POP, etc. The code generator does not use these any more, which... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markshannon |
| 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