Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sanitizer_common] Adjust signal_send.cpp for Linux/sparc64 #100538

Merged

Conversation

rorth
Copy link
Collaborator

@rorth rorth commented Jul 25, 2024

  SanitizerCommon-ubsan-sparc-Linux :: Linux/signal_send.cpp

currently FAILs on Linux/sparc64 (32 and 64-bit). Instead of the expected values for SIGUSR1 (10) and SIGUSR1 (12), that target uses 30 and 31.

On Linux/x86_64, the signals get their values from x86_64-linux-gnu/bits/signum-generic.h, to be overridden in x86_64-linux-gnu/bits/signum.h. On Linux/sparc64 OTOH, the definitions are from sparc64-linux-gnu/bits/signum-arch.h and remain that way. There's no signum.h at all.

The patch allows for both values.

Tested on sparc64-unknown-linux-gnu and x86_64-pc-linux-gnu.

```
  SanitizerCommon-ubsan-sparc-Linux :: Linux/signal_send.cpp
```
currently `FAIL`s on Linux/sparc64 (32 and 64-bit).  Instead of the
expected values for `SIGUSR1` (`10`) and `SIGUSR1` (`12`), that target uses
`30` and `31`.

On Linux/x86_64, the signals get their values from
`x86_64-linux-gnu/bits/signum-generic.h`, to be overridden in
`x86_64-linux-gnu/bits/signum.h`.  On Linux/sparc64 OTOH, the definitions
are from `sparc64-linux-gnu/bits/signum-arch.h` and remain that way.
There's no `signum.h` at all.

The patch allows for both values.

Tested on `sparc64-unknown-linux-gnu` and `x86_64-pc-linux-gnu`.
@llvmbot
Copy link
Member

llvmbot commented Jul 25, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Rainer Orth (rorth)

Changes
  SanitizerCommon-ubsan-sparc-Linux :: Linux/signal_send.cpp

currently FAILs on Linux/sparc64 (32 and 64-bit). Instead of the expected values for SIGUSR1 (10) and SIGUSR1 (12), that target uses 30 and 31.

On Linux/x86_64, the signals get their values from x86_64-linux-gnu/bits/signum-generic.h, to be overridden in x86_64-linux-gnu/bits/signum.h. On Linux/sparc64 OTOH, the definitions are from sparc64-linux-gnu/bits/signum-arch.h and remain that way. There's no signum.h at all.

The patch allows for both values.

Tested on sparc64-unknown-linux-gnu and x86_64-pc-linux-gnu.


Full diff: https://github.com/llvm/llvm-project/pull/100538.diff

1 Files Affected:

  • (modified) compiler-rt/test/sanitizer_common/TestCases/Linux/signal_send.cpp (+2-2)
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_send.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_send.cpp
index 035a5a8df77ae..638be63397dc6 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_send.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_send.cpp
@@ -62,14 +62,14 @@ void test_sigwait() {
   int res;
   res = fork_and_signal(s);
   fprintf(stderr, "fork_and_signal with SIGUSR1,2: %d\n", res);
-  // CHECK: died with sig 10
+  // CHECK: died with sig {{10|30}}
   // CHECK: fork_and_signal with SIGUSR1,2: 0
 
   // test sigandset... s should only have SIGUSR2 now
   s = sigset_and(s, mkset(1, SIGUSR2));
   res = fork_and_signal(s);
   fprintf(stderr, "fork_and_signal with SIGUSR2: %d\n", res);
-  // CHECK: died with sig 12
+  // CHECK: died with sig {{12|31}}
   // CHECK: fork_and_signal with SIGUSR2: 0
 }
 

@rorth rorth added this to the LLVM 19.X Release milestone Jul 29, 2024
@rorth rorth merged commit 7cecbdf into llvm:main Jul 30, 2024
9 checks passed
@rorth
Copy link
Collaborator Author

rorth commented Jul 30, 2024

/cherry-pick 7cecbdf

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Jul 30, 2024
)

```
  SanitizerCommon-ubsan-sparc-Linux :: Linux/signal_send.cpp
```
currently `FAIL`s on Linux/sparc64 (32 and 64-bit). Instead of the
expected values for `SIGUSR1` (`10`) and `SIGUSR1` (`12`), that target
uses `30` and `31`.

On Linux/x86_64, the signals get their values from
`x86_64-linux-gnu/bits/signum-generic.h`, to be overridden in
`x86_64-linux-gnu/bits/signum.h`. On Linux/sparc64 OTOH, the definitions
are from `sparc64-linux-gnu/bits/signum-arch.h` and remain that way.
There's no `signum.h` at all.

The patch allows for both values.

Tested on `sparc64-unknown-linux-gnu` and `x86_64-pc-linux-gnu`.

(cherry picked from commit 7cecbdf)
@llvmbot
Copy link
Member

llvmbot commented Jul 30, 2024

/pull-request #101141

banach-space pushed a commit to banach-space/llvm-project that referenced this pull request Aug 7, 2024
)

```
  SanitizerCommon-ubsan-sparc-Linux :: Linux/signal_send.cpp
```
currently `FAIL`s on Linux/sparc64 (32 and 64-bit). Instead of the
expected values for `SIGUSR1` (`10`) and `SIGUSR1` (`12`), that target
uses `30` and `31`.

On Linux/x86_64, the signals get their values from
`x86_64-linux-gnu/bits/signum-generic.h`, to be overridden in
`x86_64-linux-gnu/bits/signum.h`. On Linux/sparc64 OTOH, the definitions
are from `sparc64-linux-gnu/bits/signum-arch.h` and remain that way.
There's no `signum.h` at all.

The patch allows for both values.

Tested on `sparc64-unknown-linux-gnu` and `x86_64-pc-linux-gnu`.
tru pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 10, 2024
)

```
  SanitizerCommon-ubsan-sparc-Linux :: Linux/signal_send.cpp
```
currently `FAIL`s on Linux/sparc64 (32 and 64-bit). Instead of the
expected values for `SIGUSR1` (`10`) and `SIGUSR1` (`12`), that target
uses `30` and `31`.

On Linux/x86_64, the signals get their values from
`x86_64-linux-gnu/bits/signum-generic.h`, to be overridden in
`x86_64-linux-gnu/bits/signum.h`. On Linux/sparc64 OTOH, the definitions
are from `sparc64-linux-gnu/bits/signum-arch.h` and remain that way.
There's no `signum.h` at all.

The patch allows for both values.

Tested on `sparc64-unknown-linux-gnu` and `x86_64-pc-linux-gnu`.

(cherry picked from commit 7cecbdf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants