bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

signal handling on OpenBSD and NetBSD


From: Ralf Wildenhues
Subject: signal handling on OpenBSD and NetBSD
Date: Sun, 11 Jan 2009 13:45:25 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello,

I looked at signal handling on OpenBSD and NetBSD.  AFAIK there were two
known problems on these systems:

1) The parallel tests sometimes stop waiting for input.  This seems to
be happening when 'set +m' is issued; it causes the shells to sometimes
wait for input from /dev/tty which subsequently generates a SIGTTIN,
stopping the whole testsuite.  Problem is, I don't know the exact
circumstances yet when that is happening, and I don't know how to test
for this non-interactively.  I can work around this issue on both
systems with a patch like this:


diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 5f2db79..e321299 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -1226,8 +1226,8 @@ dnl shell to start each parallel task as its own shell 
job, thus as a new
 dnl process group leader.  We then send the signal to all new process groups.
 
 dnl Do we have job control?
-if (set -m && set +m) >/dev/null 2>&1; then
-  at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
+if (set -m) >/dev/null 2>&1; then
+  at_job_control_on='set -m' at_job_control_off=': set +m' at_job_group=-
 else
   at_job_control_on=: at_job_control_off=: at_job_group=
 fi
diff --git a/tests/autotest.at b/tests/autotest.at
index 576eb80..d50b1e0 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -878,7 +878,7 @@ AT_CHECK([$CONFIG_SHELL ./micro-suite -j2foo], [1], [], 
[stderr])
 AT_CHECK([grep 'non-numeric argument' stderr], [], [ignore])
 AT_CHECK([$CONFIG_SHELL ./micro-suite --jobs=foo], [1], [], [stderr])
 AT_CHECK([grep 'non-numeric argument' stderr], [], [ignore])
-AT_CHECK([$CONFIG_SHELL ./micro-suite -j[]AT_PARALLEL_NJOBS], [], [stdout])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -j[]AT_PARALLEL_NJOBS], [], [stdout], 
[ignore])
 # Ensure that all tests run, and lines are not split.
 AT_CHECK([grep -c '^.\{53\}ok' stdout], [], [AT_PARALLEL_NTESTS
 ])


With this applied, the testsuite completes on both systems.  A parallel
testsuite run is still not stoppable with C^Z (non-parallel seems to
work), but it is interruptible with C^C.  Of course, now it generates
additional slightly ugly output:

[...]
|   1: Syntax of the shell scripts                     skipped (tools.at:50)
| ^Ctestsuite: WARNING: caught signal INT, bailing out
| [4] + Done (130)           ( $at_job_control_off ; trap "set +x; set +e^J^
| [3] - Done (130)           ( $at_job_control_off ; trap "set +x; set +e^J^
| [2]   Done (130)           ( $at_job_control_off ; trap "set +x; set +e^J^
| [1]   Done                 ( $at_job_control_off ; trap "set +x; set +e^J^
| *** Error code 130
| 
| Stop in /home/rwild/ac/build/tests (line 556 of Makefile).
| *** Error code 1
[...]

which we already knew, because that was what 'set +m' was all about.

FWIW, redirecting stdin from </dev/null has not helped, AFAICS.


2) Runaway processes.  I'm pretty sure I also saw those happen when
testing on one of these systems earlier on, but don't know a reliable
way to reproduce.  At least with above patch, though, I haven't seen
them.

So the question is now how to go on.  As a lowest common denominator, we
could just not use 'set +m' anywhere, and live with the additional noise
on stderr.  Testing per system/shell used seems awkward and not trivial
from within Autotest.  But at least that should allow 2.64 to be
released.

If someone wants to delve in the shell source code on these systems and
fix them, I'd be delighted.  :-)

Thanks,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]