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

QNAM: Download failures after socket get's reused

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.1
    • 5.4.2, 5.5.0
    • Network
    • None
    • Linux 64 bit (Red Hat 6.6, gcc 4.9.1), static build
    • d82d5b1c43b270ef6f4f0d90ce5d7d96ea0b7a97

    Description

      When queueing multiple requests, QNAM after a while closes them with 'Unknown error'.

      Before, QIODevice prints a warning:

       QIODevice::Write: device not open
      

      Stack trace:

      #6  0x00000000011951f1 in qt_message (buf=..., ap=0x7fffe0b2d508, msg=0x177f690 "QIODevice::write: device not open", 
          context=..., msgType=QtWarningMsg) at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/global/qlogging.cpp:231
      #7  QMessageLogger::warning (this=0x7fffe0b2d600, msg=msg@entry=0x177f690 "QIODevice::write: device not open")
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/global/qlogging.cpp:396
      #8  0x00000000012f551e in QIODevice::write (this=0x7fffcc23b6d0, data=<optimized out>, maxSize=<optimized out>)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/io/qiodevice.cpp:1303
      #9  0x0000000000cd6f0f in QSslSocketBackendPrivate::transmit (this=0x7fffcc190510)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/network/ssl/qsslsocket_openssl.cpp:862
      #10 0x0000000000cd643b in QSslSocketBackendPrivate::startClientEncryption (this=0x7fffcc190510)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/network/ssl/qsslsocket_openssl.cpp:769
      #11 0x0000000000cc45e0 in QSslSocket::startClientEncryption (this=this@entry=0x7fffcc23bf50)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/network/ssl/qsslsocket.cpp:1729
      #12 0x0000000000cc50b8 in QSslSocketPrivate::_q_connectedSlot (this=0x7fffcc190510)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/network/ssl/qsslsocket.cpp:2236
      #13 0x0000000000ccab79 in QSslSocket::qt_static_metacall (_o=0x5ca1, _c=23740, _id=6, _a=0xffffffffffffffff)
          at .moc/moc_qsslsocket.cpp:152
      #14 0x00000000013d47ea in QMetaObject::activate (sender=sender@entry=0x7fffcc23b6d0, signalOffset=<optimized out>, 
          local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x0)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/kernel/qobject.cpp:3717
      #15 0x00000000013d4ed7 in QMetaObject::activate (sender=sender@entry=0x7fffcc23b6d0, 
          m=m@entry=0x1dab620 <QAbstractSocket::staticMetaObject>, local_signal_index=local_signal_index@entry=1, 
          argv=argv@entry=0x0) at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/kernel/qobject.cpp:3582
      #16 0x0000000000cabf6a in connected (this=<optimized out>) at .moc/moc_qabstractsocket.cpp:366
      #17 QAbstractSocketPrivate::fetchConnectionParameters (this=this@entry=0x7fffcc190940)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/network/socket/qabstractsocket.cpp:1326
      #18 0x0000000000caea48 in QAbstractSocketPrivate::_q_testConnection (this=0x7fffcc190940)
      ---Type <return> to continue, or q <return> to quit---c
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/network/socket/qabstractsocket.cpp:1185
      #19 0x0000000000cb76cd in QWriteNotifier::event (this=0x7fffcc0ad180, e=<optimized out>)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/network/socket/qnativesocketengine.cpp:1164
      #20 0x000000000068983c in QApplicationPrivate::notify_helper (this=0x1de5da0, receiver=0x7fffcc0ad180, e=0x7fffe0b2ebe0)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/widgets/kernel/qapplication.cpp:3720
      #21 0x000000000068e8b0 in QApplication::notify (this=0x7fffffffdd10, receiver=0x7fffcc0ad180, e=0x7fffe0b2ebe0)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/widgets/kernel/qapplication.cpp:3503
      #22 0x0000000000425509 in SDKApp<QApplication>::notify (this=<optimized out>, receiver=<optimized out>, 
          event=<optimized out>) at ../../../src/src/sdk/sdkapp.h:66
      #23 0x00000000013a5bfb in QCoreApplication::notifyInternal (this=0x7fffffffdd10, receiver=0x7fffcc0ad180, 
          event=event@entry=0x7fffe0b2ebe0) at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/kernel/qcoreapplication.cpp:935
      #24 0x00000000013f4f8f in sendEvent (event=0x7fffe0b2ebe0, receiver=<optimized out>)
          at ../../include/QtCore/../../../../src/qtbase/src/corelib/kernel/qcoreapplication.h:228
      #25 QEventDispatcherUNIX::activateSocketNotifiers (this=this@entry=0x7fffcc19d140)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:565
      #26 0x00000000013f5478 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x7fffcc0f80d0, flags=..., 
          flags@entry=..., timeout=timeout@entry=0x7fffe0b2ed50)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:264
      #27 0x00000000013f58e1 in QEventDispatcherUNIX::processEvents (this=0x7fffcc19d140, flags=...)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:607
      #28 0x00000000013a3609 in processEvents (flags=..., this=0x7fffe0b2ee10)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/kernel/qeventloop.cpp:128
      #29 QEventLoop::exec (this=this@entry=0x7fffe0b2ee10, flags=..., flags@entry=...)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/kernel/qeventloop.cpp:204
      #30 0x00000000011a50d4 in exec (this=<optimized out>)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/thread/qthread.cpp:503
      #31 QThread::run (this=<optimized out>) at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/thread/qthread.cpp:570
      #32 0x00000000011aa62f in QThreadPrivate::start (arg=0x7fffd808dd10)
          at /home/kakoehne/dev/qt/5.4/src/qtbase/src/corelib/thread/qthread_unix.cpp:337
      #33 0x00000035650079d1 in start_thread () from /lib64/libpthread.so.0
      #34 0x0000003564ce88fd in clone () from /lib64/libc.so.6
      

      This seems to happen because QNAM reused a QTcpSocket, but closes it right after calling connectToHost.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-47048
          # Subject Branch Project Status CR V

          Activity

            People

              mgoetz2 Markus Goetz (Woboq GmbH)
              kkohne Kai Köhne
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes