[Qt-interest] Aborting QNetworkReply::post() causes crash
Info
info at misafe.com
Fri Nov 6 12:59:22 CET 2009
Hi Markus,
I'm running a patched version of 4.5.3 (I spoke to you on the qtcentre
forum earlier today about the patch). I am just building the latest
4.6 to see if the issue is solved there.
In the meantime the backtrace is:
QtNetworkd4.dll!QHttpNetworkReply::d_func() Line 146 + 0xa bytes C++
QtNetworkd4.dll!QHttpNetworkConnectionPrivate::sendRequest
(QAbstractSocket * socket=0x01947210) Line 395 + 0x15 bytes C++
QtNetworkd4.dll!QHttpNetworkConnectionPrivate::_q_encryptedBytesWritten
(__int64 bytes=16421) Line 1374 C++
QtNetworkd4.dll!QHttpNetworkConnection::qt_metacall(QMetaObject::Call
_c=InvokeMetaMethod, int _id=19, void * * _a=0x0160d96c) Line 132 C
++
QtCored4.dll!QMetaObject::activate(QObject * sender=0x01947210, int
from_signal_index=27, int to_signal_index=27, void * *
argv=0x0160d96c) Line 3104 + 0x2b bytes C++
QtCored4.dll!QMetaObject::activate(QObject * sender=0x01947210, const
QMetaObject * m=0x640e5ba8, int local_signal_index=4, void * *
argv=0x0160d96c) Line 3178 + 0x15 bytes C++
QtNetworkd4.dll!QSslSocket::encryptedBytesWritten(__int64 _t1=16421)
Line 155 + 0x15 bytes C++
QtNetworkd4.dll!QSslSocketPrivate::_q_bytesWrittenSlot(__int64
written=16421) Line 2034 C++
QtNetworkd4.dll!QSslSocket::qt_metacall(QMetaObject::Call
_c=InvokeMetaMethod, int _id=16, void * * _a=0x0160da84) Line 115 +
0x1c bytes C++
QtCored4.dll!QMetaObject::activate(QObject * sender=0x019901b0, int
from_signal_index=5, int to_signal_index=5, void * * argv=0x0160da84)
Line 3104 + 0x2b bytes C++
QtCored4.dll!QMetaObject::activate(QObject * sender=0x019901b0, const
QMetaObject * m=0x672b1d38, int local_signal_index=1, void * *
argv=0x0160da84) Line 3178 + 0x15 bytes C++
QtCored4.dll!QIODevice::bytesWritten(__int64 _t1=16421) Line 92 +
0x14 bytes C++
QtNetworkd4.dll!QAbstractSocketPrivate::flush() Line 730 C++
QtNetworkd4.dll!QAbstractSocketPrivate::canWriteNotification() Line
650 C++
QtNetworkd4.dll!QAbstractSocketPrivate::writeNotification() Line 78 +
0x15 bytes C++
QtNetworkd4.dll!QAbstractSocketEngine::writeNotification() Line
161 C++
QtNetworkd4.dll!QWriteNotifier::event(QEvent * e=0x0160ded4) Line
1069 C++
QtGuid4.dll!QApplicationPrivate::notify_helper(QObject *
receiver=0x01ae7460, QEvent * e=0x0160ded4) Line 4065 + 0x11 bytes
C++
QtGuid4.dll!QApplication::notify(QObject * receiver=0x01ae7460, QEvent
* e=0x0160ded4) Line 3605 + 0x10 bytes C++
QtCored4.dll!QCoreApplication::notifyInternal(QObject *
receiver=0x01ae7460, QEvent * event=0x0160ded4) Line 610 + 0x15
bytes C++
QtCored4.dll!QCoreApplication::sendEvent(QObject *
receiver=0x01ae7460, QEvent * event=0x0160ded4) Line 213 + 0x39
bytes C++
QtCored4.dll!qt_internal_proc(HWND__ * hwnd=0x005503ca, unsigned int
message=1024, unsigned int wp=7220, long lp=2) Line 466 + 0xf bytes
C++
user32.dll!_InternalCallWinProc at 20() + 0x28 bytes
user32.dll!_UserCallWinProcCheckWow at 32() + 0xb7 bytes
user32.dll!_DispatchMessageWorker at 8() + 0xdc bytes
user32.dll!_DispatchMessageW at 4() + 0xf bytes
QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum
QEventLoop::ProcessEventsFlag> flags={...}) Line 751 + 0x17 bytes C
++
QtCored4.dll!QEventLoop::processEvents(QFlags<enum
QEventLoop::ProcessEventsFlag> flags={...}) Line 150 C++
QtCored4.dll!QEventLoop::exec(QFlags<enum
QEventLoop::ProcessEventsFlag> flags={...}) Line 201 + 0x2d bytes C
++
QtCored4.dll!QThread::exec() Line 487 + 0x15 bytes C++
NetworkTest.exe!NetworkTest::run() Line 29 C++
QtCored4.dll!QThreadPrivate::start(void * arg=0x00c53520) Line 309 C++
msvcr80d.dll!_callthreadstartex() Line 348 + 0xf bytes C
msvcr80d.dll!_threadstartex(void * ptd=0x00cfcef8) Line 331 C
kernel32.dll!_BaseThreadStart at 8() + 0x37 bytes
On 6 Nov 2009, at 10:34, Markus Goetz wrote:
> Hi,
>
> ext Info wrote:
>> I've come across an issue when aborting a POST operation which
>> seems to cause a crash every time:
>>
>> QNetworkReply *reply = m_Manager.post(request, data); // m_Manager
>> is a QNetworkAccessManager
>>
>> Now, in the same event loop, I call:
>>
>> reply->abort();
>>
>> And in the finished(QNetworkReply*) slot I have a single call:
>>
>> reply->deleteLater();
>>
>> Every time this leads to a crash, the offending line is in
>> qhttpnetworkreply_p.h, line 146. The 'this' pointer is 0x00000000,
>> so it seems the deleteLater() call is deleting the QNetworkReply
>> before the final bytesWritten() slot is triggered.
>>
>> What would cause this to happen? Should I be calling deleteLater()
>> in the finished() slot? The documentation suggests it and states
>> that there will be no more updates to the reply's data or metadata
>> but it seems it is still trying to read from the post input device
>> after the finished() event.
> Which Qt version?
> Do you have a full backtrace?
>
> Thanks,
> Markus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091106/bd0617fe/attachment.html
More information about the Qt-interest-old
mailing list