Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
Closed
Description
It seems thatctypes doesn't like having function pointers on aCDLL modified concurrently. Here's a reproducer (for Linux):
importctypesfromthreadingimportThreaddll=ctypes.CDLL("libc.so.6")defmain():for_inrange(100):dll.puts.argtypes=ctypes.c_char_p,dll.puts.restype=ctypes.c_intthreads= [Thread(target=main)for_inrange(100)]forthreadinthreads:thread.start()