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

Algis Kabaila akabaila at pcug.org.au
Fri Jun 24 02:35:55 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:
[snip...]
Following Pete's advise, I've installed 23 new packages that appeared to be 
dbg related (169 MiB downloaded, 802 MiB additional space of hdd used).  
The gdb was then invoked with the command, shown immediately after the 
"****" marker. After that in the invoked IDLE Python Shell given were 
the following commands:

>>> from PyQt4 import QtGui
>>> app = QtGui.QApplication([])
>>> app.quit()
>>> app = QtGui.QApplication([])
>>> app.quit()
>>> app = QtGui.QApplication([])

At that point the IDLE Shell "froze".  Typed on the CLI shell was *bt*.
The whole dialog is shown between the "****" markers.

************************
ak at supremo:~$ gdb python3 -ex "set args /usr/bin/idle-python3.2 -n" -ex run
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python3...Reading symbols from 
/usr/lib/debug/usr/bin/python3.2mu...done.
done.
Starting program: /usr/bin/python3 /usr/bin/idle-python3.2 -n
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffef1cd700 (LWP 2347)]

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
#5  0x00007ffff0b8a246 in Tk_HandleEvent () from /usr/lib/libtk8.5.so.0
#6  0x00007ffff0b8a7c0 in ?? () from /usr/lib/libtk8.5.so.0
#7  0x00007ffff08d564f in Tcl_ServiceEvent () from /usr/lib/libtcl8.5.so.0
#8  0x00007ffff08d58d5 in Tcl_DoOneEvent () from /usr/lib/libtcl8.5.so.0
#9  0x00007ffff11ba2e9 in ?? () from /usr/lib/python3.2/lib-
dynload/_tkinter.cpython-32mu.so
#10 0x0000000000465d28 in call_function (f=<value optimised out>, 
throwflag=<value optimised out>)
    at ../Python/ceval.c:3875
#11 PyEval_EvalFrameEx (f=<value optimised out>, throwflag=<value optimised 
out>)
    at ../Python/ceval.c:2673
#12 0x00000000004675f2 in PyEval_EvalCodeEx (_co=<value optimised out>, 
globals=<value optimised out>, 
    locals=<value optimised out>, args=<value optimised out>, argcount=1, 
kws=0x12a0d40, kwcount=0, 
    defs=0xe76ba8, defcount=1, kwdefs=0x0, closure=0x0) at 
../Python/ceval.c:3311
#13 0x0000000000466784 in fast_function (f=<value optimised out>, 
throwflag=<value optimised out>)
    at ../Python/ceval.c:3973
#14 call_function (f=<value optimised out>, throwflag=<value optimised out>) at 
../Python/ceval.c:3896
#15 PyEval_EvalFrameEx (f=<value optimised out>, throwflag=<value optimised 
out>)
    at ../Python/ceval.c:2673
#16 0x0000000000466ae0 in fast_function (f=<value optimised out>, 
throwflag=<value optimised out>)
    at ../Python/ceval.c:3963
#17 call_function (f=<value optimised out>, throwflag=<value optimised out>) at 
../Python/ceval.c:3896
#18 PyEval_EvalFrameEx (f=<value optimised out>, throwflag=<value optimised 
out>)
    at ../Python/ceval.c:2673
#19 0x00000000004675f2 in PyEval_EvalCodeEx (_co=<value optimised out>, 
globals=<value optimised out>, 
    locals=<value optimised out>, args=<value optimised out>, argcount=0, 
kws=0x0, kwcount=0, defs=0x0, 
    defcount=0, kwdefs=0x0, closure=0x0) at ../Python/ceval.c:3311
#20 0x000000000046787b in PyEval_EvalCode (co=<value optimised out>, 
globals=<value optimised out>, 
    locals=<value optimised out>) at ../Python/ceval.c:761
#21 0x000000000048d00d in run_mod (fp=0xb149b0, filename=<value optimised out>, 
    start=<value optimised out>, globals=
    {'QtGui': <module at remote 0x196c6c8>, '__builtins__': <module at remote 
0x7ffff7fb1638>, '__file__'---Type <return> to continue, or q <return> to quit---
q
Quit
(gdb) quit
A debugging session is active.

        Inferior 1 [process 2344] will be killed.

Quit anyway? (y or n) y
ak at supremo:~$ 
************************

It is clear that there is segmentation fault. I do not know how to read the
 dbg output and would appreciate advice whether the output is useful or not.

@ Pete - do you want me to do any more testing? If yes, just let me know. 
Thanks again!

OldAl.


More information about the PyQt mailing list