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

[PATCH] QNetworkDiskCache crash with overlapping requests for the same URL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 4.7.3
    • Fix Version/s: None
    • Component/s: Network: Cache
    • Labels:
      None

      Description

      Scenario:
      Request A causes POST on url X ->
      QAbstractNetworkCache::prepare() returns a device Y
      Request A data starts streaming to device Y
      Request B starts another POST on URL X ->
      QNetworkAccessHttpBackend invalidates cache for url X by calling QAbstractNetworkCache::remove(X), which in turn deletes the C++ object for device Y
      Request A receives the next chunk of data ->
      Request A tries to stream data to device Y, but the pointer is pointing to freed memory -> BOOM

      Or more higher level:
      Overlapping operations on a QNetworkAccessManager with same URL may step on each others toes when interacting with the cache.

      One possible solution could be to extend QAbstractNetworkCache with another method which does remove by device, and change the behavior of remove so it doesn't do anything if any devices are currently handed out, except that this changes its current behavior...

      Any ideas?

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                oleavr Ole André Vadla Ravnås
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes