[PyQt] QtGui.QApplication() never returns

Hans-Peter Jansen hpj at urpla.net
Sun Dec 27 18:26:08 GMT 2009


On Wednesday 23 December 2009, 15:52:59 Joe Turpin wrote:
> On Mon, Dec 14, 2009 at 10:14 AM, Joe Turpin <joe.turpin at gmail.com> wrote:
> > On Mon, Dec 14, 2009 at 9:15 AM, David Boddie <dboddie at trolltech.com> 
wrote:
> >> On Sat Dec 12 21:47:16 GMT 2009, Joe Turpin wrote:
> >>> I have a very basic python script file that looks like the following
> >>> (taken directly from an online tutorial):
> >>>
> >>>     #!/usr/bin/python
> >>>
> >>>     # simple.py
> >>>
> >>>     import sys
> >>>     from PyQt4 import QtGui
> >>>
> >>>     app = QtGui.QApplication(sys.argv)
> >>>
> >>>     widget = QtGui.QWidget()
> >>>     widget.resize(250, 150)
> >>>     widget.setWindowTitle('simple')
> >>>     widget.show()
> >>>
> >>>     sys.exit(app.exec_())
> >>>
> >>> The script runs to completion when I execute it under my regular user
> >>> account, but hangs when I execute it as root.. Using pdb I inserted a
> >>> set_trace() and found that it never returns from the call to
> >>> QtGui.QApplication(). Any ideas why this might be happening?
>
> <snip>
>
> I've been busy with other things, as I'm sure you all are, and haven't
> had time to investigate the deadlock occurring for me when I run my
> simple PyQt4 app as root.
>
> David, did my last email to the list with gdb and strace output give
> any clues to where the problem lies? It looks like a deadlock, but is
> this a result of system configuration or a software bug? I'm assuming
> you are able to run this as root, right?

I am: openSUSE 11.1 (Linux 2.6.27.39/i586) with sip 4.9.3, PyQt 4.6.2, Qt 
4.5.3 and Python 2.6.0.

Might SELinux or the like gets in the way?

What I find suspicious is the pthread_cond_wait call! A strace as root 
doesn't show anything related (apart from 
open("/lib/libpthread.so.0", O_RDONLY)  = 3
) here, but neither appears libQtDBus nor libdbus-1 in my traces. 

Pete


More information about the PyQt mailing list