Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.6.0, 6.6
-
None
-
-
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
For Gerrit Dashboard: QTBUG-111855 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
515638,3 | QSharedMemory: fix semaphore creation in legacy mode | dev | qt/qtbase | Status: MERGED | +2 | 0 |
515776,2 | QSharedMemory: fix semaphore creation in legacy mode | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
518039,4 | IPC: deprecate QSharedMemory and QSystemSemaphore | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |