i#7955: Fix sigmask test signal race#7956
Merged
Merged
Conversation
Blocks the SIGALRM in the main thread to prevent a case where the helper thread runs quickly and sends the signal before the main thread has had a change to block in sigsuspend. SIGALRM is unblocked by the helper thread so it can receive the itimer signals. This fixes linux.sigmask and linux.sigmask-noalarm in local runs with 100x iterations. Adds a TODO for an edge case where we don't want DR to execute the app sigsuspend if a newly or previously unblocked signal is already pending Issue: #7955
derekbruening
approved these changes
Jun 19, 2026
Without blocking the SIGARLM (before this PR), the test app would sometimes have should_exit=true before even reaching the while loop, so would not execute the sigsuspend even one time. Add a check that it does.
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.
Blocks the SIGALRM in the main thread to prevent a case where the helper thread runs quickly and sends the signal before the main thread has had a chance to block in sigsuspend; the sigsuspend unblocks SIGALRM. SIGALRM is also unblocked by the helper thread so it can receive the itimer signals.
This fixes linux.sigmask and linux.sigmask-noalarm in local runs with 100x iterations, which would previously hang sometimes.
Adds a TODO for an edge case where we don't want DR to execute the app sigsuspend if a newly or previously unblocked signal is already pending. This is fixed by the subsequent PR #7958.
Issue: #7955