Skip to content

i#7955: Fix sigmask test signal race#7956

Merged
abhinav92003 merged 3 commits into
masterfrom
i7955-improve-signal-test
Jun 21, 2026
Merged

i#7955: Fix sigmask test signal race#7956
abhinav92003 merged 3 commits into
masterfrom
i7955-improve-signal-test

Conversation

@abhinav92003

@abhinav92003 abhinav92003 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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

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
@abhinav92003 abhinav92003 changed the title Fix sigmask test signal race i#7955: Fix sigmask test signal race Jun 19, 2026
Comment thread core/unix/os.c Outdated
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.
@abhinav92003 abhinav92003 merged commit c9e8633 into master Jun 21, 2026
23 checks passed
@abhinav92003 abhinav92003 deleted the i7955-improve-signal-test branch June 21, 2026 23:29
@abhinav92003 abhinav92003 restored the i7955-improve-signal-test branch June 22, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants