Embedded python debug build crashing.

A

Adam Tomjack

I'm trying to embed Python 2.3.5 into a C++ application on Windows XP.
When I build my app with debug symbols and link to a debug build of
Python, then my program seems to crash most (but not all) of the time.
Sometimes it crashes on startup, and sometimes at exit, sometimes not at
all. I haven't seen it crash with non-debug builds of my app and
Python. The release build runs my Python test code just fine. When the
debug build doesn't crash at startup, it gets through some, but not all
of my test code. It still crashes even if I only run Py_Intialize() and
Py_Finalize(). My app is multithreaded, but Python only runs in the
main thread.


I use Visual Studio .NET 2003 7.1. If I understand things correctly,
that means I need to recompile Python, since the prebuilt binaries are
compiled with MSVC 6. I've compiled both debug and non-debug versions
of Python. I'm sure that I'm linking my app to the correct build type.
I'm also pretty sure that I'm setting the PYTHONHOME environment
variable correctly so that my app is trying to use the right Python
runtime. Windows has a trick where, if my app's executable is called
app.exe, then the presence of a file called app.exe.local in the same
directory will force my app to use local copies of DLLs first. I've
used that, so I'm pretty sure I'm not accidentally using the wrong DLLs
at runtime.


I've googled and couldn't find any similar problems. Is there something
simple I'm forgetting to do? I'm out of ideas. Does anybody have any
ideas about how to attack this problem?

Thanks,

Adam Tomjack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top