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 — code objects remove unknown opcodes from the instruction stream when accessing `co_code` · Issue #128045 · python/cpython

code objects remove unknown opcodes from the instruction stream when accessing co_code #128045

New issue
Copy link
New issue
Copy link
Closed
Closed
code objects remove unknown opcodes from the instruction stream when accessing co_code#128045
Copy link
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@DinoV
DinoV
opened on Dec 17, 2024
Issue body actions

Bug report

Bug description:

If you construct a code object with an unknown opcode it'll get removed when the code object goes through the opcodes to de-opt them. We should just ignore unknown opcodes instead.

CPython versions tested on:

3.12, 3.14

Operating systems tested on:

Linux

Linked PRs

  • gh-128045: Mark unknown opcodes as deopting to themselves #128044
  • [3.14] gh-128045: Mark unknown opcodes as deopting to themselves (GH-128044) #134228
  • gh-128045: Syncs w/ latest opcode metadata #134231

Activity

  1. DinoV
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Dec 17, 2024
  2. picnixz
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    3.12only security fixesonly security fixes
    3.13only security fixesonly security fixes
    3.14bugs and security fixesbugs and security fixes
    on Dec 17, 2024
  3. markshannon commented on Dec 20, 2024

    @markshannon
    markshannon
    on Dec 20, 2024
    Member
    More actions

    Constructing a code object with an unknown opcode seems like a bug to me.

    I presume this is for Cinder.
    Is there a way to make this work for Cinder, without making CPython less resilient?

  4. DinoV commented on Jan 29, 2025

    @DinoV
    DinoV
    on Jan 29, 2025
    ContributorAuthor
    More actions

    The problem here is that this is related to our extension of the interpreter loop, so the opcodes are known to us, but unknown to the code object. I suppose we could open these tables up and allow someone to say "these are known opcodes" but I'm not sure that's an improvement.

    Also we're not doing anything like "reject code objects with unknown opcodes", instead they're just silently turning into 0's which doesn't seem like it's being very resilient in the first place.

  5. DinoV
    added a commit that references this issue on May 19, 2025

    gh-128045: Mark unknown opcodes as deopting to themselves (#128044)

    cc9add6
  6. miss-islington
    added a commit that references this issue on May 19, 2025

    pythongh-128045: Mark unknown opcodes as deopting to themselves (pyth…

    215207e
  7. DinoV
    added 2 commits that reference this issue on May 19, 2025

    gh-128045: Syncs w/ latest opcode metadata (#134231)

    3fa30d9

    [3.14] gh-128045: Mark unknown opcodes as deopting to themselves (GH-…

    c869898
  8. DinoV
    closed this as completedon May 19, 2025
  9. Pranjal095
    added 2 commits that reference this issue on Jul 12, 2025

    pythongh-128045: Mark unknown opcodes as deopting to themselves (pyth…

    76d7013

    pythongh-128045: Syncs w/ latest opcode metadata (python#134231)

    1981cf6
  10. taegyunkim
    added 2 commits that reference this issue on Aug 4, 2025

    pythongh-128045: Mark unknown opcodes as deopting to themselves (pyth…

    499aebc

    pythongh-128045: Syncs w/ latest opcode metadata (python#134231)

    20a2cc1
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.12only security fixesonly security fixes3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    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.