Hi,
On Fri, Jan 10, 2014 at 3:24 PM, Angus Griffith <
16s...@gmail.com> wrote:
> Perhaps there is another keepalive issue. Any tips on how to hunt these
> down?
Here's how I found the previous bug. Try to run it on CPython.
Download CFFI, and compile the _cffi_backend module with
-DCFFI_MEM_DEBUG or -DCFFI_MEM_LEAK (see steps below.) Then use gdb
when running.
$ cd c
$ gcc -pthread -DUSE__THREAD -fno-strict-aliasing -g -fwrapv -Wall
-Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c _cffi_backend.c
-o _cffi_backend.o -I/usr/include/libffi -DCFFI_MEM_DEBUG
$ gcc -pthread -DUSE__THREAD -shared _cffi_backend.o -o
../_cffi_backend.so -lffi -g
Also, I'd recommend that you understand exactly (if needed obviously
:-) why it crashed, and then review the code with this in mind. In
particular, calls similar to mpfr._from_c_mpfr() are all potentially
dangerous: you have to make very sure that the cdata pointer points to
memory that stays alive as long as the new object.
A bientôt,
Armin.