-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-ctypestopic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
It seems that ctypes
doesn't like having function pointers on a CDLL
modified concurrently. Here's a reproducer (for Linux):
import ctypes
from threading import Thread
dll = ctypes.CDLL("libc.so.6")
def main():
for _ in range(100):
dll.puts.argtypes = ctypes.c_char_p,
dll.puts.restype = ctypes.c_int
threads = [Thread(target=main) for _ in range(100)]
for thread in threads:
thread.start()
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-ctypestopic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump