qt5base-lts/tests/auto/corelib/ipc
Ivan Solovev e85a3cde2f QSharedMemory: fix attach() -> create() for non-legacy SystemV mode
The problem with non-legacy mode is that the backend uses the same
filename for the system semaphore file and for the shared memory file.

What happens is that when we try to call attach(), a semaphore is
created. Later in attach() we set unix_key, because ftok() returns
a valid handle (it uses the file which was created for semaphore).
After that, an attempt to actually attach to a shared memory fails, but
no clean-up is done.
So, a later call to create() sees that unix_key is already valid, but
it cannot properly clean it, because it does not actually refer to
any shared memory.

Fix it by cleaning up unix_key and nativeKeyFile if shmget() call in
attach() fails.

Pick-to: 6.6
Change-Id: Ibccc3ac307d8b2e07e1b9b24b55f97a859a03131
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-08 15:56:54 +01:00
..
qnativeipckey IPC: Move the legacy key to the QNativeIpcKey 2023-09-17 18:10:18 -07:00
qsharedmemory QSharedMemory: fix attach() -> create() for non-legacy SystemV mode 2023-11-08 15:56:54 +01:00
qsystemsemaphore CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
CMakeLists.txt IPC: add native key support to QSharedMemory 2023-01-22 13:02:04 -03:00
ipctestcommon.h IPC: add support for multiple backends to QSystemSemaphore 2023-01-22 13:02:10 -03:00