Xinmeng Xia <xi...@smail.nju.edu.cn> added the comment:

A simpler example to reproduce it:
test.py
========================================
import threading
import ctypes
from test import test_code

def test_free_different_thread():
    f = test_code.CoExtra().get_func()

    class ThreadTest(threading.Thread):
        def __init__(CoExtra, f, test):
            f.test = f

    test_code.SetExtra(f.__code__, test_code.FREE_INDEX, ctypes.c_voidp(500))
    tt = ThreadTest(f, f)
    test_code.CoExtra().assertEqual(test_code.LAST_FREED, 500)

test_free_different_thread()
========================================

Just run test.py on Ubuntu 18.04 and you can observe the crash.
version of Python: Python3.11.0a4

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45860>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to