Problem with uuid package when embedding a python interpreter
Hello, I've sent this message to the c.l.python newsgroup and someone pointed me to this mailing-list to find a solution. (http://groups.google.com/group/comp.lang.python/browse_thread/thread/346d6eb...)
I've tried to import a script in an embedded python intrepreter but this script fails when it imports the uuid module. I have a segmentation fault in Py_Finalize().
Here is a simple program which imitate my problem.
main.c :
#include "Python.h"
void test() { Py_Initialize(); PyImport_Import(PyString_FromString("uuid")); Py_Finalize();
}
main(int argc, char **argv) { for (i=0 ; i < 10; i++) test(); }
For my application, I have to call Py_initialize and Py_Finalize several times so factorizing them in the main function is not an easy solution for me.
The core which is produced gives me this error : Program terminated with signal 11, Segmentation fault. #0 0x00190ef6 in type_dealloc (type=0x291320) at Objects/typeobject.c: 2609 2609 _PyObject_GC_UNTRACK(type);
Thanks for your help Jerome
On Jul 2, 2009, at 9:30 AM, Jérôme Fuselier wrote:
Hello, I've sent this message to the c.l.python newsgroup and someone
pointed me to this mailing-list to find a solution. (http://groups.google.com/group/comp.lang.python/browse_thread/thread/346d6eb... )I've tried to import a script in an embedded python intrepreter but this script fails when it imports the uuid module. I have a segmentation fault in Py_Finalize().
Hi Jérôme,
Just a debugging idea -- does the same problem happen if you import
something other that the uuid module?
bye Philip
Here is a simple program which imitate my problem.
main.c :
#include "Python.h"
void test() { Py_Initialize(); PyImport_Import(PyString_FromString("uuid")); Py_Finalize();
}
main(int argc, char **argv) { for (i=0 ; i < 10; i++) test(); }
For my application, I have to call Py_initialize and Py_Finalize several times so factorizing them in the main function is not an easy solution for me.
The core which is produced gives me this error : Program terminated with signal 11, Segmentation fault. #0 0x00190ef6 in type_dealloc (type=0x291320) at Objects/ typeobject.c: 2609 2609 _PyObject_GC_UNTRACK(type);
Thanks for your help Jerome
capi-sig mailing list capi-sig@python.org http://mail.python.org/mailman/listinfo/capi-sig
participants (2)
-
Jérôme Fuselier
-
Philip Semanchuk