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

fix(NamedEvent): Release semaphore ID in dtor when created with semget (fixes #2971) #4357

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matejk
Copy link
Contributor

@matejk matejk commented Dec 18, 2023

When a semaphore id is created with semget, it is released in dtor with semctl(..IPC_RMID).

@matejk matejk added this to the Release 1.13.0 milestone Dec 18, 2023
@matejk matejk marked this pull request as draft December 18, 2023 09:07
@matejk matejk force-pushed the 2971-fix-release-sysv-semaphore-id branch 2 times, most recently from eecf927 to bee5a2a Compare December 18, 2023 09:45
@matejk
Copy link
Contributor Author

matejk commented Dec 18, 2023

Releasing semaphore IDs on Linux seems to be solved, however it seems that named event is not correctly implemented on macOS also.

The following test throws exception with errno 28 (ENOSPC):

		int i = 0;
		for (; i < 40000; i++)
		{
			name = std::string("TestEvent ") + std::to_string(i);
			NamedEvent* ne = new NamedEvent(name);
			delete ne;
		}

sem_unlink shall probably be called somewhere, however I am not familiar with semaphores in details.

@matejk matejk force-pushed the 2971-fix-release-sysv-semaphore-id branch from bee5a2a to 4b7ac25 Compare December 22, 2023 08:34
@matejk matejk linked an issue Jan 31, 2024 that may be closed by this pull request
@matejk matejk modified the milestones: Release 1.13.1, Release 1.14.0 Jan 31, 2024
@matejk matejk force-pushed the 2971-fix-release-sysv-semaphore-id branch from 4b7ac25 to bf451e5 Compare March 9, 2024 16:42
@matejk matejk force-pushed the 2971-fix-release-sysv-semaphore-id branch from bf451e5 to 95c5609 Compare March 26, 2024 23:41
@matejk matejk deleted the branch main April 15, 2024 11:20
@matejk matejk closed this Apr 15, 2024
@matejk matejk reopened this Apr 22, 2024
@matejk matejk changed the base branch from devel to main April 22, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poco::NamedEvent does not release System V semaphore on Linux
2 participants