uspace: non-rt: Enable error-checking mode of mutexes#916
Closed
jepler wants to merge 2 commits intoLinuxCNC:masterfrom
Closed
uspace: non-rt: Enable error-checking mode of mutexes#916jepler wants to merge 2 commits intoLinuxCNC:masterfrom
jepler wants to merge 2 commits intoLinuxCNC:masterfrom
Conversation
It has been suggested that the logic in Posix::wait could lead to an unlock of a not-locked mutex. If this happens at runtime, rtapi_app will now abort. Note that as this lock is only used for sim / non-rt situations, this cannot affect people running on hardware. By setting RTAPI_LOCK_FAIL in the environment, you can check that the checking works, by causing a "lock while already locked" type error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It has been suggested at #912 that there may be a case where "you will simply try to unlock unlocked mutex which will generate undefined behavior". By switching from normal to error-check, we will get an error result instead, which will promptly cause rtapi_app to abort.