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

Handle 'strerror_r' idiosyncrasies in the platform layer #1616

Closed
elfenpiff opened this issue Sep 7, 2022 · 0 comments · Fixed by #2254
Closed

Handle 'strerror_r' idiosyncrasies in the platform layer #1616

elfenpiff opened this issue Sep 7, 2022 · 0 comments · Fixed by #2254
Assignees
Labels
bug Something isn't working globex technical debt unclean code and design flaws
Milestone

Comments

@elfenpiff
Copy link
Contributor

elfenpiff commented Sep 7, 2022

Brief feature description

The function strerror which is used in the posixCall is not thread-safe, see man strerror attribute section. This can lead to undefined behavior, race condition and fatal crashes when the posixCall is used concurrently - which is a standard use case in iceoryx - and a underlying call fails.

There are strerror_r and strerror_s as thread-safe alternatives and iceoryx already switched to strerror_r. There are some idiosyncrasies in strerror_r like different return types, char* vs int, and other stuff. Furthermore on Windows only strerror_s is available which is not source compatible but offers the same functionality as one of the strerror_r versions.

All of this should be handled in the platform layer instead of the posixCall

Extracted from: #1196

@elfenpiff elfenpiff added bug Something isn't working technical debt unclean code and design flaws globex labels Sep 7, 2022
@elfenpiff elfenpiff added this to the Medium prio milestone Sep 7, 2022
@elfenpiff elfenpiff changed the title Introduce strerror_s for all iceoryx platforms Fix race condition in posixCall by replace strerror with strerror_s for all iceoryx platforms Sep 7, 2022
@elBoberido elBoberido changed the title Fix race condition in posixCall by replace strerror with strerror_s for all iceoryx platforms Handle 'strerror_r' idiosyncrasies in the platform layer Apr 14, 2024
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Apr 14, 2024
@elBoberido elBoberido self-assigned this Apr 14, 2024
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Apr 14, 2024
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Apr 14, 2024
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Apr 14, 2024
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Apr 14, 2024
elBoberido added a commit that referenced this issue Apr 14, 2024
…error_r

iox-#1616 Handle 'strerror_r' idiosyncrasies in the platform layer
@github-project-automation github-project-automation bot moved this to Done in v3.0 Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working globex technical debt unclean code and design flaws
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants