[PyQt] Bug report: multiple QApplication instances cause a segfault

Algis Kabaila akabaila at pcug.org.au
Thu Jun 23 16:39:04 BST 2011


On Thu, 23 Jun 2011 10:08:50 PM Hans-Peter Jansen wrote:
> Dear Al,
> 
> On Thursday 23 June 2011, 13:26:02 Algis Kabaila wrote:
> > On Thu, 23 Jun 2011 07:06:49 PM Hans-Peter Jansen wrote:
> > > On Thursday 23 June 2011, 08:28:06 David Townshend wrote:
> > > > If it vanishes, it implies a segfault which you will probably see
> > > > if you run idle form the command line. You should be able to get
> > > > a backtrace by running idle through gdb, i.e, from the command
> > > > line, run "gdb idle". Then in gdb type "run". Idle should start
> > > > as usual, so get it to crash.  Then within gdb type "bt". This
> > > > will give a backtrace which will hopefully at least point to
> > > > whether its python, pyqt or qt.
> > > 
> > > Close, but no cigar.
> > > 
> > > after installing assorted .debug packages of python(3), sip, qt,
> > > PyQt, and probably glibc, glib, libstdc++, you usually invoke a
> > > python script with gdb similar to:
> > > 
> > > gdb python3 -ex "set args /usr/bin/idle" -ex run
> > > 
> > > Hth,
> > > Pete
> > 
> > Hi Pete, David et al,
> > 
> > I know "sweet all" about the gdb, so will need to read up on it (at
> > least a little bit).  I  put in the CLI your command and attach the
> > listing, warts and all.  It does not tell *me* much, so I list it all
> > below.  You will see that idle could not be found at the location
> > suggested, so I ran it with the command that IDLE gui had in the
> > properties.
> 
> Sure, that's why I wrote "similar to" ;-).
> 
> > So IDLE did start ok and it failed after the entry of
> > the same commands under (gdb) as has been tried on
> > 
> > idle window earlier (without invoking gdb):
> > >>> from PyQt4 import QtGui
> > >>> app = QtGui.QApplication([])
> > >>> app.quit()
> > >>> app = QtGui.QApplication([])
> > >>> app.quit()  <-- frozen text in IDLE Python Shell.
> > 
> > At  this point "bt" command was entered within the gdb shell.  As
> > expected there are segmentation faults. The following are the "grim
> > details":
> > 
> > ******************
> > ak at supremo:~$ gdb python3 -ex "set args /usr/bin/idle" -ex run
> > Starting program: /usr/bin/python3 /usr/bin/idle
> > [Thread debugging using libthread_db enabled]
> > /usr/bin/python3: can't open file '/usr/bin/idle': [Errno 2] No such
> > file or directory
> > Program exited with code 02.
> > (gdb) /usr/bin/idle-python3.2 -n
> > Undefined command: "".  Try "help".
> > (gdb) run /usr/bin/idle-python3.2 -n
> > Starting program: /usr/bin/python3 /usr/bin/idle-python3.2 -n
> > [Thread debugging using libthread_db enabled]
> > [New Thread 0x7fffef1cd700 (LWP 1705)]
> > 
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x00007fffec894b1f in ?? () from /usr/lib/libQtGui.so.4
> > (gdb) bt
> > #0  0x00007fffec894b1f in ?? () from /usr/lib/libQtGui.so.4
> > #1  0x00007ffff053ad3f in _XError () from
> > /usr/lib/x86_64-linux-gnu/libX11.so.6 #2  0x00007ffff0537fb1 in ?? ()
> > from /usr/lib/x86_64-linux-gnu/libX11.so.6 #3  0x00007ffff0538aa6 in
> > _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6 #4
> > 0x00007ffff052e48d in XQueryTree () from /usr/lib/x86_64-linux-
> > gnu/libX11.so.6
> 
> That's pretty much useless in this form. That's why I wrote about debug
> packages. I'm sure, that ubuntu provides them somewhere. In your case,
> you need to install the libqt4 (or however Ubuntu calls it) debug
> packages at least to make this backtrace useful.
> 
> Cheers,
> Pete

OK - will do after continuing to sleep.  I am on my night "walk" at the 
moment. I did gather your note on the location of IDLE in the system, but did 
not get the note about the debug packages.  It was already late in the day...

Thanks for your guidance.

Al.


More information about the PyQt mailing list