Problem with PyQt4

jiang.haiyun at gmail.com jiang.haiyun at gmail.com
Mon Apr 30 16:32:20 CEST 2007


Hi,

I am having some serious problems with PyQT4,
when i run pyqt script, I always get 'Segmentation fault'.

the script is simple:
======================
%less qttest.py
from PyQt4 import QtGui, QtCore
import sys

if __name__ == '__main__':
        app = QtGui.QApplication(sys.argv)
        w = QtGui.QMainWindow()
        w.show()
        app.exec_()
======================

When I run it , it crashes.
======================
%python qttest.py
Segmentation fault (core dumped)
=====================

And the output with '-v' argument is :
=========================
%python -v qttest.py
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/local/lib/python2.4/site.pyc matches /usr/local/lib/python2.4/
site.py
import site # precompiled from /usr/local/lib/python2.4/site.pyc
# /usr/local/lib/python2.4/os.pyc matches /usr/local/lib/python2.4/
os.py
import os # precompiled from /usr/local/lib/python2.4/os.pyc
import posix # builtin
# /usr/local/lib/python2.4/posixpath.pyc matches /usr/local/lib/
python2.4/posixp
ath.py
import posixpath # precompiled from /usr/local/lib/python2.4/
posixpath.pyc
# /usr/local/lib/python2.4/stat.pyc matches /usr/local/lib/python2.4/
stat.py
import stat # precompiled from /usr/local/lib/python2.4/stat.pyc
# /usr/local/lib/python2.4/UserDict.pyc matches /usr/local/lib/
python2.4/UserDic
t.py
import UserDict # precompiled from /usr/local/lib/python2.4/
UserDict.pyc
# /usr/local/lib/python2.4/copy_reg.pyc matches /usr/local/lib/
python2.4/copy_re
g.py
import copy_reg # precompiled from /usr/local/lib/python2.4/
copy_reg.pyc
# /usr/local/lib/python2.4/types.pyc matches /usr/local/lib/python2.4/
types.py
import types # precompiled from /usr/local/lib/python2.4/types.pyc
# /usr/local/lib/python2.4/warnings.pyc matches /usr/local/lib/
python2.4/warning
s.py
import warnings # precompiled from /usr/local/lib/python2.4/
warnings.pyc
# /usr/local/lib/python2.4/linecache.pyc matches /usr/local/lib/
python2.4/lineca
che.py
import linecache # precompiled from /usr/local/lib/python2.4/
linecache.pyc
import encodings # directory /usr/local/lib/python2.4/encodings
# /usr/local/lib/python2.4/encodings/__init__.pyc matches /usr/local/
lib/python2
.4/encodings/__init__.py
import encodings # precompiled from /usr/local/lib/python2.4/encodings/
__init__.
pyc
# /usr/local/lib/python2.4/codecs.pyc matches /usr/local/lib/python2.4/
codecs.py
import codecs # precompiled from /usr/local/lib/python2.4/codecs.pyc
import _codecs # builtin
# /usr/local/lib/python2.4/encodings/aliases.pyc matches /usr/local/
lib/python2.
4/encodings/aliases.py
import encodings.aliases # precompiled from /usr/local/lib/python2.4/
encodings/a
liases.pyc
# /usr/local/lib/python2.4/encodings/gb2312.pyc matches /usr/local/lib/
python2.4
/encodings/gb2312.py
import encodings.gb2312 # precompiled from /usr/local/lib/python2.4/
encodings/gb
2312.pyc
dlopen("/usr/local/lib/python2.4/lib-dynload/_codecs_cn.so", 2);
import _codecs_cn # dynamically loaded from /usr/local/lib/python2.4/
lib-
dynload                                                             /
_codecs_cn.so
dlopen("/usr/local/lib/python2.4/lib-dynload/_multibytecodec.so", 2);
import _multibytecodec # dynamically loaded from /usr/local/lib/
python2.4/lib-
dy                                                             nload/
_multibytecodec.so
Python 2.4.3 (#2, Oct 15 2006, 05:32:11)
[GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
import PyQt4 # directory /usr/local/lib/python2.4/site-packages/PyQt4
# /usr/local/lib/python2.4/site-packages/PyQt4/__init__.pyc matches /
usr/local/
l                                                             ib/
python2.4/site-packages/PyQt4/__init__.py
import PyQt4 # precompiled from /usr/local/lib/python2.4/site-packages/
PyQt4/__i
nit__.pyc
dlopen("/usr/local/lib/python2.4/site-packages/PyQt4/QtGui.so", 2);
dlopen("/usr/local/lib/python2.4/site-packages/sip.so", 2);
import sip # dynamically loaded from /usr/local/lib/python2.4/site-
packages/
sip.                                                             so
dlopen("/usr/local/lib/python2.4/site-packages/PyQt4/QtCore.so", 2);
import PyQt4.QtCore # dynamically loaded from /usr/local/lib/python2.4/
site-pack
ages/PyQt4/QtCore.so
import PyQt4.QtGui # dynamically loaded from /usr/local/lib/python2.4/
site-packa
ges/PyQt4/QtGui.so
Segmentation fault (core dumped)
%python -v qttest.py
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/local/lib/python2.4/site.pyc matches /usr/local/lib/python2.4/
site.py
import site # precompiled from /usr/local/lib/python2.4/site.pyc
# /usr/local/lib/python2.4/os.pyc matches /usr/local/lib/python2.4/
os.py
import os # precompiled from /usr/local/lib/python2.4/os.pyc
import posix # builtin
# /usr/local/lib/python2.4/posixpath.pyc matches /usr/local/lib/
python2.4/posixpath.py
import posixpath # precompiled from /usr/local/lib/python2.4/
posixpath.pyc
# /usr/local/lib/python2.4/stat.pyc matches /usr/local/lib/python2.4/
stat.py
import stat # precompiled from /usr/local/lib/python2.4/stat.pyc
# /usr/local/lib/python2.4/UserDict.pyc matches /usr/local/lib/
python2.4/UserDict.py
import UserDict # precompiled from /usr/local/lib/python2.4/
UserDict.pyc
# /usr/local/lib/python2.4/copy_reg.pyc matches /usr/local/lib/
python2.4/copy_reg.py
import copy_reg # precompiled from /usr/local/lib/python2.4/
copy_reg.pyc
# /usr/local/lib/python2.4/types.pyc matches /usr/local/lib/python2.4/
types.py
import types # precompiled from /usr/local/lib/python2.4/types.pyc
# /usr/local/lib/python2.4/warnings.pyc matches /usr/local/lib/
python2.4/warnings.py
import warnings # precompiled from /usr/local/lib/python2.4/
warnings.pyc
# /usr/local/lib/python2.4/linecache.pyc matches /usr/local/lib/
python2.4/linecache.py
import linecache # precompiled from /usr/local/lib/python2.4/
linecache.pyc
import encodings # directory /usr/local/lib/python2.4/encodings
# /usr/local/lib/python2.4/encodings/__init__.pyc matches /usr/local/
lib/python2.4/encodings/__init__.py
import encodings # precompiled from /usr/local/lib/python2.4/encodings/
__init__.pyc
# /usr/local/lib/python2.4/codecs.pyc matches /usr/local/lib/python2.4/
codecs.py
import codecs # precompiled from /usr/local/lib/python2.4/codecs.pyc
import _codecs # builtin
# /usr/local/lib/python2.4/encodings/aliases.pyc matches /usr/local/
lib/python2.4/encodings/aliases.py
import encodings.aliases # precompiled from /usr/local/lib/python2.4/
encodings/aliases.pyc
# /usr/local/lib/python2.4/encodings/gb2312.pyc matches /usr/local/lib/
python2.4/encodings/gb2312.py
import encodings.gb2312 # precompiled from /usr/local/lib/python2.4/
encodings/gb2312.pyc
dlopen("/usr/local/lib/python2.4/lib-dynload/_codecs_cn.so", 2);
import _codecs_cn # dynamically loaded from /usr/local/lib/python2.4/
lib-dynload/_codecs_cn.so
dlopen("/usr/local/lib/python2.4/lib-dynload/_multibytecodec.so", 2);
import _multibytecodec # dynamically loaded from /usr/local/lib/
python2.4/lib-dynload/_multibytecodec.so
Python 2.4.3 (#2, Oct 15 2006, 05:32:11)
[GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
import PyQt4 # directory /usr/local/lib/python2.4/site-packages/PyQt4
# /usr/local/lib/python2.4/site-packages/PyQt4/__init__.pyc matches /
usr/local/lib/python2.4/site-packages/PyQt4/__init__.py
import PyQt4 # precompiled from /usr/local/lib/python2.4/site-packages/
PyQt4/__init__.pyc
dlopen("/usr/local/lib/python2.4/site-packages/PyQt4/QtGui.so", 2);
dlopen("/usr/local/lib/python2.4/site-packages/sip.so", 2);
import sip # dynamically loaded from /usr/local/lib/python2.4/site-
packages/sip.so
dlopen("/usr/local/lib/python2.4/site-packages/PyQt4/QtCore.so", 2);
import PyQt4.QtCore # dynamically loaded from /usr/local/lib/python2.4/
site-packages/PyQt4/QtCore.so
import PyQt4.QtGui # dynamically loaded from /usr/local/lib/python2.4/
site-packages/PyQt4/QtGui.so
Segmentation fault (core dumped)
=============================================

And the output of the gdb is :
===========================================
%gdb --args python qttest.py
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging
symbols found)...
(gdb) run
Starting program: /usr/local/bin/python qttest.py
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...warning:
Unable to get location for thread creation breakpoint: generic error
[New LWP 100113]
(no debugging symbols found)...(no debugging symbols found)...[New
Thread 0x811f000 (LWP 100113)]
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x811f000 (LWP 100099)]
0x2887cb6d in typeinfo name for sipQApplication () from /usr/local/lib/
python2.4/site-packages/PyQt4/QtGui.so
(gdb)
==========================================

My system is FreeBSD 6.2 release, i386, all softwares were installed
from ports.
and the Qt4 examples/demos work perfectly.

Please help me.
Thanks very much in advance.
Regards,
jiang.haiyun




More information about the Python-list mailing list