Title: The JIT's "pure" `_BINARY_OP` evaluation produces UB (and incorrect results) · Issue #136183 · python/cpython · GitHub
Open Graph Title: The JIT's "pure" `_BINARY_OP` evaluation produces UB (and incorrect results) · Issue #136183 · python/cpython
X Title: The JIT's "pure" `_BINARY_OP` evaluation produces UB (and incorrect results) · Issue #136183 · python/cpython
Description: Crash report This code snippet crashes when the JIT is enabled: for _ in range(4096): 2 ** 65 I believe this is caused by GH-132733. Specifically, the abstract interpreter generator "thinks" that the operation itself can escape, and spil...
Open Graph Description: Crash report This code snippet crashes when the JIT is enabled: for _ in range(4096): 2 ** 65 I believe this is caused by GH-132733. Specifically, the abstract interpreter generator "thinks" that t...
X Description: Crash report This code snippet crashes when the JIT is enabled: for _ in range(4096): 2 ** 65 I believe this is caused by GH-132733. Specifically, the abstract interpreter generator "thinks&qu...
Opengraph URL: https://github.com/python/cpython/issues/136183
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The JIT's \"pure\" `_BINARY_OP` evaluation produces UB (and incorrect results)","articleBody":"# Crash report\n\nThis code snippet crashes when the JIT is enabled:\n\n```py\nfor _ in range(4096):\n 2 ** 65\n```\n\nI believe this is caused by GH-132733. Specifically, the abstract interpreter generator \"thinks\" that the operation itself can escape, and spills `res` to the stack before it has been defined:\n\nhttps://github.com/python/cpython/blob/93809a918f3a2853e8a191b84ad844c722bee2f5/Python/optimizer_cases.c.h#L2726\n\nIt also never writes the actual result to the stack once it has been computed, leaving the garbage value in its place.\n\nThe fix is probably to teach the code generator that nothing using this \"pure\" constant evaluation mechanism can escape.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-136184\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/brandtbucher","@type":"Person","name":"brandtbucher"},"datePublished":"2025-07-01T15:38:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/136183/cpython/issues/136183"}
| 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:73351970-5070-3310-0b1a-ba74ef730c9b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8370:6834D:2C9001C:3BE4916:69707D86 |
| html-safe-nonce | bd81ff3391ffef82a06ec7adec412dae0f8b1ee9577c4d59b4b3b4b5957a31fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzcwOjY4MzREOjJDOTAwMUM6M0JFNDkxNjo2OTcwN0Q4NiIsInZpc2l0b3JfaWQiOiI5MjE1MTEzMTA4NTcxMzIzNzgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dfcd45a15a2d4adac9293504cb74fe3c319deee93fc45ffa170f0741f4d71955 |
| hovercard-subject-tag | issue:3192962615 |
| 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/136183/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9d12f0df75e3ca48dff414167a3fc5915dc605f2b8ecc978a5131227e8e65381/python/cpython/issues/136183 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9d12f0df75e3ca48dff414167a3fc5915dc605f2b8ecc978a5131227e8e65381/python/cpython/issues/136183 |
| og:image:alt | Crash report This code snippet crashes when the JIT is enabled: for _ in range(4096): 2 ** 65 I believe this is caused by GH-132733. Specifically, the abstract interpreter generator "thinks" that t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | brandtbucher |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| 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 | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width