Linux/preinstalled_signal.cpp FAILs on Linux/sparc64 #109573
Open
Description
With ASan testing enabled on SPARC as per PR #107405, the
AddressSanitizer-sparc-linux-dynamic :: TestCases/Linux/preinstalled_signal.cpp
test FAIL
s on Linux/sparc64. There are several issues here:
- The sparc layout of
struct KernelSigaction
/struct sigaction
differs from other targets:`
@@ -34,6 +34,13 @@ struct KernelSigaction {
#if defined(__mips__)
unsigned long flags;
__sighandler_t handler;
+#elif defined(__sparc__)
+ __sighandler_t handler;
+ __sigset_t mask;
+# if __WORDSIZE == 64
+ int __glibc_reserved0;
+# endif
+ int flags;
#else
__sighandler_t handler;
unsigned long flags;
- When using
syscall(__NR_rt_sigaction)
, thesyscall
returnsEINVAL
. As can be seen in glibcsysdeps/unix/sysv/linux/sparc/sparc{32,64}/libc_sigaction.c
(STUB)
, the sparc version of the syscall takes an additional arg, however the stub functions passed there aren't exported fromlibc
and thus cannot be used outside. - When using
sigaction
instead, several assertions fail. The problem turns out to be that thosesigaction
calls trigger the interceptor, which again changes the order in whichAsanInitInternal
andInit
are called. - The same behaviour can be seen e.g. on Linux/i386 when using
sigaction
instead ofsyscall(__NR_rt_sigaction)
.
It seems the test relies heavily on the (undefined!?) relative execution order of AsanInitInternal
and
Init`, falling apart if that
changes for whatever reason.