[PyKDE] Debugging a segfault in Linux

Diez B. Roggisch deets at web.de
Fri Mar 17 14:38:15 GMT 2006


On Friday 17 March 2006 15:27, Mike Tammerman wrote:
> Hi,
>
> I'm trying to implement a distributed media player using twisted and
> pyqt. Sometimes, I am getting segfaults for the gui part. I am using
> custom widgets and I don't know if the reason of the problem is myself
> or pyqt or something else.
>
> I want to learn how to debug pyqt apps. Is there a practical way
> you're using? I am using ubuntu(breezy) and its pre-compiled packages.

You'll need debug-builds of whatever you can get one for - so most probably 
you should build every piece of the toolchain with debug information enabled.

Luckily you're on a debian-based system. That means that you can get the 
source-packages easily (apt-source or apt-get source). Fetch them with all 
dependencies. Then you can build the packages yourself - check out the 
<package>/debian/rules, ususally there are the configure-statements. Build 
with e.g. 

fakeroot debian/rules binary

Then install the packages.
When everything is set up, you can debug things using the gdb - just pass e.g. 
python as execuatbe like this

gdb python

gdb> set args <yourscript
gdb> run


That all ist just a rough sketch, atop of my head. But it should give you some 
pointesr I hope.

Diez




More information about the PyQt mailing list