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

QNetworkAccessManager crashes when used with QNetworkDiskCache on a cache hit

    XMLWordPrintable

    Details

    • Commits:
      d03a28a289cf0665290e6ea0375b31cbb2d6649e

      Description

      We are using QNetworkAccessManager with a QNetworkDiskCache instance set as the cache. Our application uses its QML UI to make network requests to retrieve JSON and image data. The data is cached to make the UI responsive. When the disk cache is empty everything works as expected, but when the application is closed and restarted. We get a cache hit for the first retrieved URL, which is in the cache and the ::data function return the valid JSON, but after this the application crashes. (the JSON contains the image urls). If we only cache images, everything works as expected. Would expect to be able to cache both json and image data.

      Here's the crash callstack:

      Program terminated with signal 11, Segmentation fault.
      #0  0x3bf6ac50 in QNetworkAccessHttpBackend::canResume (this=<value optimized out>) at access/qnetworkaccesshttpbackend.cpp:1134
      #1  0x3bf808a8 in QNetworkReplyImplPrivate::migrateBackend (this=0x1f818a88) at access/qnetworkreplyimpl.cpp:917
      #2  0x3bf82190 in QNetworkReplyImpl::qt_metacall (this=0x1f789ed8, _c=QMetaObject::InvokeMetaMethod, _id=-5, _a=0xaefcfb9c)
          at .moc/release-shared/moc_qnetworkreplyimpl_p.cpp:99
      #3  0x3c1bd500 in QMetaObject::metacall (object=0xaefcf9e4, cl=4294716920, idx=1006896576, argv=0x1f818a88)
          at kernel/qmetaobject.cpp:237
      #4  0x3c1d3070 in QMetaObject::activate (sender=0x1f7d7cb8, m=<value optimized out>, local_signal_index=<value optimized out>, 
          argv=0x1f818a88) at kernel/qobject.cpp:3278
      #5  0x3bf5ed3c in QNetworkAccessManager::qt_metacall (this=0x1f7d7cb8, _c=QMetaObject::InvokeMetaMethod, _id=-6, _a=0x1f9991c0)
          at .moc/release-shared/moc_qnetworkaccessmanager.cpp:105
      #6  0x1f5a0d44 in MorpheusNetworkAccessManager::qt_metacall (this=0xaefcf9e4, _c=4294716920, _id=1006896576, _a=0x1f818a88)
          at ../tmp/moc/moc_morpheusnetworkaccessmanager.cpp:84
      #7  0x3c1bd500 in QMetaObject::metacall (object=0xaefcf9e4, cl=4294716920, idx=1006896576, argv=0x1f818a88)
          at kernel/qmetaobject.cpp:237
      #8  0x3c1cc210 in QObject::event (this=0x1f7d7cb8, e=<value optimized out>) at kernel/qobject.cpp:1217
      #9  0x3b6777f4 in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=0x1f7d7cb8, e=0x1f78ad70)
          at kernel/qapplication.cpp:4463
      #10 0x3b67d384 in QApplication::notify (this=0x1f752230, receiver=0x1f7d7cb8, e=0x1f78ad70) at kernel/qapplication.cpp:4342
      #11 0x3c1b7448 in QCoreApplication::notifyInternal (this=0x1f752230, receiver=<value optimized out>, event=0x1f78ad70)
          at kernel/qcoreapplication.cpp:787
      #12 0x3c1bb7d0 in sendEvent (receiver=0x0, event_type=0, data=0x1f73ee30) at kernel/qcoreapplication.h:215
      #13 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x1f73ee30) at kernel/qcoreapplication.cpp:1428
      #14 0x3c1ea200 in sendPostedEvents (s=0x1f7545a8) at kernel/qcoreapplication.h:220
      #15 postEventSourceDispatch (s=0x1f7545a8) at kernel/qeventdispatcher_glib.cpp:277
      #16 0x3c96e55c in g_main_dispatch (context=<value optimized out>)
          at /home/bifh9/cs2009q3-armel/work/glib2.0-2.28.4/./glib/gmain.c:2440
      #17 g_main_context_dispatch (context=<value optimized out>) at /home/bifh9/cs2009q3-armel/work/glib2.0-2.28.4/./glib/gmain.c:3013
      #18 0x3c972d5c in g_main_context_iterate (context=0x1f754e00, block=<value optimized out>, dispatch=<value optimized out>, 
          self=<value optimized out>) at /home/bifh9/cs2009q3-armel/work/glib2.0-2.28.4/./glib/gmain.c:3091
      #19 0x3c972fbc in g_main_context_iteration (context=0x1f754e00, may_block=1)
          at /home/bifh9/cs2009q3-armel/work/glib2.0-2.28.4/./glib/gmain.c:3154
      #20 0x3c1e9d18 in QEventDispatcherGlib::processEvents (this=0x1f752b70, flags=...) at kernel/qeventdispatcher_glib.cpp:422
      #21 0x3b72ef54 in QGuiEventDispatcherGlib::processEvents (this=0xaefcf9e4, flags=<value optimized out>)
          at kernel/qguieventdispatcher_glib.cpp:204
      #22 0x3c1bbc94 in QCoreApplication::processEvents (flags=...) at kernel/qcoreapplication.cpp:979
      #23 0x3cd616f4 in ContextProperty::waitForSubscription() const () from /usr/lib/libcontextsubscriber.so.0
      #24 0x3f52ecd8 in MDeclarativeScreenPrivate::initContextSubscriber() () from /usr/lib/qt4/imports/com/meego/libmeegoplugin.so
      #25 0x3f52edf8 in MDeclarativeScreen::MDeclarativeScreen(QDeclarativeItem*) ()
         from /usr/lib/qt4/imports/com/meego/libmeegoplugin.so
      #26 0x3f52ee70 in MDeclarativeScreen::instance() () from /usr/lib/qt4/imports/com/meego/libmeegoplugin.so
      #27 0x3f528ca4 in MeeGoPlugin::initializeEngine(QDeclarativeEngine*, char const*) ()
         from /usr/lib/qt4/imports/com/meego/libmeegoplugin.so
      #28 0x3f528ca4 in MeeGoPlugin::initializeEngine(QDeclarativeEngine*, char const*) ()
         from /usr/lib/qt4/imports/com/meego/libmeegoplugin.so
      

        Attachments

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

          Activity

            People

            Assignee:
            epenttin Eero Penttinen
            Reporter:
            tokoskin Tomi Koskinen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes