<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/timeout, branch master</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=master</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2026-03-14T03:37:10Z</updated>
<entry>
<title>timeout: don't exit immediately if the parent is the init process</title>
<updated>2026-03-14T03:37:10Z</updated>
<author>
<name>Collin Funk</name>
<email>collin.funk1@gmail.com</email>
</author>
<published>2026-03-14T03:37:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=e644eea122462aa7fa98cbe9b8f93088074588a0'/>
<id>urn:sha1:e644eea122462aa7fa98cbe9b8f93088074588a0</id>
<content type='text'>
* src/timeout.c (main): Save the process ID before creating a child
process. Check if the result of getppid is different than the saved
process ID instead of checking if it is 1.
* tests/timeout/init-parent.sh: New file.
* tests/local.mk (all_tests): Add the new test.
* NEWS: Mention the bug fix. Also mention that this change allows
'timeout' to work when reparented by a subreaper process instead of
init.
</content>
</entry>
<entry>
<title>tests: fix "Hangup" termination of non-interactive runs</title>
<updated>2026-02-24T19:25:58Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2026-02-24T15:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=8fab3c6d30d812cd681e51221bae27930f62615a'/>
<id>urn:sha1:8fab3c6d30d812cd681e51221bae27930f62615a</id>
<content type='text'>
This avoids the test harness being terminated like:
  make[1]: *** [Makefile:24419: check-recursive] Hangup
  make[3]: *** [Makefile:24668: check-TESTS] Hangup
  make: *** [Makefile:24922: check] Hangup
  make[2]: *** [Makefile:24920: check-am] Hangup
  make[4]: *** [Makefile:24685: tests/misc/usage_vs_refs.log] Error 129
  ...

This happened sometimes when the tests were being run non interactively.
For example when run like:

  setsid make TESTS="tests/timeout/timeout.sh \
   tests/tail/overlay-headers.sh" SUBDIRS=. -j2 check

Note the race window can be made bigger by adding a sleep
after tail is stopped in overlay-headers.sh

The race can trigger the kernel to induce its job control
mechanism to prevent stuck processes.
I.e. where it sends SIGHUP + SIGCONT to a process group
when it determines that group may become orphaned,
and there are stopped processes in that group.

* tests/tail/overlay-headers.sh: Use setsid(1) to keep the stopped
tail process in a separate process group, thus avoiding any kernel
job control protection mechanism.
* tests/timeout/timeout.sh: Use setsid(1) to avoid the kernel
checking the main process group when sleep(1) is reparented.
Fixes https://bugs.gnu.org/80477
</content>
</entry>
<entry>
<title>maint: run 'make update-copyright'</title>
<updated>2026-01-01T18:56:16Z</updated>
<author>
<name>Collin Funk</name>
<email>collin.funk1@gmail.com</email>
</author>
<published>2026-01-01T18:56:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=73d3a49f45770c45808e4fdab35ae4fe248a3cd9'/>
<id>urn:sha1:73d3a49f45770c45808e4fdab35ae4fe248a3cd9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>timeout: print the signal number 0 instead of EXIT</title>
<updated>2025-12-03T03:16:23Z</updated>
<author>
<name>Collin Funk</name>
<email>collin.funk1@gmail.com</email>
</author>
<published>2025-12-03T03:16:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c00a0941881e36a71c999f50a51ac6d36b31558f'/>
<id>urn:sha1:c00a0941881e36a71c999f50a51ac6d36b31558f</id>
<content type='text'>
POSIX.1-2024 added sig2str but leaves the behavior when called with
signal 0 unspecified. FreeBSD 15.0 does not return the signal name EXIT
like Gnulib's version causing a test failure. This fixes that and
changes the behavior to print 0 instead of EXIT, to avoid confusion when
the program does not exit.

* NEWS: Mention the change.
* src/timeout.c (cleanup): Use snprintf instead of sig2str if the signal
is 0.
* tests/timeout/timeout.sh: Updated the expected output.
</content>
</entry>
<entry>
<title>timeout: prioritize "timed out" exit status</title>
<updated>2025-12-02T17:20:19Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-12-02T17:15:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=86061ddbbdb4194362ede72f9900297d8d31d051'/>
<id>urn:sha1:86061ddbbdb4194362ede72f9900297d8d31d051</id>
<content type='text'>
* src/timeout.c (cleanup): Reset the default exit status
to EXIT_TIMEDOUT, if we have in fact received an ALARM.
Otherwise we would exit with status EXIT_CANCELED if
there was an issue writing --verbose output for example.
This also ensures a consistent exit status with ASAN enabled,
as with ASAN stderr is not explicitly closed by gnulib's
close_stdout handler.
</content>
</entry>
<entry>
<title>test: re-enable tests that had a false requirement on coreutils' kill</title>
<updated>2025-11-29T12:17:27Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-11-28T17:39:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=faa566372d54f12bc4d89b367e386fc38bf127cd'/>
<id>urn:sha1:faa566372d54f12bc4d89b367e386fc38bf127cd</id>
<content type='text'>
Recently we've not built our kill command by default,
so reduce test dependence on that.

* tests/sort/sort-compress-proc.sh: `kill -l [exit_status]` is well
supported, and is a POSIX requirement.
* tests/timeout/timeout.sh: There were actually no kill invocations
in this test at all.
</content>
</entry>
<entry>
<title>timeout: ensure we terminate command upon abnormal exit</title>
<updated>2025-11-29T12:17:27Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-11-28T17:34:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=fc5c7b2e47fbe55034f4c8aa2f67caabcc5933dd'/>
<id>urn:sha1:fc5c7b2e47fbe55034f4c8aa2f67caabcc5933dd</id>
<content type='text'>
* src/timeout.c (main): Use PR_SET_PDEATHSIG to ensure the
child is terminated even if the parent terminates abnormally.
* tests/timeout/timeout-group.sh: Add a case to ensure sending
SIGKILL results in the termination of the monitored command.
* NEWS: Mention the improvement.
</content>
</entry>
<entry>
<title>timeout: honor ignored signal dispositions</title>
<updated>2025-11-22T08:49:20Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-11-21T11:43:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=8c24619334114a2524c8f87dd831fa0912560555'/>
<id>urn:sha1:8c24619334114a2524c8f87dd831fa0912560555</id>
<content type='text'>
This behavior was depended on in our trap_sigpipe_or_skip_ helper,
and now that we're handling all terminating signals, we should
consistently honor their ignored signal dispositions.

* NEWS: Mention the change in behavior, especially in regard
to shell background jobs.
* src/timeout.c (sig_needs_handling): A new helper that return TRUE,
for --signal, SIG_ALRM, or non ignored signals.
(cleanup_install): Filter handled signals with the helper.
(block_cleanup_and_chld): Likewise.
* tests/timeout/timeout-group.sh: Adjust to use the now required
`env --default-signal=...` wrapper to reset (auto) ignored signals.
Also change the termination signal from SIGINT to SIGUSR1
to generalize the test signals not specially handled by the shell,
and newly handled by timeout(1).
* tests/timeout/timeout.sh: Add a test case for SIGPIPE
to ensure the ignored signal disposition is honored.
</content>
</entry>
<entry>
<title>timeout: handle all terminating signals</title>
<updated>2025-11-21T12:12:28Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-11-20T16:02:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=d0a51c614def6cf4f39fafe8ca7dcef925c4a503'/>
<id>urn:sha1:d0a51c614def6cf4f39fafe8ca7dcef925c4a503</id>
<content type='text'>
* src/timeout.c (term_sig): A new global list of all signals
whose default disposition is to terminate the process.
(install_cleanup): Iterate over the TERM_SIG list, rather than
installing the handler for a specific subset.
(block_cleanup_and_chld): Likewise.
* tests/timeout/timeout.sh: Add a test case for SIGPIPE.
* NEWS: Mention the bug fix.
</content>
</entry>
<entry>
<title>maint: adjustments to recent timeout change</title>
<updated>2025-04-05T10:37:58Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-04-05T10:27:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=4368d21fbddaf5397087210c49b398414e02c933'/>
<id>urn:sha1:4368d21fbddaf5397087210c49b398414e02c933</id>
<content type='text'>
* .gitignore: Add /lib/fenv.h to ignore list.
* tests/timeout/timeout-parameters.sh: Use a sleep length of 10s
to be consistent with the pattern where we use this larger time
when it does not slow down a test, but also provides protection
against a hung test, and better avoidance of false failures due
to races on very loaded systems.  Also fix the setting of FAIL.
* tests/timeout/timeout-large-parameters.sh: Remove duplicated test.
</content>
</entry>
</feed>
