[Pkg-privacy-maintainers] Bug#920038: Bug#920038: monkeysphere: autopkgtest times out since 2019-01-15

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jan 25 17:47:24 GMT 2019


Control: clone 920038 -2
Control: retitle -2 bash 5.0 "wait" builtin waits on "process substitution" subprocesses
Control: reassign -2 bash
Control: found -1 5.0-1
Control: notfound -1 4.4-5
Control: block 920038 with -2
Control: affects -2 monkeysphere debci autopkgtest

On Thu 2019-01-24 15:57:32 -0500, Daniel Kahn Gillmor wrote:
> Since bash essential, it's not listed as an explicit dependency in
> monkeysphere.  That said, i can easily run this test with bash 5.0-1 on
> my own systems and have no hanging problem.
>
> So i'm mystified by this, and would appreciate any help figuring it out.

After some digging, this appears to be due to a change the bash, noted
in the upstream changelog in the section titled: "changes between this
version, bash-5.0-alpha, and the previous version, bash-4.4-release.":

    yyy. `wait' without arguments attempts to wait for all active process
         substitution processes.

Many thanks to terceiro on on #debci on irc.oftc.net, whose debugging
efforts helped me uncover the root cause here.

The attached reproducer scripts terminate promptly with bash 4.4-5 but
hang forever with bash 5.0-1.  The concern is that a bash script doesn't
know how it was invoked, so any invocation of the "wait" builtin with no
arguments is potentially dangerous under this new mechanism used by bash
5.0.

This causes the monkeysphere debci to hang because (a) the monkeysphere
keytrans test is a bash script which uses the "wait" builtin without
arguments, and (b) autopkgtest itself invokes the monkeysphere keytrans
test as something like:

    tests/keytrans > >(tee -a …/command1-stdout) 2> >(tee -a …/command1-stderr)

So i think this is a regression in bash, which is why i've done the
above bug cloning.  I'm happy to hear arguments for a different
interpretation, or suggestions on what tests/keytrans should do
differently.  I note that "jobs" returns nothing under both bash 4.4-5
and 5.0-1.

i note that i'd expect the process substitution to happen in the parent
of the keytrans bash process, and that the keytrans bash process
shouldn't even know about the process substitution.  It's a little
mysterious to me how it even knows about those processes to wait on
them.  Maybe bash notices that the thing it's going to invoke is a bash
script, so it only fork()s (skipping the exec("tests/keytrans")), and
somehow fails to clean up some table of subprocesses in the meantime?
Sorry i have no clear diagnosis of how this issue should be fixed.

Regards,

        --dkg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wait-hang-behavior.bash
Type: text/x-sh
Size: 608 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-privacy-maintainers/attachments/20190125/e1bf64cf/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wait-hang-behavior-2.bash
Type: text/x-sh
Size: 324 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-privacy-maintainers/attachments/20190125/e1bf64cf/attachment-0001.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-privacy-maintainers/attachments/20190125/e1bf64cf/attachment.sig>


More information about the Pkg-privacy-maintainers mailing list