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

Windows shm_open must be threadsafe #1269

Closed
elfenpiff opened this issue Mar 10, 2022 · 0 comments · Fixed by #1270 or #1285
Closed

Windows shm_open must be threadsafe #1269

elfenpiff opened this issue Mar 10, 2022 · 0 comments · Fixed by #1270 or #1285
Assignees
Milestone

Comments

@elfenpiff
Copy link
Contributor

elfenpiff commented Mar 10, 2022

Required information

Operating system:
Windows

Compiler version:
All

Observed result or behaviour:
When iox_shm_open/iox_shm_unlink is called concurrently in Windows it is possible that the underlying std::set openSharedMemorySegments is written concurrently in a non threadsafe way. This has to be protected by a mutex.

When Windows fails to create a shared memory segment the failure is observed when mapping it into the process and the error message just states the the file handle is invalid. So the user has no clue about the origin of the error.
This can happen when roudi creates the shm segments or when a named pipe for inter process communication between roudi and app is created.

Expected result or behaviour:
A threadsafe iox_shm_open and iox_shm_unlink function

A detailed error message which states why the shm segment creation failed.

@elfenpiff elfenpiff self-assigned this Mar 10, 2022
@elfenpiff elfenpiff changed the title More detailed error message on windows shm failures Windows shm_open must be threadsafe Mar 10, 2022
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 10, 2022
…windows shm_* functions and mmap/munmap

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 10, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 10, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 10, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 10, 2022
…windows shm_* functions and mmap/munmap

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 10, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
@elfenpiff elfenpiff added this to the High prio milestone Mar 10, 2022
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 10, 2022
…te changelog

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit that referenced this issue Mar 10, 2022
…ns-in-windows

iox-#1269 threadsafe shm_open/shm_unlink in windows
@elBoberido elBoberido linked a pull request Mar 11, 2022 that will close this issue
21 tasks
@elBoberido elBoberido linked a pull request Mar 11, 2022 that will close this issue
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant