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

NamedMutex_UNIX incorrectly deletes named semaphores #4876

Open
okaduki opened this issue Feb 19, 2025 · 0 comments
Open

NamedMutex_UNIX incorrectly deletes named semaphores #4876

okaduki opened this issue Feb 19, 2025 · 0 comments
Labels

Comments

@okaduki
Copy link

okaduki commented Feb 19, 2025

Description

As mentioned in the comment #271, this occurs when multiple processes use a NamedMutex with the same name.

The constructor in Foundation/src/NamedMutex_UNIX.cpp creates a semaphore if it does not exist and holds _owned=true.
If another process instantiates a NamedMutex with the same name, it holds its _semid.
After that, when a process with _owned=true terminates, the semaphore is deleted, but the _semid of the other process continues to remain.
Then, semop always fails because the semaphore has been deleted,

To Reproduce

  1. Process A creates a NamedMutex
  2. Process B creates a NamedMutex with the same name
  3. Process A terminates
  4. Process B acquires the lock (but fails)

Environment information

  • OS Type and Version: Rocky Linux 8
  • POCO Version: 1.12.1
@okaduki okaduki added the bug label Feb 19, 2025
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