GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — The JIT's "pure" `_BINARY_OP` evaluation produces UB (and incorrect results) · Issue #136183 · python/cpython

The JIT's "pure" _BINARY_OP evaluation produces UB (and incorrect results) #136183

New issue
Copy link
New issue
Copy link
Closed
Closed
The JIT's "pure" _BINARY_OP evaluation produces UB (and incorrect results)#136183
Copy link
Labels
3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-JITtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@brandtbucher
brandtbucher
opened on Jul 1, 2025
Issue body actions

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 spills res to the stack before it has been defined:

cpython/Python/optimizer_cases.c.h

Line 2726 in 93809a9

stack_pointer[-2] = res;

It also never writes the actual result to the stack once it has been computed, leaving the garbage value in its place.

The fix is probably to teach the code generator that nothing using this "pure" constant evaluation mechanism can escape.

Linked PRs

  • gh-136183: Deal with escapes in JIT optimizer's constant evaluator #136184

Activity

  1. brandtbucher
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    topic-JIT
    3.15bugs and security fixesbugs and security fixes
    on Jul 1, 2025
  2. Fidget-Spinner
    added a commit that references this issue on Jul 2, 2025

    gh-136183: Deal with escapes in JIT optimizer's constant evaluator (G…

    b330897
  3. Fidget-Spinner
    closed this as completedon Jul 2, 2025
  4. AndPuQing
    added a commit that references this issue on Jul 11, 2025

    pythongh-136183: Deal with escapes in JIT optimizer's constant evalua…

    811b391
  5. Pranjal095
    added a commit that references this issue on Jul 12, 2025

    pythongh-136183: Deal with escapes in JIT optimizer's constant evalua…

    c2d1ca8
  6. picnixz
    added a commit that references this issue on Jul 13, 2025

    pythongh-136183: Deal with escapes in JIT optimizer's constant evalua…

    52b868c
  7. taegyunkim
    added a commit that references this issue on Aug 4, 2025

    pythongh-136183: Deal with escapes in JIT optimizer's constant evalua…

    2ab40c0
  8. Agent-Hellboy
    added a commit that references this issue on Aug 19, 2025

    pythongh-136183: Deal with escapes in JIT optimizer's constant evalua…

    94d02f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-JITtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.