Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSharedMemory handle issues (RHEL)
Forum Updated to NodeBB v4.3 + New Features

QSharedMemory handle issues (RHEL)

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    brny
    wrote on last edited by
    #1

    Hello -

    I have a very strange problem. Basically, I use a QSharedMemory segment (Qt 4.7) in order to share/push data out from my application's main window to child windows. The child windows attach to the same segment using a completely static text key, the same used by the main window when initially creating the shared memory segment (e.g. "memory_share_test"). While the main window creates the shared memory segment, the child windows only attach (as they are opened when needed), and read data from the shared memory as needed (in order to display updating data).

    By and large, this works fine. I can open/close child windows all day and not have any issues. However, if I go away for a few days (say, across a weekend, where my updating data source is effectively offline) and come back, the child windows that are already open will continue to be fine (they can continue to see the shared memory segment fine). But if I open a new child window after this period of inactivity, I can't attach to the shared memory segment from the (new) child windows - I get the error "QSharedMemory::handle:: UNIX key file doesn't exist". Again, the child windows that are already open are fine, but if I close them (and re-open them) I get the same error. It's as if - after some time - I can no longer attach to the shared memory segment using the text key. Shutting down the whole application and restarting it (forcing the main window to re-create the shared memory again) solves the issue.

    My gut instinct is that perhaps the OS (RHEL in this case) is doing some sort of housekeeping after a period of inactivity, perhaps corrupting the ability for any new child windows to find that shared memory segment in the future. Adding to this possibility, I have been running this same application on Linux Mint as well, and I have not seen this issue (at least yet).

    Any suggestions or insight would be much appreciated!

    Thanks,

    Brett

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved