Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10649

QByteDataBuffer::read() should check buffers.isEmpty() before using buffers.first()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.6.3
    • 4.6.2
    • Network
    • None
    • Qt 4.6.2 on Windows XP.
    • 20689ba77501c6c91d3db78f81f7ce64e7d15b95

    Description

      QByteDataBuffer::read() should check buffers.isEmpty() before using buffers.first(). In the case where the buffer is empty (which seems to happen sometimes when disconnectiong), this leads to triggering a fatal assertion.

      See following stack trace:

      QtCored4.dll!qt_message_output(QtMsgType msgType=QtFatalMsg, const char * buf=0x0a199b00)  Zeile 2195	C++
       	QtCored4.dll!qt_message(QtMsgType msgType=QtFatalMsg, const char * msg=0x67292060, char * ap=0x00e4e76c)  Zeile 2296 + 0x12 Bytes	C++
       	QtCored4.dll!qFatal(const char * msg=0x67292060, ...)  Zeile 2479 + 0xf Bytes	C++
       	QtCored4.dll!qt_assert(const char * assertion=0x640f44a8, const char * file=0x640f44b8, int line=263)  Zeile 2013 + 0x16 Bytes	C++
       	QtNetworkd4.dll!QList<QByteArray>::first()  Zeile 263 + 0x2d Bytes	C++
      >	QtNetworkd4.dll!QByteDataBuffer::read()  Zeile 109 + 0x8 Bytes	C++
       	QtNetworkd4.dll!QHttpNetworkReply::readAny()  Zeile 185 + 0x12 Bytes	C++
       	QtNetworkd4.dll!QNetworkAccessHttpBackend::readFromHttp()  Zeile 683 + 0xf Bytes	C++
       	QtNetworkd4.dll!QNetworkAccessHttpBackend::replyReadyRead()  Zeile 669	C++
       	QtNetworkd4.dll!QNetworkAccessHttpBackend::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=0, void * * _a=0x00e4e8ec)  Zeile 85 + 0x8 Bytes	C++
       	QtCored4.dll!QMetaObject::metacall(QObject * object=0x0468ce10, QMetaObject::Call cl=InvokeMetaMethod, int idx=13, void * * argv=0x00e4e8ec)  Zeile 238	C++
       	QtCored4.dll!QMetaObject::activate(QObject * sender=0x084e7c28, const QMetaObject * m=0x6415cfac, int local_signal_index=1, void * * argv=0x00000000)  Zeile 3285 + 0x27 Bytes	C++
       	QtNetworkd4.dll!QHttpNetworkReply::readyRead()  Zeile 113 + 0x13 Bytes	C++
       	QtNetworkd4.dll!QHttpNetworkConnectionChannel::expand(bool dataComplete=true)  Zeile 528	C++
       	QtNetworkd4.dll!QHttpNetworkConnectionChannel::allDone()  Zeile 555	C++
       	QtNetworkd4.dll!QHttpNetworkConnectionChannel::_q_receiveReply()  Zeile 291	C++
       	QtNetworkd4.dll!QHttpNetworkConnectionChannel::_q_disconnected()  Zeile 793	C++
       	QtNetworkd4.dll!QHttpNetworkConnectionChannel::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=3, void * * _a=0x00e4ed00)  Zeile 93 + 0x8 Bytes	C++
       	QtCored4.dll!QMetaObject::metacall(QObject * object=0x099f822c, QMetaObject::Call cl=InvokeMetaMethod, int idx=7, void * * argv=0x00e4ed00)  Zeile 238	C++
       	QtCored4.dll!QMetaObject::activate(QObject * sender=0x0dd133a0, const QMetaObject * m=0x6415a6b4, int local_signal_index=2, void * * argv=0x00000000)  Zeile 3285 + 0x27 Bytes	C++
       	QtNetworkd4.dll!QAbstractSocket::disconnected()  Zeile 142 + 0x13 Bytes	C++
       	QtNetworkd4.dll!QAbstractSocket::disconnectFromHostImplementation()  Zeile 2414	C++
       	QtNetworkd4.dll!QAbstractSocket::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=10, void * * _a=0x00e4ee4c)  Zeile 114 + 0x8 Bytes	C++
       	QtNetworkd4.dll!QTcpSocket::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=18, void * * _a=0x00e4ee4c)  Zeile 64 + 0x14 Bytes	C++
       	QtCored4.dll!QMetaObject::metacall(QObject * object=0x0dd133a0, QMetaObject::Call cl=InvokeMetaMethod, int idx=18, void * * argv=0x00e4ee4c)  Zeile 238	C++
       	QtCored4.dll!QMetaMethod::invoke(QObject * object=0x0dd133a0, Qt::ConnectionType connectionType=DirectConnection, QGenericReturnArgument returnValue={...}, QGenericArgument val0={...}, QGenericArgument val1={...}, QGenericArgument val2={...}, QGenericArgument val3={...}, QGenericArgument val4={...}, QGenericArgument val5={...}, QGenericArgument val6={...}, QGenericArgument val7={...}, QGenericArgument val8={...}, QGenericArgument val9={...})  Zeile 1533 + 0x13 Bytes	C++
       	QtCored4.dll!QMetaObject::invokeMethod(QObject * obj=0x0dd133a0, const char * member=0x6410022c, Qt::ConnectionType type=DirectConnection, QGenericReturnArgument ret={...}, QGenericArgument val0={...}, QGenericArgument val1={...}, QGenericArgument val2={...}, QGenericArgument val3={...}, QGenericArgument val4={...}, QGenericArgument val5={...}, QGenericArgument val6={...}, QGenericArgument val7={...}, QGenericArgument val8={...}, QGenericArgument val9={...})  Zeile 1113 + 0x68 Bytes	C++
       	QtCored4.dll!QMetaObject::invokeMethod(QObject * obj=0x0dd133a0, const char * member=0x6410022c, Qt::ConnectionType type=DirectConnection, QGenericArgument val0={...}, QGenericArgument val1={...}, QGenericArgument val2={...}, QGenericArgument val3={...}, QGenericArgument val4={...}, QGenericArgument val5={...}, QGenericArgument val6={...}, QGenericArgument val7={...}, QGenericArgument val8={...}, QGenericArgument val9={...})  Zeile 398 + 0x74 Bytes	C++
       	QtNetworkd4.dll!QAbstractSocket::disconnectFromHost()  Zeile 2315 + 0xd9 Bytes	C++
       	QtNetworkd4.dll!QAbstractSocket::close()  Zeile 2296	C++
       	QtNetworkd4.dll!QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate()  Zeile 108	C++
       	QtNetworkd4.dll!QHttpNetworkConnectionPrivate::`scalar deleting destructor'()  + 0xf Bytes	C++
       	QtCored4.dll!QScopedPointerDeleter<QObjectData>::cleanup(QObjectData * pointer=0x08bac480)  Zeile 62 + 0x20 Bytes	C++
       	QtCored4.dll!QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> >::~QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> >()  Zeile 100 + 0x9 Bytes	C++
       	QtCored4.dll!QObject::~QObject()  Zeile 992 + 0x12 Bytes	C++
       	QtNetworkd4.dll!QHttpNetworkConnection::~QHttpNetworkConnection()  Zeile 774 + 0x9 Bytes	C++
       	QtNetworkd4.dll!QNetworkAccessCachedHttpConnection::~QNetworkAccessCachedHttpConnection()  + 0x47 Bytes	C++
       	QtNetworkd4.dll!QNetworkAccessCachedHttpConnection::`scalar deleting destructor'()  + 0xf Bytes	C++
       	QtNetworkd4.dll!QNetworkAccessCachedHttpConnection::dispose()  Zeile 290 + 0x24 Bytes	C++
       	QtNetworkd4.dll!QNetworkAccessCache::clear()  Zeile 127	C++
       	QtNetworkd4.dll!QNetworkAccessCache::~QNetworkAccessCache()  Zeile 114	C++
       	QtNetworkd4.dll!QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate()  Zeile 999 + 0xb Bytes	C++
       	QtNetworkd4.dll!QNetworkAccessManagerPrivate::`scalar deleting destructor'()  + 0xf Bytes	C++
       	QtCored4.dll!QScopedPointerDeleter<QObjectData>::cleanup(QObjectData * pointer=0x0e388dd0)  Zeile 62 + 0x20 Bytes	C++
       	QtCored4.dll!QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> >::~QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> >()  Zeile 100 + 0x9 Bytes	C++
       	QtCored4.dll!QObject::~QObject()  Zeile 992 + 0x12 Bytes	C++
       	QtNetworkd4.dll!QNetworkAccessManager::~QNetworkAccessManager()  Zeile 363 + 0x10 Bytes	C++
       	QtWebKitd4.dll!QNetworkAccessManager::`scalar deleting destructor'()  + 0x10 Bytes	C++
       	QtCored4.dll!QObjectPrivate::deleteChildren()  Zeile 1978 + 0x24 Bytes	C++
       	QtCored4.dll!QObject::~QObject()  Zeile 977	C++
       	QtWebKitd4.dll!QWebPage::~QWebPage()  Zeile 1720 + 0x10 Bytes	C++
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mgoetz Markus Goetz (Inactive)
            wurstbrot Wurstbrot mit Senf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes