Skip to content

Commit 03d5101

Browse files
authored
Add REQUIRES: shell to Tests Requiring Full Shell Functionality with lit Internal Shell (#102988)
This patch adds the `REQUIRES: shell` directive to compiler-rt's fuzzer tests that require full shell functionality when using the lit internal shell. These tests depend on features such as background processes, signal handling, and session management, which are not supported by lit's internal shell. The addition of this directive ensures that these tests are only executed in environments that provide the necessary shell capabilities. **Details of the Change:** The following considerations were addressed: - **Background Processes (`&`):** The tests run commands in the background using the `&` operator, which allows the shell to execute commands concurrently without waiting for each one to finish. In a standard Unix-like shell, this is a common feature that facilitates multitasking. However, lit's internal shell does not fully support background job control, which can lead to unpredictable behavior or test failures. Without proper handling of background processes, subsequent commands that depend on the status of these processes may not function correctly. - **Signal Handling (`kill -SIGUSR1`, `kill -SIGUSR2`, `kill -SIGINT`):** These tests involve sending specific signals like `SIGUSR1`, `SIGUSR2`, and `SIGINT` to running processes. These signals are used to trigger certain behaviors in the processes, such as pausing, resuming, or terminating. However, lit's internal shell may not handle these signals properly—it might not send the signal correctly, or the process might not respond as it should. This could lead to the test failing, not because the process is incorrect, but because the shell didn't manage the signals as required. - **Session Management (`setsid`):** The tests use `setsid` to create new sessions, detaching processes from their controlling terminal and isolating them into their own process groups. However, the internal shell in lit does not support session management features like `setsid`, this can't correctly isolate and manage processes as required by these tests. This change is relevant for enabling the lit internal shell by default, as outlined in [[RFC] Enabling the Lit Internal Shell by Default](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179)
1 parent 4371c79 commit 03d5101

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

compiler-rt/test/fuzzer/fork-sigusr.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Check that libFuzzer honors SIGUSR1/SIGUSR2
22
# Disabled on Windows which does not have SIGUSR1/SIGUSR2.
3+
REQUIRES: shell
34
UNSUPPORTED: darwin, target={{.*windows.*}}, target=aarch64{{.*}}
45
RUN: rm -rf %t
56
RUN: mkdir -p %t

compiler-rt/test/fuzzer/merge-sigusr.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Check that libFuzzer honors SIGUSR1/SIGUSR2
22
# FIXME: Disabled on Windows for now because of reliance on posix only features
33
# (eg: export, "&", pkill).
4+
REQUIRES: shell
45
UNSUPPORTED: darwin, target={{.*windows.*}}
56
RUN: rm -rf %t
67
RUN: mkdir -p %t

compiler-rt/test/fuzzer/sigint.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REQUIRES: msan
1+
REQUIRES: shell, msan
22
UNSUPPORTED: target=arm{{.*}}
33

44
# Check that libFuzzer exits gracefully under SIGINT with MSan.

compiler-rt/test/fuzzer/sigusr.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# FIXME: Disabled on Windows for now because of reliance on posix only features
22
# (eg: export, "&", pkill).
3+
REQUIRES: shell
34
UNSUPPORTED: darwin, target={{.*windows.*}}
45
# Check that libFuzzer honors SIGUSR1/SIGUSR2
56
RUN: rm -rf %t

0 commit comments

Comments
 (0)