New issue 1865: cffi call keep alive bug
https://bitbucket.org/pypy/pypy/issue/1865/cffi-call-keep-alive-bug
Alex Gaynor:
If you have code that's like `lib.some_call({"key": ffi.new("char[]", "abc")})`
and multiple threads, sometimes your program will crash.
The reason is that cffi does not correctly keep the `char[]` alive. In
`_call()`, `convert_argument_from_object` will convert this to a struct, but
then the `dict` is dead, and if it's collected the `char[]` will also be
collected because nothing is keeping it alive.
_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue