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

Creating a read-only SharedMemoryObject #1821

Closed
tobiasblass opened this issue Dec 8, 2022 · 0 comments · Fixed by #1822
Closed

Creating a read-only SharedMemoryObject #1821

tobiasblass opened this issue Dec 8, 2022 · 0 comments · Fixed by #1822
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tobiasblass
Copy link
Contributor

Required information

Operating system:
Ubuntu 20.04.3 LTS

Compiler version:
gcc 8.4

Observed result or behaviour:

The produced error is

[ 22 ]  Invalid argument
Unable to create shared memory with the following properties [ name = readOnlyShmMem, access mode = AccessMode::READ_ONLY, open mode = OpenMode::PURGE_AND_CREATE, mode = 0000, sizeInBytes = 100 ]
Requested Shared Memory is larger then the maximum file size or the filedescriptor does not belong to a regular file.

Expected result or behaviour:

The error message is incorrect: both the size and the file are all right, the problem is that creating the segment involves truncate, which requires write permission.

The error should idenfity the READ_ONLY AccessMode as the problem, or the call should not accept AccessMode in the first place.

Conditions where it occurred / Performed steps:

    auto sut = iox::posix::SharedMemoryObjectBuilder()
                   .name("readOnlyShmMem")
                   .memorySizeInBytes(100)
                   .accessMode(iox::posix::AccessMode::READ_ONLY)
                   .openMode(iox::posix::OpenMode::PURGE_AND_CREATE)
                   .create();
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 8, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 8, 2022
@mossmaurice mossmaurice added the bug Something isn't working label Dec 13, 2022
@mossmaurice mossmaurice added this to the Medium prio milestone Dec 13, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Dec 20, 2022
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Jan 31, 2023
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Jan 31, 2023
tobiasblass added a commit to tobiasblass/iceoryx that referenced this issue Jan 31, 2023
elBoberido added a commit that referenced this issue Jan 31, 2023
…age-when-creating-read-only-segment

iox-#1821 improve error message when creating read-only segment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants