bash complains wait: pid is not a child of this shell

Bug #1590001 reported by Scott Moser
12
This bug affects 2 people
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~16.04.1 , yakkety was 2.0.1-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)
ProcVersionSignature: User Name 4.4.0-23.41-generic 4.4.10
Uname: Linux 4.4.0-23-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.1-0ubuntu4
Architecture: amd64
Date: Tue Jun 7 13:14:52 2016
Ec2AMI: ami-000001a7
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lxd
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
description: updated
Revision history for this message
Scott Moser (smoser) wrote :

I put https://gist.github.com/smoser/68f4f1d379fc55b64d2d2cd33922fe7b 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

Revision history for this message
Stéphane Graber (stgraber) wrote :

So trying to remember from IRC, I think we came to the conclusion that this isn't a LXD bug but most likely some weird bash bug that's weirdly enough, much easier to hit in a container.

Do you want this re-assigned to the bash package instead or just closed entirely?

Changed in lxd (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.