I'm trying to use a CFFI built extension in combination with
concurrent.futures.ThreadPoolExecutor. The initial code is here:
and to my knowledge is working correctly in the absence of threading. When adding a thread pool to the entry point in this code segfaults start occurring.
I started trying to poke around with little success so instead created a fairly minimal CFFI extension:
cffi_thread entry point here can produce non-deterministic results, though usually something like:
$ cffi_thread 0 b'news' 1 b'news' 2 b'news' 3 b'news' 4 b'news' 5 b'news' 6 b'news' 7 b'news' 8 b'news' 9 b'news'
cffi_nothread entry point gives the expected:
$ cffi_nothread 0 b'root' 1 b'daemon' 2 b'bin' 3 b'sys' 4 b'sync' 5 b'games' 6 b'man' 7 b'lp' 8 b'mail' 9 b'news'
I've checked previous issues, the only similar report seemed to be back from 2013. The lack of reports makes me think I've miss understood something. Have I or is this a bug in CFFI?