[Python-Dev] [4suite] cDomlette deallocation bug?
Jeremy Kloth
jeremy.kloth at 4suite.org
Wed Aug 23 17:21:27 CEST 2006
I'm CC python-dev as this may be a bug in the gc module. Although this may be
more of a c.l.p. post, I think that this usage shouldn't cause segfaults
regardless.
On Tuesday 22 August 2006 3:06 pm, Robert Fleming wrote:
> [step 1 unnecessary]
> 2. test program (test.c):
> /******** snip ********/
> #include <Python.h>
>
> #include <stdio.h>
>
> int main(int argc, char* argv[])
> {
> int i;
> for (i = 0; i<10; i++)
> {
> printf("%d\n", i);
>
> Py_Initialize();
> (void)PyRun_SimpleString("import sys\n"
> "sys.path.append('.')\n"
> "import cDomlettec");
Change the string to just "import gc" and the segfault still happens.
> Py_Finalize();
> }
>
> return EXIT_SUCCESS;
> }
> /****** snip ********/
>
> 3. compile with:
> gcc -I/usr/include/python2.4 test.c -lpython2.4
>
> 4. run program; output is:
> 0
> 1
> Segmentation fault
>
> Am I doing something wrong? I'm pretty new to embedding Python, but I'm
> hoping to be able to cleanly load and unload 4Suite this way
It just so happens that cDomlettec imports gc internally which, by the change
above shows, causes the segfault. Hopefully someone with more knowledge of
GC internals can comment on this.
--
Jeremy Kloth
http://4suite.org/
More information about the Python-Dev
mailing list