472,973 Members | 2,416 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 2858
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
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...
2
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...
5
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...
0
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...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.