Skip to content

Commit 51167e6

Browse files
committed
fix(test): install signal mask in fast_page_fault_helper
Without calling sigprocmask, the SIGUSR1 that we're using will actually just kill the process instead of waking it up, as sigwait can only be used to wait for _pending_ signals, but signals are only marked as pending if they're blocked by a signal mask. If they're not blocked, they will instead call signal handlers, which will in this case just kill the process. This does mean that this program never worked the intended way, which also kinda proves it was not needed to show the different in page faults between huge pages and normal pages (test_ept_violation_count). Signed-off-by: Patrick Roy <[email protected]>
1 parent 0617286 commit 51167e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

resources/overlay/usr/local/bin/fast_page_fault_helper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ int main(int argc, char *const argv[]) {
2727
perror("sigaddset");
2828
return 1;
2929
}
30+
if (sigprocmask(SIG_BLOCK, &set, NULL) == -1) {
31+
perror("sigprocmask");
32+
return 1;
33+
}
3034

3135
ptr = mmap(NULL, MEM_SIZE_MIB, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
3236

0 commit comments

Comments
 (0)