dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: DASH shell mailing list <dash@vger.kernel.org>
Subject: dash somehow falsely waits
Date: Sun, 20 Dec 2020 02:43:00 +0100	[thread overview]
Message-ID: <20201220014300.8lXtI%steffen@sdaoden.eu> (raw)


There is another issue with at least dash (the others not yet
tested).  I cloned the git repo and it is still present at

With the original test script of what is in "Re: dash,
busybox sh 1.32.0, FreeBSD 12.2 sh: spring TTOU but should not
i think" the sleeper will randomly wake too early for whatever
reason.  The sleeper is:

  trap 'i=1' USR1 # "reaper (actually a notify timer only) is up"
      sleeper= int=0 hot=0
      trap '' EXIT HUP QUIT CHLD
      trap 'exit 0' INT
      trap '
         int=1 hot=1
         [ -n "${sleeper}" ] && kill -TERM ${sleeper} >/dev/null 2>&1
      ' USR1
      trap '
         int=1 hot=0
         [ -n "${sleeper}" ] && kill -TERM ${sleeper} >/dev/null 2>&1
      ' USR2
      trap '
         [ -n "${sleeper}" ] && kill -TERM ${sleeper} >/dev/null 2>&1
         echo "Stopping job reaper"
         exit 0
      ' TERM

      # traps are setup, notify parent that we are up and running
      kill -USR1 ${parent} >/dev/null 2>&1

      while :; do
         /bin/sleep ${JOBWAIT} &
         wait ${sleeper}

This wait does not seem to work as it should.
I can run this test on OpenBSD (sh,ksh), NetBSD (sh,ksh), Solaris
(xpg4/sh) and on Linux with bash and i think also mksh and it just
works.  With dash i get things as below.

         [ "${int}${hot}" = 01 ] && kill -USR1 ${parent} >/dev/null 2>&1
   ) </dev/null & #>/dev/null 2>&1 &

So with date before+after and a shrunken set of tests look like

  Sun Dec 20 02:36:27 CET 2020
  make[1]: Entering directory '/tmp/.nail/y'
  make[1]: warning: -j4 forced in makefile: resetting jobserver mode.
  Mode: --check, binary: ./s-nail
  Trying to detect UTF-8 locale via /tmp/.nail/y/./s-nail
  Using Unicode locale en_US.utf8
  Job number derived from MAKEFLAGS: 4
  Will do up to 4 tests in parallel, with a 20 second timeout
  Starting job reaper (timeout of 20 seconds)
  .. waiting for job reaper to come up
  ... [1=environ] [2=loptlocenv] [3=macro_param_shift] [4=csop] .. waiting
  1:ok 2:ok 3:ok 4:ok 5:ok
  !! Timeout: reaped job 1 [environ]

  !! Timeout: reaped job 2 [loptlocenv]
     [Debug/Devel: nullified errors]
     reproducible_build: shift: cannot shift 2 of 1 parameters
     reproducible_build: shift: cannot shift 2 of 1 parameters
  ... [1=eval] [2=X_Y_opt_input_go_stack] [3=X_errexit] [4=Y_errexit] .. waiting
  1:ok 2:ok 3:ok 4:ok 5:ok 6:ok 7:ok 8:ok 9:ok 10:ok cmdline:ok 11:ok
  1:ok 2:ok 3:ok 4:ok 5:ok 6:ok 7:ok 8:ok 9:ok 10:ok 11:ok 12:ok 13:ok 14:ok
  1:ok 2:ok 3:ok 4:ok 5:ok 6:ok
  ... [1=S_freeze] [2=f_batch_order] .. waiting
  1:ok 2:ok 3:ok 4:ok 5:ok 6:ok 7:ok
  1:ok 2:ok
  Stopping job reaper
  44 tests: 44 ok, 2 failure(s).  0 test(s) skipped
  make[1]: Leaving directory '/tmp/.nail/y'
  Sun Dec 20 02:36:29 CET 2020

Total run time 2 seconds, the sleep was 20 seconds, it should
never have been woken up.  With bash and mksh it just works.

|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

             reply	other threads:[~2020-12-20  1:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20  1:43 Steffen Nurpmeso [this message]
2020-12-21 19:36 ` dash somehow falsely waits Steffen Nurpmeso
2020-12-21 19:58   ` Steffen Nurpmeso
2021-01-06  4:47 ` Herbert Xu
2021-01-06 20:44   ` Steffen Nurpmeso
2021-01-07  2:50     ` Herbert Xu
2021-01-07 19:00       ` Steffen Nurpmeso
2021-01-07 21:07         ` Herbert Xu
2021-01-07 21:48           ` Steffen Nurpmeso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201220014300.8lXtI%steffen@sdaoden.eu \
    --to=steffen@sdaoden.eu \
    --cc=dash@vger.kernel.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).