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

QSharedMemory doesn't work with POSIX native shared memory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.12.4, 5.13.0
    • Core: Other
    • QNX or any other POSIX shared memory
    • QNX

    Description

      Using QSharedMemory with precreated posix shared memory results in :
      Attach failed 3 "QSharedMemory::handle: key is empty"

      Possible reason is, that when setNativeKey is used:
      https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qsharedmemory.cpp#n240
      the key is cleared and then attach calls the handle:
      https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qsharedmemory.cpp#n414
      Which calls the makePlatformSafeKey and that returns an empty string:
      https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qsharedmemory.cpp#n66
      Which results in this error:
      https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qsharedmemory_posix.cpp#n69

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            karimpinter Karim Pinter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes