This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Karemir
Recipients Karemir
Date 2007-10-20.13:35:08
SpamBayes Score 0.015753524
Marked as misclassified No
Message-id <1192887310.11.0.424828418654.issue1306@psf.upfronthosting.co.za>
In-reply-to
Content
Hi, 
I'm embedding stackless python in a c++ application under linux. When I 
try to Finalize and Initialize again, I'm getting errors. this is a 
sample code that doesn't work:

int main() {
        Py_Initialize();
        Py_Finalize();
        Py_Initialize();
        Py_Finalize();
}

Second call to Init throws out a nice Segmentation Fault. Here's a 
stack trace:

PyDict_SetItem (op=0x0, key=0x2aaaaab1a4c8, value=0x6bab20) at 
Objects/dictobject.c:616
616             if (!PyDict_Check(op)) {
Current language:  auto; currently c
(gdb) bt
#0  PyDict_SetItem (op=0x0, key=0x2aaaaab1a4c8, value=0x6bab20) at 
Objects/dictobject.c:616
#1  0x0000000000476ac9 in PyDict_SetItemString (v=0x0, 
key=Variable "key" is not available.
) at Objects/dictobject.c:2178
#2  0x00000000004ea77f in PyErr_PrintEx (set_sys_last_vars=1) at 
Python/pythonrun.c:1098
#3  0x00000000004ebfb9 in Py_InitializeEx (install_sigs=1) at 
Python/pythonrun.c:995
#4  0x000000000044a8cc in main () at main.cpp:23

I'm using gcc 3.4.6, and Python 2.5.1 Stackless 3.1b3.
History
Date User Action Args
2007-10-20 13:35:10Karemirsetspambayes_score: 0.0157535 -> 0.015753524
recipients: + Karemir
2007-10-20 13:35:10Karemirsetspambayes_score: 0.0157535 -> 0.0157535
messageid: <1192887310.11.0.424828418654.issue1306@psf.upfronthosting.co.za>
2007-10-20 13:35:09Karemirlinkissue1306 messages
2007-10-20 13:35:08Karemircreate