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 1039 - Segfault in QNetworkReply::error()
: Segfault in QNetworkReply::error()
Status: RESOLVED WONTFIX
Product: PySide
Classification: Unclassified
Component: QtNetwork
: 1.0.8
: PC Linux
: P2 normal
Assigned To: Paulo Alcantara
:
:
:
  Show dependency treegraph
 
Reported: 2011-10-29 01:11 EEST by David Butler
Modified: 2011-11-01 20:48 EET (History)
9 users (show)

See Also:


Attachments
test.py (2.77 KB, text/x-python)
2011-10-29 01:11 EEST, David Butler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Butler 2011-10-29 01:11:30 EEST
Created attachment 439 [details]
test.py

(gdb) run test.py
Starting program: /usr/bin/python test.py
process 2327 is executing new program: /usr/bin/python2.7
[Thread debugging using libthread_db enabled]
PySide.__version__: 1.0.8
PySide.QtCore.qVersion(): 4.7.2
[New Thread 0xb459cb70 (LWP 2330)]
[New Thread 0xb37ffb70 (LWP 2331)]

Program received signal SIGSEGV, Segmentation fault.
0xb614faba in QNetworkReply::error() const () from
/usr/lib/qt4/libQtNetwork.so.4
(gdb) backtrace
#0  0xb614faba in QNetworkReply::error() const () from
/usr/lib/qt4/libQtNetwork.so.4
#1  0xb7ed3f01 in PyCFunction_Call () from /usr/lib/libpython2.7.so.1.0
#2  0xb793b3e3 in ?? () from /usr/lib/libpyside-python2.7.so.1.0
#3  0xb7e93d4c in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#4  0xb7f31116 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#5  0xb7f32aaf in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#6  0xb7f33313 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#7  0xb7ebe9b7 in ?? () from /usr/lib/libpython2.7.so.1.0
#8  0xb7e93d4c in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#9  0xb7f2bf44 in PyEval_CallObjectWithKeywords () from
/usr/lib/libpython2.7.so.1.0
#10 0xb7e9475c in PyObject_CallObject () from /usr/lib/libpython2.7.so.1.0
#11 0xb792ff23 in PySide::SignalManager::callPythonMetaMethod(QMetaMethod
const&, void**, _object*, bool) () from /usr/lib/libpyside-python2.7.so.1.0
#12 0xb79369fc in ?? () from /usr/lib/libpyside-python2.7.so.1.0
#13 0xb7768d9a in QMetaObject::metacall(QObject*, QMetaObject::Call, int,
void**) () from /usr/lib/qt4/libQtCore.so.4
#14 0xb777adfd in QMetaObject::activate(QObject*, QMetaObject const*, int,
void**) () from /usr/lib/qt4/libQtCore.so.4
#15 0xb6e37e19 in QWebFrame::loadFinished(bool) () from
/usr/lib/qt4/libQtWebKit.so.4
#16 0xb6e382d8 in QWebFrame::qt_metacall(QMetaObject::Call, int, void**) ()
from /usr/lib/qt4/libQtWebKit.so.4
#17 0xb7768d9a in QMetaObject::metacall(QObject*, QMetaObject::Call, int,
void**) () from /usr/lib/qt4/libQtCore.so.4
#18 0xb777adfd in QMetaObject::activate(QObject*, QMetaObject const*, int,
void**) () from /usr/lib/qt4/libQtCore.so.4
#19 0xb6c57849 in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#20 0xb6c58b71 in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#21 0xb6a55f74 in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#22 0xb6a56040 in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#23 0xb6a29ffb in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#24 0xb6a2a458 in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#25 0xb6a1c877 in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#26 0xb6a5dab3 in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#27 0xb6a58951 in ?? () from /usr/lib/qt4/libQtWebKit.so.4
#28 0xb6c3738c in ?? () from /usr/lib/qt4/libQtWebKit.so.4                      
#29 0xb6c37a0b in ?? () from /usr/lib/qt4/libQtWebKit.so.4                      
#30 0xb7768d9a in QMetaObject::metacall(QObject*, QMetaObject::Call, int,
void**) () from /usr/lib/qt4/libQtCore.so.4                                     
#31 0xb777adfd in QMetaObject::activate(QObject*, QMetaObject const*, int,
void**) () from /usr/lib/qt4/libQtCore.so.4                                     
#32 0xb61c5367 in QNetworkReply::finished() () from
/usr/lib/qt4/libQtNetwork.so.4                                                  
#33 0xb615365c in ?? () from /usr/lib/qt4/libQtNetwork.so.4                     
#34 0xb6136ca0 in ?? () from /usr/lib/qt4/libQtNetwork.so.4                     
#35 0xb613d4a1 in ?? () from /usr/lib/qt4/libQtNetwork.so.4                     
#36 0xb61533ca in ?? () from /usr/lib/qt4/libQtNetwork.so.4                     
#37 0xb6153463 in ?? () from /usr/lib/qt4/libQtNetwork.so.4                     
#38 0xb57afedc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from
/usr/lib/qt4/libQtGui.so.4                                                      
#39 0xb57b6b6e in QApplication::notify(QObject*, QEvent*) () from
/usr/lib/qt4/libQtGui.so.4                                                      
#40 0xb484499e in ?? () from /usr/lib/python2.7/site-packages/PySide/QtGui.so   
#41 0xb776328b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from
/usr/lib/qt4/libQtCore.so.4                                                     
#42 0xb77658bc in QCoreApplicationPrivate::sendPostedEvents(QObject*, int,
QThreadData*) () from /usr/lib/qt4/libQtCore.so.4                               
#43 0xb7791e9a in
QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/qt4/libQtCore.so.4                                                
#44 0xb586a3ce in ?? () from /usr/lib/qt4/libQtGui.so.4                         
#45 0xb7761f79 in
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/qt4/libQtCore.so.4
#46 0xb77623fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/qt4/libQtCore.so.4
#47 0xb7765acf in QCoreApplication::exec() () from /usr/lib/qt4/libQtCore.so.4
#48 0xb57aecb7 in QApplication::exec() () from /usr/lib/qt4/libQtGui.so.4
#49 0xb483e454 in ?? () from /usr/lib/python2.7/site-packages/PySide/QtGui.so
#50 0xb7f31946 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#51 0xb7f33313 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#52 0xb7f33463 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#53 0xb7f4d11b in ?? () from /usr/lib/libpython2.7.so.1.0
#54 0xb7f4d1e2 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#55 0xb7f4e85c in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#56 0xb7f4f0f2 in PyRun_AnyFileExFlags () from /usr/lib/libpython2.7.so.1.0
#57 0xb7f6067e in Py_Main () from /usr/lib/libpython2.7.so.1.0
#58 0x08048833 in main ()
Comment 1 David Butler 2011-10-31 00:15:22 EET
I think it has something to do with waiting to call reply.error() until
later... a work around seems to be to call and save the error in
onResourceFinished...
Comment 2 Hugo Parente Lima 2011-11-01 20:48:40 EET
Hi

The QNetworkReply object is deleted by Qt (using deleteLater method), so you
can't store it to use it later, because it can be deleted anytime after the
call to the slot.

PySide has no way to detect when the QNetworkReply object was deleted because
it comes from C++, this explains why you don't get an exception telling you
that the object was already deleted.

A possible solution would be to add some meta information in the signal telling
us to mark the object as invalid after the slot call, but we don't have enough
info to do that because the call to the slot is made by a qt_metacall, i.e. we
don't know what signal triggered the call, then is impossible to know what
arguments needs to be marked as invalid.

For sure it's a bug, but we can't fix it due to Qt signal/slot architecture so
I'm marking this bug as WONTFIX. Thanks for reporting it.