Bug 676042 - segfault when using qml (probably reference counting error)
Summary: segfault when using qml (probably reference counting error)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: PyQt4
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-08 17:22 UTC by Toshio Ernie Kuratomi
Modified: 2011-12-02 21:30 UTC (History)
3 users (show)

Fixed In Version: qscintilla-2.4.6-3.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-19 23:32:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
code to see the segfault (916 bytes, application/x-gzip)
2011-02-08 17:22 UTC, Toshio Ernie Kuratomi
no flags Details

Description Toshio Ernie Kuratomi 2011-02-08 17:22:42 UTC
Created attachment 477653 [details]
code to see the segfault

Description of problem:

When running some simple PyQt4 + QML apps, a segfault can be produced when the QML tries to make use of an object that is exposed to it by the PyQt code.  Changing the code very slightly so that the PyQt4 code has an extra reference to the object removes the segfault.  This likely means that a reference to the object is not being created in the PyQt4 declarative code.

Version-Release number of selected component (if applicable):

PyQt4-4.8.3-1.fc15.i686
qt-4.7.1-13.fc15.i686


How reproducible:

Everytime

Steps to Reproduce:
1. Download attached script
2. run it
3. Click on the window that appears
  
Actual results:

Segmentation fault (core dumped)

Expected results:

The text in the window changes from "nothing yet" to "stopping"

Additional info:
I'll attach a tarball with the code to do this.  The .py file will have a few commented lines that show how to make it not segfault.

Comment 1 Rex Dieter 2011-03-18 16:22:25 UTC
:-/

Upstream response...



It's a feature, not a bug...

PyQt correctly gives an extra reference to the Stopwatch context object to
the QDeclarativeContext returned by rootContext() to prevent it being
garbage collected. However the QDeclarativeContext Python object (not the
C++ instance) is itself garbage collected and so the extra reference is
then discarded.

Therefore you need to keep an explicit reference to the Stopwatch instance
(as in your workaround), or the value returned by rootContext(), or give
the Stopwatch instance a sensible parent.

Comment 2 Rex Dieter 2011-03-18 20:58:04 UTC
Followup...

--------------------------
On Fri, 18 Mar 2011 16:20:23 +0000, Phil Thompson
...on second thoughts I can make this work. Should be fixed in tonight's
SIP and PyQt snapshots.
----------------------------


yay!

Comment 3 Rex Dieter 2011-11-08 14:30:05 UTC
Confirmed this to be fixed in sip-4.13/PyQt4-4.8.6

(testing updates now, will have something bodhi-worthy soon hopefully)

Comment 4 Fedora Update System 2011-11-09 21:23:31 UTC
qscintilla-2.4.6-3.fc15,PyQt4-4.8.6-1.fc15,sip-4.13-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/qscintilla-2.4.6-3.fc15,PyQt4-4.8.6-1.fc15,sip-4.13-1.fc15

Comment 5 Fedora Update System 2011-11-10 17:32:51 UTC
Package qscintilla-2.4.6-3.fc15, PyQt4-4.8.6-1.fc15, sip-4.13-1.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing qscintilla-2.4.6-3.fc15 PyQt4-4.8.6-1.fc15 sip-4.13-1.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-15608
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-11-11 13:30:13 UTC
qscintilla-2.5.1-2.fc16,PyKDE4-4.7.3-1.fc16.1,PyQt4-4.8.6-1.fc16,sip-4.13-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/qscintilla-2.5.1-2.fc16,PyKDE4-4.7.3-1.fc16.1,PyQt4-4.8.6-1.fc16,sip-4.13-1.fc16

Comment 7 Fedora Update System 2011-11-12 03:24:49 UTC
Package qscintilla-2.5.1-2.fc16, PyKDE4-4.7.3-1.fc16.1, PyQt4-4.8.6-1.fc16, sip-4.13-1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing qscintilla-2.5.1-2.fc16 PyKDE4-4.7.3-1.fc16.1 PyQt4-4.8.6-1.fc16 sip-4.13-1.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-15775
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2011-11-19 23:32:46 UTC
qscintilla-2.5.1-2.fc16, PyKDE4-4.7.3-1.fc16.1, PyQt4-4.8.6-1.fc16, sip-4.13-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2011-12-02 21:30:41 UTC
qscintilla-2.4.6-3.fc15, PyQt4-4.8.6-1.fc15, sip-4.13-1.fc15, kdebindings-4.6.5-2.fc15, calibre-0.8.0-1.fc15.1, veusz-1.11-2.fc15.1, avogadro-1.0.3-2.fc15.1 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.