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

QSharedMemory no longer works using the old constructor after recent changes in dev

    XMLWordPrintable

Details

    • Linux/X11, macOS
    • 13
    • 02c42b26e (dev), c62c335be (6.6)
    • Foundation PM Staging

    Description

      The following QSharedMemory constructor no longer works like it did:

       

      QSharedMemory(const QString &key, QObject *parent = nullptr)

       

      I'm currently testing using dev commit f7ea9b36b7c56bb288f3ea55f587d2ccb8a9b7fa

      1. Start a program, create a QSharedMemory with a specific key, and exec the event loop. Let the program continue to run.

      2. Next, start the program again, QSharedMemory::create fails, you then attach to using QSharedMemory::attach. Delete the QSharedMemory and exit the program.

      3. Do the same again, QSharedMemory::create succeeds with the same key.

      See attched example code.

      It was a while since I started looking into this, but I believe that I found out that the regression is somewhere between commit 510e0914c047beac1d1f18b7b52a7687d3a0bda1 and b330f212a94bd59490b3aecb293b48d147f21a76 (I believe the commits in between didn't compile).

      I've tested the QNativeIpcKey constructor, and it does not have the issue, except it is no longer possible to recover if the program crashes. Previously with the QString constructor it was possible to recover from a crashed program by attaching, detaching and deleting the QSharedMemory, the next time it was possible to recreate the shared memory using the same key used by the crashed process.

       

       

       

      Attachments

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

        Activity

          People

            ivan.solovev Ivan Solovev
            jonaski Jonas Kvinge
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes