bash complains wait: pid is not a child of this shell
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
inside a container the attached script will often fail, with bash claiming:
wait: pid 13785 is not a child of this shell
I've been able to reproduce this in clean vms (lxd init, then lxc launch) and on my desktop.
xenial host (kernel 4.4.0-22-generic) and xenial container
yakkety host (kernel 4.4.0-23-generic) and xenial container
Containers are created simply with:
lxd launch ubuntu-daily:xenial x1
xenial lxd was 2.0.2-0ubuntu1~
I've not been able to recreate at all outside of a container.
The test case basically does:
# spawn NUM_CHILDREN (default 200) children in backgrounded subprocesses.
# then 'wait' for each of them to return in spawned order and
# check exit code. Exit failure if any 'wait' return non-zero
# when 'pid XXX is not a child of this shell' is printed, 127 is found.
To run it in a loop until it fails:
# run this in a loop until it fails with:
# export NUM_RUNS=200 ; while :; do rm -f out*; /tmp/go.sh || break; done
Note, that increasing NUM_RUNS seems to increase likelyhood of failure.
I'm not sure if this is a bash bug or container bug or kernel bug.
I've filed against lxd, feel free to move it where ever.
ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: lxc2 (not installed)
ProcVersionSign
Uname: Linux 4.4.0-23-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.1-0ubuntu4
Architecture: amd64
Date: Tue Jun 7 13:14:52 2016
Ec2AMI: ami-000001a7
Ec2AMIManifest: FIXME
Ec2Availability
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: lxd
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in lxd (Ubuntu): | |
status: | New → Invalid |
I put https:/ /gist.github. com/smoser/ 68f4f1d379fc55b 64d2d2cd33922fe 7b together.
it incorporates the looping so you can just run:
./bug-1590001 loop
or
./bug-1590001 spawnkids sleep-rand
or
./bug-1590001 spawnkids sleep-short