PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 925 - Segfault when passing a QScriptValue as QObject or when using .toVariant() on a QScriptValue
: Segfault when passing a QScriptValue as QObject or when using .toVariant() on...
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: Shiboken
: HEAD
: PC Linux
: P2 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-07-10 12:33 EEST by Thomas Perl
Modified: 2011-07-22 22:12 EEST (History)
8 users (show)

See Also:


Attachments
Python script demonstrating the problem (1.28 KB, text/x-python)
2011-07-10 12:35 EEST, Thomas Perl
Details
QML file for the above Python script (307 bytes, application/octet-stream)
2011-07-10 12:35 EEST, Thomas Perl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Perl 2011-07-10 12:33:49 EEST
This bug is actually for two related segfaults, please tell me if I should open
separate bugs for them, but I think they are at least somehow related.

The first segfault can be produced by passing a QScriptValue to a slot that has
its parameters declared as QObject like this:

@Slot(QObject, QObject)

The backtrace I get:

#0  0x01eed23f in QGraphicsItem::toGraphicsObject() ()
   from /usr/lib/libQtGui.so.4
#1  0x01038269 in Sbk_QGraphicsItem__repr__ ()
   from
/home/thp/pkg/pyside-sandbox/lib/python2.6/site-packages/PySide/QtGui.so
#2  0x08092567 in _PyObject_Str ()
#3  0x08092632 in PyObject_Str ()
#4  0x08092765 in ?? ()
#5  0x08074c52 in PyFile_WriteObject ()
#6  0x080dc97a in PyEval_EvalFrameEx ()
#7  0x080dfbb2 in PyEval_EvalCodeEx ()
#8  0x08168e3c in ?? ()
#9  0x0805fd6a in PyObject_Call ()
#10 0x08067d5c in ?? ()
#11 0x0805fd6a in PyObject_Call ()
#12 0x080d8c62 in PyEval_CallObjectWithKeywords ()
#13 0x0805fe00 in PyObject_CallObject ()
#14 0x006b731b in PySide::SignalManager::qt_metacall(QObject*,
QMetaObject::Call, int, void**) ()
   from /home/thp/pkg/pyside-sandbox/lib/libpyside-python2.6.so.1.0
#15 0x0055b1b1 in QObjectWrapper::qt_metacall(QMetaObject::Call, int, void**)
    ()
   from
/home/thp/pkg/pyside-sandbox/lib/python2.6/site-packages/PySide/QtCore.so
#16 0x00a928ca in QMetaObject::metacall(QObject*, QMetaObject::Call, int,
void**) () from /usr/lib/libQtCore.so.4

The second segfault happens when trying to convert a QScriptValue using
toVariant():

#0  0x01eed23f in QGraphicsItem::toGraphicsObject() ()
   from /usr/lib/libQtGui.so.4
#1  0x01038269 in Sbk_QGraphicsItem__repr__ ()
   from
/home/thp/pkg/pyside-sandbox/lib/python2.6/site-packages/PySide/QtGui.so
#2  0x08092567 in _PyObject_Str ()
#3  0x08092632 in PyObject_Str ()
#4  0x08092765 in ?? ()
#5  0x08074c52 in PyFile_WriteObject ()
#6  0x080dc97a in PyEval_EvalFrameEx ()
#7  0x080dfbb2 in PyEval_EvalCodeEx ()
#8  0x08168e3c in ?? ()
#9  0x0805fd6a in PyObject_Call ()
#10 0x08067d5c in ?? ()
#11 0x0805fd6a in PyObject_Call ()
#12 0x080d8c62 in PyEval_CallObjectWithKeywords ()
#13 0x0805fe00 in PyObject_CallObject ()
#14 0x006b731b in PySide::SignalManager::qt_metacall(QObject*,
QMetaObject::Call, int, void**) ()
   from /home/thp/pkg/pyside-sandbox/lib/libpyside-python2.6.so.1.0
#15 0x0055b1b1 in QObjectWrapper::qt_metacall(QMetaObject::Call, int, void**)
    ()
   from
/home/thp/pkg/pyside-sandbox/lib/python2.6/site-packages/PySide/QtCore.so
#16 0x00a928ca in QMetaObject::metacall(QObject*, QMetaObject::Call, int,
void**) () from /usr/lib/libQtCore.so.4


I'll attach a test case for both segfaults with instructions on how to
reproduce them.
Comment 1 Thomas Perl 2011-07-10 12:35:29 EEST
Created attachment 372 [details]
Python script demonstrating the problem
Comment 2 Thomas Perl 2011-07-10 12:35:47 EEST
Created attachment 373 [details]
QML file for the above Python script
Comment 3 Thomas Perl 2011-07-10 12:39:06 EEST
Instructions on how to reproduce the two segfaults:

1.) Download bug925.py and bug925.qml from the attachments
2.) Uncomment the line saying "segfault 1 here" in bug925.py
3.) Start it using "python bug925.py"
4.) Click on the blue square in the appearing window -> SEGFAULT

5.) Comment the line saying "segfault 1 here" in bug925.py
6.) Start it again using "python bug925.py"
7.) Click on the blue square in the appearing window -> SEGFAULT

I'm using a recent build of PySide (quite new, although it's not HEAD).
Comment 4 Hugo Parente Lima 2011-07-11 20:59:24 EEST
Great report, thanks!
Comment 5 renato filho 2011-07-12 23:49:04 EEST
fixed on pyside commit:

commit 3a4369cf80199d5ab0dd1b5bf80a81abe10902e7
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Tue Jul 12 11:50:55 2011 -0300
Comment 6 renato filho 2011-07-22 22:12:59 EEST
release 1.0.5