473,805 Members | 1,978 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 2907
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*********@gm ail.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
2217
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
2687
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, foo(a, b, c, d, e). The last argument, e, is an integer that serves as a bit coded options flag. ...
5
7802
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 one of our application software,
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). By the way I’ve an HP Pavillion with Intel Core 2 Duo 2.0Ghz processor, and my OS is Windows Vista...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10607
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10364
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6875
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.