[Toybox] tests.sh unkillable?

Rob Landley rob at landley.net
Wed Mar 11 20:32:32 PDT 2020


I did "make tests" without VERBOSE=fail and didn't want to worry about missing
something so I hit CTRL-C to restart it (somewhere in the endless chmod tests)
and... it refused to die? I did a dozen ctrl-C and they were showing up on the
console but instead I had one CPU pegged, and top blamed tests.sh for having
turned into a CPU-eating loop, which I killed from the command line...

And now I can't get it to do it AGAIN. (This is host bash, not my shell yet!)

In tests.sh there's:

  trap 'kill $(jobs -p) 2>/dev/null; exit 1' INT

But I don't see how that's supposed to hang? Even if the kill fails, it should
continue to exit?

Anybody else spotting how this could have happened?

Rob

P.S. The jobs -p is cleaning up child processes, and this is one of the things
that needs to be fixed so tests can be children rather than sourced. A child of
a child doesn't show up in jobs -p, so things like the pkill/renice tests' "yes
&" only get killed if the test is sourced. I should really use containers here,
but my todo list runneth over served by limited hobby time, as always...



More information about the Toybox mailing list