473,516 Members | 2,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

debugging program that uses ctypes

hi all, I have a python program that calls a dll through ctypes
(py2.5). In some (reproducible)
conditions the program crashes with an error in ctypes module.
How can I trace down the problem? I have created a debug build of
python but I also use pyodbc
and dateutil libraries in my program and I don't know how to make them
visible to python_d.exe
Am I using the right approach?

thanks in advance for hints,
Marco

Sep 7 '07 #1
2 2884
ma*******@yahoo.it schrieb:
hi all, I have a python program that calls a dll through ctypes
(py2.5). In some (reproducible)
conditions the program crashes with an error in ctypes module.
You mean a segfault?
How can I trace down the problem? I have created a debug build of
python but I also use pyodbc
and dateutil libraries in my program and I don't know how to make them
visible to python_d.exe
Am I using the right approach?
I would say yes. It seems you are using windows - running debug builds of
python on windows start a dialog box that allows to attach the MSVC debugger
to the running program. Usually this allows to locate the error fairly quickly.

As you have discovered, the problem is that you need to build all the extensions
that you use in debug mode otherwise you cannot use them.

If you cannot rebuild the extensions you have to reproduce the crash in
a script that doesn't use these extensions.

Thomas

Sep 7 '07 #2
Hello Marco,
hi all, I have a python program that calls a dll through ctypes
(py2.5). In some (reproducible)
conditions the program crashes with an error in ctypes module.
How can I trace down the problem? I have created a debug build of
python but I also use pyodbc
and dateutil libraries in my program and I don't know how to make them
visible to python_d.exe
Am I using the right approach?
If you are the one compiling the called module, you can add `__asm int
3` somewhere in
the code. When this is reached, the windows debugger will pop up on
the line.

HTH,
--
Miki <mi*********@gmail.com>
http://pythonwise.blogspot.com

Sep 9 '07 #3

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

Similar topics

8
2200
by: razael1 | last post by:
I am putting debugging messages into my program by putting blocks that look like this: #ifdef DEBUG errlog << "Here is some information"; #endif All these #ifdef blocks make the code bulky and harder to read, so I'd like to do something where I put: errMsg("Here is some information");
2
2663
by: gap | last post by:
I'm no c programmer, and I'm a ctypes newbie. I'll frame my problem as simply as I can. Sorry if it's too much or not enough info. I don't expect an explicit answer (but maybe), just help figuring out how to debug. WinXP, python 2.4.2 I'm using ctypes to access functions in a commercial dll. A certain function takes five arguments,...
5
7777
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an app.config file referencing arbitrary versions of the plug-in components they wish to consume. Here's the problem: Assuming I have installed any...
0
379
by: stimpy_cm | last post by:
Hi everyone, I’m not a programmer but have a little notion about how things work. I recently downloaded an emulator for my calculator (Texas Instruments Voyage 200), the program uses a library created for .Net framework 1.0 and 1.1. I also activated the compatibility mode for Windows XP SP2 (Which it was the OS the programs were created for)....
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4773
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.