Moritz Angermann pushed to branch wip/angerman/testsuite-fix-exec_signals at Glasgow Haskell Compiler / GHC
Commits:
57f53914 by Moritz Angermann at 2025-09-08T13:03:39+09:00
testsuite: Fix broken exec_signals_child.c
There is no signal 0. The signal mask is 1-32.
- - - - -
1 changed file:
- testsuite/tests/rts/exec_signals_child.c
Changes:
=====================================
testsuite/tests/rts/exec_signals_child.c
=====================================
@@ -2,8 +2,11 @@
#include
#include
-// Prints the state of the signal handlers to stdout
-int main()
+// Prints the state of the signal handlers to stdout.
+// NOTE: We intentionally start at signal 1 (not 0). Signal number 0 is not a
+// real signal; passing 0 to sigismember/sigaction is undefined behaviour and
+// on Darwin was observed to yield memory corruption / junk bytes in output.
+int main(void)
{
int open = 0, i;
sigset_t blockedsigs;
@@ -11,7 +14,7 @@ int main()
printf("ChildInfo { masked = [");
sigprocmask(SIG_BLOCK, NULL, &blockedsigs);
- for(i = 0; i < NSIG; ++i)
+ for(i = 1; i < NSIG; ++i)
{
int ret = sigismember(&blockedsigs, i);
if(ret >= 0)
@@ -26,7 +29,7 @@ int main()
printf("], handlers = [");
open = 0;
- for(i = 0; i < NSIG; ++i)
+ for(i = 1; i < NSIG; ++i)
{
struct sigaction old;
if(sigaction(i, NULL, &old) >= 0)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57f53914a1011bdeeebb091c5e84d0ff...
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57f53914a1011bdeeebb091c5e84d0ff...
You're receiving this email because of your account on gitlab.haskell.org.