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

Deadlock when resizing/closing QWS client application when using QT_POSIX_IPC codepath

    XMLWordPrintable

Details

    • f7293da06ceecc236d000389e7115f5cc42cafa1

    Description

      Changes to application size (geometry) will cause region request (void QWSServerPrivate::request_region) which always calls QWSWindow::createSurface function causing delete/create of new QWSSharedMemSurface on the server side. Deletion of this surface will destroy shared memory id and memory lock (QWSLock) attached to it causing the client waiting release of the lock at QWSLock::down function to halt on deadlock.

      Delete/creating of new QWSSharedMemSurface is unnecessary, because the size of the shared memory has already been adjusted to new client region size in the QWSSharedMemSurface::setGeometry(const QRect &rect) function.

      Same happens on embedded linux with non QT_POSIX_IPC codepath, but it does not cause client to go halt deadlock but will end up flooding console with messages:

      QWSLock::up(): invalid argument
      QWSLock::up(): invalid argument

      Reason for this is (probably) because it uses different semaphore implementation (sysv). Changing usage of sem_wait to sem_trywait in QWSLock::down function will prevent deadlock to happen, but then also the console is flooded with error messages like above.

      Steps to reproduce:
      1. Start qws server application
      2. Start qws client application
      3. Resize client window larger of close it

      Attachments

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

        Activity

          People

            papetaja Pasi Petäjäjärvi
            papetaja Pasi Petäjäjärvi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes