Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboards on POSIX may not persist properly #43

Open
btzy opened this issue Jul 25, 2018 · 1 comment
Open

Clipboards on POSIX may not persist properly #43

btzy opened this issue Jul 25, 2018 · 1 comment
Labels

Comments

@btzy
Copy link
Owner

btzy commented Jul 25, 2018

  1. Open an instance of Circuit Sandbox.
  2. Write to a clipboard.
  3. Open another instance of Circuit Sandbox.
  4. Close the first instance.
  5. Open another instance of Circuit Sandbox. This new instance might not be able to read the data saved by the first instance.

See how Boost.Interprocess and shm_unlink works.

@btzy btzy added Type: Bug Bugs and unexpected behavior Platform: Linux Priority: Medium labels Jul 26, 2018
btzy added a commit that referenced this issue Aug 4, 2018
- This is a not-very-ideal solution for process-persistant shared memory on linux (#43).
- It is implemented by incrementing a counter stored on the shared memory when the shared memory is created or opened, and decrementing the counter when the shared memory is closed (the process that decremented the counter to zero is responsible for removing the shared memory).
- If Circuit Sandbox crashes or is otherwise killed, the shared memory won't be removed until a system reboot.
@btzy
Copy link
Owner Author

btzy commented Aug 5, 2018

6c5f04b introduces reference counting for the POSIX shared memory. It fixes the bug for the sequence of actions above, and it works as intended as long as Circuit Sandbox does not crash or exit in an abnormal manner. If it crashes or exits abnormally, the reference count will not be decremented and the shared memory will not be removed until the system is rebooted (because POSIX shared memory has kernel persistence).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant