473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Embedded python debug build crashing.

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
Aug 27 '05 #1
0 1494

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: John Underwood | last post by:
Can I use python23_d and python23 to develop an extension for a commercial application uses python22.dll? (Providing that I do not use any new features found only in 2.3.) I would bulld version...
13
by: Alexander May | last post by:
Hi, I love Python! I've been using it for a couple of years now and have found it to be a highly productive language. I evangelize it to my developer friends and am probably responsible for...
5
by: Fuzzyman | last post by:
Python 2.4 is built with Microsoft Visiual C++ 7. This means that it uses msvcr7.dll, which *isn't* a standard part of the windows operating system. This means that if you build a windows installer...
14
by: Java and Swing | last post by:
static PyObject *wrap_doStuff(PyObject *self, PyObject *args) { // this will store the result in a Python object PyObject *finalResult; // get arguments from Python char *result = 0; char *in=...
1
by: Peter Newman | last post by:
I'm embedding a Python interpreter into a project, and compiling with MSVC. It all runs great in the "Debug" configuration, but everything gets scary when I switch to "Release". I've read about...
8
by: Brennus | last post by:
I have a dll/so which embeds python. I can verify it works by compiling it as an executable and adding an appropriate main. I tried to write unit tests for this library with ctypes and a simple...
2
by: Jim | last post by:
I am trying to figure out how to embed Python in a little C++ Windows console app. Here's the code: // Py_Initialize(); Py_InitializeEx(0); PyRun_SimpleString("from win32com.client import *");...
0
by: ycollet | last post by:
Hello, I'm trying to write a program to send python statements to a python server via tcp and then get back results via a tcp connection. It nearly works ... but I'm totally lost with the...
4
by: Chris8Boyd | last post by:
I am embedding Python in a MSVC++ (2005) application. The application creates some environment and then launches a Python script that will call some functions exported from the MSVC++ application....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.