[PyQt] QModelIndex.internalPointer

Andrei Kopats hlamer at tut.by
Wed May 18 15:03:59 BST 2011


Here is example.
Unfortunately, with it I can reproduce crash only if reference to integer
was passed to createIndex()

In the attachment you can find test script, and execution log. The log also
contains my system info.

Regards,
Andrei Kopats

2011/4/29 Andrei Kopats <hlamer at tut.by>

> Hi,
>
> Few days ago QModelIndex.internalPointer was discussed here.
> I also have problems with it. I can't say exactly, when crash occurs, and
> when it doesn't, but, this code generates crash for me:
>
>             index = self.createIndex(row, column, True)
>             print index.internalPointer()
>
> I tried to pass object (which has other references, so, is not destroyed by
> gc), integer, bool value as internalPoitner, and have crashes in any case.
> I use the latest PyQt and SIP snapshots.
>
> Is there a way for workaround this?
>
> Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110518/dd512d1a/attachment.html>
-------------- next part --------------

a at a-desktop:~/tmp$
a at a-desktop:~/tmp$ uname -a
Linux a-desktop 2.6.38-9-generic #43-Ubuntu SMP Thu Apr 28 15:25:15 UTC 2011 i686 i686 i386 GNU/Linux
a at a-desktop:~/tmp$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"
a at a-desktop:~/tmp$ apt-cache show python-qt4
Package: python-qt4
Priority: optional
Section: python
Installed-Size: 20968
Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
Original-Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
Architecture: i386
Version: 4.8.3-2
Replaces: python-qt4-common, python-qt4-dev (<< 4.4.4-3~)
Provides: python2.6-qt4, python2.7-qt4
Depends: libc6 (>= 2.3.6-6~), libgcc1 (>= 1:4.1.1), libpython2.7 (>= 2.7), libqt4-declarative (>= 4:4.7.0~rc1), libqt4-designer (>= 4:4.7.0), libqt4-help (>= 4:4.7.0), libqt4-network (>= 4:4.7.0), libqt4-script (>= 4:4.7.0), libqt4-scripttools (>= 4:4.7.0), libqt4-svg (>= 4:4.7.0), libqt4-test (>= 4:4.7.0), libqt4-xml (>= 4:4.7.0), libqt4-xmlpatterns (>= 4:4.7.0), libqtassistantclient4 (>= 4.6.3), libqtcore4 (>= 4:4.7.0), libqtgui4 (>= 4:4.7.2), libqtwebkit4 (>= 2.1~really2.0.2), libstdc++6 (>= 4.1.1), python (<< 2.8), python (>= 2.6), python-support (>= 0.90.0), sip-api-8.1
Suggests: python-qt4-dbg
Conflicts: python-qt4-common
Filename: pool/main/p/python-qt4/python-qt4_4.8.3-2_i386.deb
Size: 5252490
MD5sum: 66d0deacd92f92b1e20c2beefc9e5c25
SHA1: 129293fbc1dc404a82dbaeac7523a06ea9d618ab
SHA256: fc13164fc4e8c0a9c19c87853bfac8ea994371752019527d9a1f861eae355cf2
Description: Python bindings for Qt4
 PyQt4 exposes the Qt4 API to Python. The following modules are supported:
  * QtCore
  * QtGui
  * QtNetwork
  * QtXml
  * QtScript
  * QtSvg
  * QtTest
  * QtAssistant
  * QtWebKit
  * QtOpenGL (in python-qt4-gl)
  * QtSql (in python-qt4-sql)
  * phonon (in python-qt4-phonon)
Homepage: http://www.riverbankcomputing.co.uk/software/pyqt/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 18m
Task: kubuntu-desktop, kubuntu-mobile-desktop, kubuntu-mobile, edubuntu-desktop-gnome, edubuntu-desktop-kde

a at a-desktop:~/tmp$ apt-cache show libqt4-core
Package: libqt4-core
Priority: optional
Section: universe/libs
Installed-Size: 124
Maintainer: Kubuntu Developers <kubuntu-devel at lists.ubuntu.com>
Original-Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>
Architecture: i386
Source: qt4-x11
Version: 4:4.7.2-0ubuntu6
Depends: libqtcore4 (= 4:4.7.2-0ubuntu6), libqt4-network (= 4:4.7.2-0ubuntu6), libqt4-script (= 4:4.7.2-0ubuntu6), libqt4-xml (= 4:4.7.2-0ubuntu6), libqt4-dbus (= 4:4.7.2-0ubuntu6), libqt4-test (= 4:4.7.2-0ubuntu6)
Filename: pool/universe/q/qt4-x11/libqt4-core_4.7.2-0ubuntu6_i386.deb
Size: 8200
MD5sum: 0aae83fbbf10ccdc3aea2923c9d90157
SHA1: 3f8294f65a706af658213c49e945b1f5d7a257ec
SHA256: 077454201595ffd8a92edd92a83670bbc68c4c6c9f557c3e27a2f4a182b872d3
Description: transitional package for Qt 4 core non-GUI runtime libraries
 Qt is a cross-platform C++ application framework.  Qt's primary feature
 is its rich set of widgets that provide standard GUI functionality.
 .
 This is a dummy transitional package to enable installation of other packages
 linked against Qt 4.3 or earlier Qt 4 releases previously shipped.
Homepage: http://www.qtsoftware.com
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Package: libqt4-core
Priority: optional
Section: universe/libs
Installed-Size: 124
Maintainer: Kubuntu Developers <kubuntu-devel at lists.ubuntu.com>
Original-Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>
Architecture: i386
Source: qt4-x11
Version: 4:4.7.2-0ubuntu6.1
Depends: libqtcore4 (= 4:4.7.2-0ubuntu6.1), libqt4-network (= 4:4.7.2-0ubuntu6.1), libqt4-script (= 4:4.7.2-0ubuntu6.1), libqt4-xml (= 4:4.7.2-0ubuntu6.1), libqt4-dbus (= 4:4.7.2-0ubuntu6.1), libqt4-test (= 4:4.7.2-0ubuntu6.1)
Filename: pool/universe/q/qt4-x11/libqt4-core_4.7.2-0ubuntu6.1_i386.deb
Size: 8202
MD5sum: c20a7a57ed49039853485a175dd63bc2
SHA1: 42de0f2b70d90320c277b9bde51c7c8e0b0e6dd3
SHA256: 6cd1f5c41e7ca4c4138d3f75f40314ca75388eea25db49fe37aa82644b332a45
Description: transitional package for Qt 4 core non-GUI runtime libraries
 Qt is a cross-platform C++ application framework.  Qt's primary feature
 is its rich set of widgets that provide standard GUI functionality.
 .
 This is a dummy transitional package to enable installation of other packages
 linked against Qt 4.3 or earlier Qt 4 releases previously shipped.
Homepage: http://www.qtsoftware.com
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

a at a-desktop:~/tmp$ python --version
Python 2.7.1+
a at a-desktop:~/tmp$ gdb --args python  ./test.py
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/python ./test.py
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x005816a3 in ?? () from /usr/lib/pymodules/python2.7/PyQt4/QtCore.so
(gdb) bt
#0  0x005816a3 in ?? () from /usr/lib/pymodules/python2.7/PyQt4/QtCore.so
#1  0x080da7d5 in PyEval_EvalFrameEx ()
#2  0x080dae8b in PyEval_EvalFrameEx ()
#3  0x080e11e7 in PyEval_EvalCodeEx ()
#4  0x0812c477 in PyEval_EvalCode ()
#5  0x0813c010 in ?? ()
#6  0x080700b3 in PyRun_FileExFlags ()
#7  0x08070af9 in PyRun_SimpleFileExFlags ()
#8  0x0805c069 in Py_Main ()
#9  0x0805b25b in main ()
(gdb) 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 412 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110518/dd512d1a/attachment.py>


More information about the PyQt mailing list