Skip to content

JIT Assertion failure _POP_TOP_INT.c:119: _Py_CODEUNIT *_JIT_ENTRY(_PyInterpreterFrame *, _PyStackRef *, PyThreadState *): Assertion 'PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value))' failed #142276

Description

@YuanchengJiang

Crash report

What happened?

from concurrent.futures import ThreadPoolExecutor
from unittest import TestCase
NTHREADS = 6
BOTTOM = 0
TOP = 0xffffffffffffffff
class A:
    attr = 10**1000
class TestType(TestCase):
        def read(id0):
                for _ in range(BOTTOM, TOP):
                    A.attr
        def write(id0):
                    x = A.attr
                    x += 1
                    A.attr = x
        with ThreadPoolExecutor(NTHREADS) as pool:
            pool.submit(read, (1,))
            pool.submit(write, (1,))
python: _POP_TOP_INT.c:119: _Py_CODEUNIT *_JIT_ENTRY(_PyInterpreterFrame *, _PyStackRef *, PyThreadState *): Assertion `PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value))' failed.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

Linked PRs

Activity

  1. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Dec 5, 2025
  2. Fidget-Spinner commented on Dec 5, 2025

    @Fidget-Spinner
    Member

    This is a real bug. I can reproduce it too. Thank you.

  3. added a commit that references this issue on Dec 8, 2025
  4. Fidget-Spinner commented on Dec 8, 2025

    @Fidget-Spinner
    Member

    Thanks again for the reproducer! This was an interesting one.

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

Metadata

Metadata

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-JITtype-crashA 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