Repository navigation
Runtime hangs after cycling instances with qemu-cc #910
Description
Description of problem
When using QEMU >= v2.9, I see cc-runtime hang when trying to start a container. This is usually observed when launching and exiting a couple of containers in a row. Observed with both qemu-cc, a local build of v2.9 and a local build of v2.10
On a clean/freshly booted system, I see it fail after 6th time running sudo docker run alpine sh
At the point of the hang, cc-runtime is executing, as well as the resulting QEMU instance. Relevant logs from journal included below. Looks like it is hanging when runtime is handling hotplug/QMP.
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info arguments="\"start 1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971\"" commit=a33e6bf56f7bfbb0497c08f4fd2f70dc06c9f816 name=cc-runtime source=runtime version=3.0.12
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"QMP\": {\"version\": {\"qemu\": {\"micro\": 0, \"minor\": 9, \"major\": 2}, \"package\": \"\"}, \"capabilities\": []}}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="QMP details" qmp-capabilities= qmp-major-version=2 qmp-micro-version=0 qmp-minor-version=9 source=virtcontainers subsystem=qemu
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"execute\":\"qmp_capabilities\"}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"return\": {}}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="VM started" pod-id=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971 source=virtcontainers subsystem=pod
Jan 09 11:50:38 eernstworkstation cc-proxy[5528]: time="2018-01-09T11:50:38.661342209-08:00" level=info msg="client connected" client=3 name=cc-proxy pid=5528 source=proxy
Jan 09 11:50:38 eernstworkstation cc-proxy[5528]: time="2018-01-09T11:50:38.661548505-08:00" level=info msg="AttachVM(containerId=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971)" client=3 name=cc-proxy pid=5528 source=proxy
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="Virtual endpoint unmarshalled [{{2aad7e72-782b-46d5-bf25-e0ee3fb9403d br0 {eth0 02:00:ca:fe:00:00 [172.17.0.2/16 eth0]} {tap0 02:42:ac:11:00:02 []} 1 [0xc42000e218 0xc42000e220 0xc42000e228 0xc42000e230 0xc42000e238 0xc42000e240 0xc42000e248 0xc42000e250] [0xc42000e258 0xc42000e260 0xc42000e268 0xc42000e270 0xc42000e278 0xc42000e280 0xc42000e288 0xc42000e290]} {{{15 1500 0 eth0 02:42:ac:11:00:02 up|broadcast|multicast 69699 16 0 <nil> 0xc4200ae540 0 <nil> ether <nil> up 0 0 0} veth} [172.17.0.2/16 eth0] [{Ifindex: 15 Dst: <nil> Src: <nil> Gw: 172.17.0.1 Flags: [] Table: 254} {Ifindex: 15 Dst: 172.17.0.0/16 Src: 172.17.0.2 Gw: <nil> Flags: [] Table: 254}] {[] [] []}} false virtual}]" source=virtcontainers
Jan 09 11:50:38 eernstworkstation cc-proxy[5528]: time="2018-01-09T11:50:38.664202493-08:00" level=info msg="hyper(cmd=\\\"startpod\\\", data=\\\"{\\\\\\\"hostname\\\\\\\":\\\\\\\"1d472f141546\\\\\\\",\\\\\\\"interfaces\\\\\\\":[{\\\\\\\"newDeviceName\\\\\\\":\\\\\\\"eth0\\\\\\\",\\\\\\\"ipAddresses\\\\\\\":[{\\\\\\\"ipAddress\\\\\\\":\\\\\\\"172.17.0.2\\\\\\\",\\\\\\\"netMask\\\\\\\":\\\\\\\"16\\\\\\\"}],\\\\\\\"mtu\\\\\\\":1500,\\\\\\\"macAddr\\\\\\\":\\\\\\\"02:42:ac:11:00:02\\\\\\\"}],\\\\\\\"routes\\\\\\\":[{\\\\\\\"dest\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"gateway\\\\\\\":\\\\\\\"172.17.0.1\\\\\\\",\\\\\\\"device\\\\\\\":\\\\\\\"eth0\\\\\\\"},{\\\\\\\"dest\\\\\\\":\\\\\\\"172.17.0.0/16\\\\\\\",\\\\\\\"device\\\\\\\":\\\\\\\"eth0\\\\\\\"}],\\\\\\\"shareDir\\\\\\\":\\\\\\\"hyperShared\\\\\\\"}\\\")" client=3 name=cc-proxy pid=5528 source=proxy
Jan 09 11:50:38 eernstworkstation cc-proxy[5528]: time="2018-01-09T11:50:38.66742216-08:00" level=info msg="client connected" client=4 name=cc-proxy pid=5528 source=proxy
Jan 09 11:50:38 eernstworkstation cc-proxy[5528]: time="2018-01-09T11:50:38.667536239-08:00" level=info msg="AttachVM(containerId=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971)" client=4 name=cc-proxy pid=5528 source=proxy
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="device details" container-id=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971 device-major=253 device-minor=1 mount-point=/var/lib/docker/devicemapper/mnt/15149df06562532596a3a43d2b48027b666f84d16d9ca4fa0ca145ffa73cba88 pod-id=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971 source=virtcontainers subsystem=container
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="Block device detected" container-id=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971 device-path="/dev/mapper/docker-8:1-18612488-15149df06562532596a3a43d2b48027b666f84d16d9ca4fa0ca145ffa73cba88" fs-type=xfs pod-id=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971 source=virtcontainers subsystem=container
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"QMP\": {\"version\": {\"qemu\": {\"micro\": 0, \"minor\": 9, \"major\": 2}, \"package\": \"\"}, \"capabilities\": []}}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"execute\":\"qmp_capabilities\"}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"return\": {}}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"arguments\":{\"driver\":\"raw\",\"file\":{\"driver\":\"file\",\"filename\":\"/dev/mapper/docker-8:1-18612488-15149df06562532596a3a43d2b48027b666f84d16d9ca4fa0ca145ffa73cba88\"},\"node-name\":\"drive-1d472f141546f6b034fd0dddc\"},\"execute\":\"blockdev-add\"}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"return\": {}}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"arguments\":{\"addr\":\"0x1\",\"bus\":\"pci-bridge-0\",\"drive\":\"drive-1d472f141546f6b034fd0dddc\",\"driver\":\"virtio-blk-pci\",\"id\":\"virtio-drive-1d472f141546f6b034fd0dddc\"},\"execute\":\"device_add\"}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-runtime[5536]: time="2018-01-09T11:50:38-08:00" level=info msg="{\"return\": {}}" source=virtcontainers subsystem=qmp
Jan 09 11:50:38 eernstworkstation cc-proxy[5528]: time="2018-01-09T11:50:38.686221641-08:00" level=info msg="hyper(cmd=\\\"newcontainer\\\", data=\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971\\\\\\\",\\\\\\\"rootfs\\\\\\\":\\\\\\\"rootfs\\\\\\\",\\\\\\\"fstype\\\\\\\":\\\\\\\"xfs\\\\\\\",\\\\\\\"image\\\\\\\":\\\\\\\"vda\\\\\\\",\\\\\\\"fsmap\\\\\\\":[{\\\\\\\"source\\\\\\\":\\\\\\\"1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971-28cd48f9f2cf199a-resolv.conf\\\\\\\",\\\\\\\"path\\\\\\\":\\\\\\\"/etc/resolv.conf\\\\\\\",\\\\\\\"readOnly\\\\\\\":false,\\\\\\\"dockerVolume\\\\\\\":false,\\\\\\\"absolutePath\\\\\\\":false},{\\\\\\\"source\\\\\\\":\\\\\\\"1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971-19bf32dfaed7f8e8-hostname\\\\\\\",\\\\\\\"path\\\\\\\":\\\\\\\"/etc/hostname\\\\\\\",\\\\\\\"readOnly\\\\\\\":false,\\\\\\\"dockerVolume\\\\\\\":false,\\\\\\\"absolutePath\\\\\\\":false},{\\\\\\\"source\\\\\\\":\\\\\\\"1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971-1e48e5a47a27a786-hosts\\\\\\\",\\\\\\\"path\\\\\\\":\\\\\\\"/etc/hosts\\\\\\\",\\\\\\\"readOnly\\\\\\\":false,\\\\\\\"dockerVolume\\\\\\\":false,\\\\\\\"absolutePath\\\\\\\":false}],\\\\\\\"process\\\\\\\":{\\\\\\\"user\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"group\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"additionalGroups\\\\\\\":[\\\\\\\"0\\\\\\\",\\\\\\\"1\\\\\\\",\\\\\\\"2\\\\\\\",\\\\\\\"3\\\\\\\",\\\\\\\"4\\\\\\\",\\\\\\\"6\\\\\\\",\\\\\\\"10\\\\\\\",\\\\\\\"11\\\\\\\",\\\\\\\"20\\\\\\\",\\\\\\\"26\\\\\\\",\\\\\\\"27\\\\\\\"],\\\\\\\"terminal\\\\\\\":false,\\\\\\\"args\\\\\\\":[\\\\\\\"sh\\\\\\\"],\\\\\\\"envs\\\\\\\":[{\\\\\\\"env\\\\\\\":\\\\\\\"PATH\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\\\\\\\"},{\\\\\\\"env\\\\\\\":\\\\\\\"HOSTNAME\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"1d472f141546\\\\\\\"}],\\\\\\\"workdir\\\\\\\":\\\\\\\"/\\\\\\\",\\\\\\\"noNewPrivileges\\\\\\\":false},\\\\\\\"restartPolicy\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"initialize\\\\\\\":false,\\\\\\\"systemMountsInfo\\\\\\\":{\\\\\\\"bindMountDev\\\\\\\":false,\\\\\\\"devShmSize\\\\\\\":0}}\\\")" client=4 name=cc-proxy pid=5528 source=proxy
Jan 09 11:50:38 eernstworkstation cc-proxy[5528]: time="2018-01-09T11:50:38.6869108-08:00" level=info msg="waiting for shim to register itself with token byASJnNaM4SjSubrc2cBbiLzZAfQ_KIfw90z6RfenTA= (timeout 30s)" name=cc-proxy pid=5528 section=io source=proxy vm=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971
Jan 09 11:52:23 eernstworkstation cc-proxy[5528]: time="2018-01-09T11:52:23.966084445-08:00" level=debug msg="[ 105.652643] systemd-journald[154]: Sent WATCHDOG=1 notification." name=cc-proxy pid=5528 source=qemu vm=1d472f141546f6b034fd0dddc126104d1a495144f7dc4cc4a4d37e9df82a5971
cc-env details;
./cc-runtime cc-env
[Meta]
Version = "1.0.6"
[Runtime]
Debug = false
[Runtime.Version]
Semver = "3.0.12"
Commit = "a33e6bf56f7bfbb0497c08f4fd2f70dc06c9f816"
OCI = "1.0.1"
[Runtime.Config]
Path = "/etc/clear-containers/configuration.toml"
[Hypervisor]
MachineType = "pc"
Version = "QEMU emulator version 2.9.0\nCopyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers"
Path = "/usr/bin/qemu-cc-system-x86_64"
Debug = false
[Image]
Path = "/usr/share/clear-containers/clear-19790-containers.img"
[Kernel]
Path = "/usr/share/clear-containers/vmlinuz-4.9.60-82.container"
Parameters = ""
[Proxy]
Type = "ccProxy"
Version = "Version: 3.0.12-bb85f104f886239198ece88552eb604c05e2c6dd"
Path = "/usr/libexec/clear-containers/cc-proxy"
Debug = true
[Shim]
Type = "ccShim"
Version = "shim version: 3.0.12 (commit: d01f9a71056fc005a98fbaeba733c7b3b07874f6)"
Path = "/usr/libexec/clear-containers/cc-shim"
Debug = true
[Agent]
Type = "hyperstart"
Version = "<>"
[Host]
Kernel = "4.8.0-36-generic"
CCCapable = true
[Host.Distro]
Name = "Ubuntu"
Version = "16.04"
[Host.CPU]
Vendor = "GenuineIntel"
Model = "Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz"
Activity
egernst commentedon Jan 9, 2018
@devimc @amshinde @sboeuf @sameo @mcastelino
jodh-intel commentedon Jan 10, 2018
Hi @egernst - could you run the command requested (
cc-collect-data.sh) and just paste the output as a comment as that would show us more details, like you full config ;)A few questions:
busyboximage?/proc/$cc_runtime_pid/stack//proc/$cc_runtime_pid/fd/?egernst commentedon Jan 10, 2018
I did hand-build it for 2.9 and 2.10, as well as use qemu-cc from our packages. Same behavior with each of these three. Will work through rest of your queries in a bit.
jodh-intel commentedon Jan 10, 2018
Could you also check on the state of the qemu process too (
straceand/or those/proc/bits above)?jodh-intel commentedon Jan 10, 2018
Also, can you enable debug for maximum firehosage [*]?
[*] - warning! Potential new word detected! ;)
egernst commentedon Jan 10, 2018
strace output for cc-runtime:
/proc/22971# strace -fp 22971
strace: Process 22971 attached with 5 threads
[pid 22972] restart_syscall(<... resuming interrupted futex ...> <unfinished ...>
[pid 22975] epoll_wait(6, <unfinished ...>
[pid 22974] futex(0xc42004cd10, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 22973] futex(0xc42004c910, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 22971] futex(0x10dc110, FUTEX_WAIT, 0, NULL
<unfinished ...>
[pid 22972] <... restart_syscall resumed> ) = -1 ETIMEDOUT (Connection timed out)
[pid 22972] select(0, NULL, NULL, NULL, {0, 20}) = 0 (Timeout)
[pid 22972] futex(0x10db958, FUTEX_WAIT, 0, {60, 0}) = -1 ETIMEDOUT (Connection timed out)
[pid 22972] select(0, NULL, NULL, NULL, {0, 20}) = 0 (Timeout)
[pid 22972] futex(0x10db958, FUTEX_WAIT, 0, {60, 0}) = -1 ETIMEDOUT (Connection timed out)
[pid 22972] select(0, NULL, NULL, NULL, {0, 20}) = 0 (Timeout)
[pid 22972] futex(0x10db958, FUTEX_WAIT, 0, {60, 0}
egernst commentedon Jan 10, 2018
cc-runtime's stack at time of failure:
/proc/22971# cat stack
[] futex_wait_queue_me+0xc4/0x120
[] futex_wait+0x116/0x280
[] do_futex+0x214/0x540
[] SyS_futex+0x81/0x180
[] entry_SYSCALL_64_fastpath+0x1e/0xa8
[] 0xffffffffffffffff
egernst commentedon Jan 10, 2018
Yes, same error is observed on different workloads. Checked with busy box.
egernst commentedon Jan 10, 2018
/proc/22971# ls -al fd/
total 0
dr-x------ 2 root root 0 Jan 10 09:19 .
dr-xr-xr-x 9 root root 0 Jan 10 09:16 ..
lr-x------ 1 root root 64 Jan 10 09:20 0 -> /dev/null
l-wx------ 1 root root 64 Jan 10 09:20 1 -> pipe:[1597394]
lrwx------ 1 root root 64 Jan 10 09:20 12 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Jan 10 09:20 13 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Jan 10 09:20 14 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Jan 10 09:20 15 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Jan 10 09:20 16 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Jan 10 09:20 17 -> anon_inode:[eventfd]
l-wx------ 1 root root 64 Jan 10 09:20 2 -> pipe:[1597394]
lrwx------ 1 root root 64 Jan 10 09:20 3 -> socket:[45577]
l-wx------ 1 root root 64 Jan 10 09:20 4 -> /dev/null
lrwx------ 1 root root 64 Jan 10 09:20 5 -> socket:[1119945]
lrwx------ 1 root root 64 Jan 10 09:20 6 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Jan 10 09:20 7 -> /run/virtcontainers/pods/8835d65dafbd37f29040133af92a2c056ff7429e42f884f9f06677041619e71e/lock
lrwx------ 1 root root 64 Jan 10 09:20 8 -> socket:[1609842]
lrwx------ 1 root root 64 Jan 10 09:20 9 -> socket:[1611834]
egernst commentedon Jan 10, 2018
QEMU FD seems sane/stable. Here's the stack:
/proc/22920# cat stack
[] poll_schedule_timeout+0x44/0x70
[] do_sys_poll+0x4cb/0x590
[] SyS_ppoll+0x17d/0x1b0
[] entry_SYSCALL_64_fastpath+0x1e/0xa8
[] 0xffffffffffffffff
grahamwhaley commentedon Jan 10, 2018
looking at those fd's, my gut tells me maybe this is a 'pod lock' issue like we had last time - where one container will hold a lock open (for whatever reason), and then all the others get stuck behind it as they try to gain the lock to do a (reverse?) pod<->container lookup.
The trick then is to figure out why one has the lock held (last time it was a race...)
If we need, I can try and dig up the Issue where we diagnosed the lock issue last time at least.
/cc @sboeuf for his memory on this.
egernst commentedon Jan 10, 2018
Last login: Tue Jan 9 10:07:55 on ttys001
eernst-mac02:~ eernst$ defaults write com.apple.dock autohide-delay -int 0;
eernst-mac02:~ eernst$ defaults write com.apple.dock autohide-time-modifier -float 1.0;
eernst-mac02:~ eernst$ killall Dock
eernst-mac02:~ eernst$
eernst-mac02:~ eernst$
eernst-mac02:~ eernst$
eernst-mac02:~ eernst$ Dock
-bash: Dock: command not found
eernst-mac02:~ eernst$ ssh eernstworkstation.jf.intel.com
eernst@eernstworkstation.jf.intel.com's password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.8.0-36-generic x86_64)
96 packages can be updated.
30 updates are security updates.
Last login: Tue Jan 9 14:30:06 2018 from 10.24.8.81
eernst@eernstworkstation:
$ tmux attach$ tmux[detached (from session 0)]
eernst@eernstworkstation:
[detached (from session 1)]
eernst@eernstworkstation:~$ tmux attach -t 0
Meta details
Running
cc-collect-data.shversion3.0.10 (commit 3d402d1)at2018-01-10.09:39:46.588538942.Runtime is
/usr/bin/cc-runtime.cc-envOutput of "
/usr/bin/cc-runtime cc-env":Runtime config files
Runtime default config files
Runtime config file contents
Output of "
cat "/etc/clear-containers/configuration.toml"":Output of "
cat "/usr/share/defaults/clear-containers/configuration.toml"":Logfiles
Runtime logs
Recent runtime problems found in system journal:
Proxy logs
No recent proxy problems found in system journal.
Shim logs
Recent shim problems found in system journal:
Container manager details
Have
dockerDocker
Output of "
docker info":Have
kubectlKubernetes
Output of "
kubectl config view":Packages
Have
dpkgOutput of "
dpkg -l|egrep "(cc-proxy|cc-runtime|cc-shim|clear-containers-image|linux-container|qemu-lite|qemu-system-x86|cc-oci-runtime)"":Have
rpmOutput of "
rpm -qa|egrep "(cc-proxy|cc-runtime|cc-shim|clear-containers-image|linux-container|qemu-lite|qemu-system-x86|cc-oci-runtime)"":jodh-intel commentedon Jan 10, 2018
Yes, good call @grahamwhaley!
@egernst - one other thing - can you get a
psof what is running whendocker(?) hangs.egernst commentedon Jan 10, 2018
@jodh-intel 👍
UID PID PPID C STIME TTY TIME CMD
root 2977 1 0 Jan09 ? 00:02:20 /usr/bin/dockerd -D --add-runtime cc-runtime=/usr/bin/cc-runtime --add-runtime mine=/home/eernst/go/src/github.com/clearcontainers/runtime/cc-runtime --default-runtime=runc
root 3187 2977 0 Jan09 ? 00:01:20 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc --debug
root 24337 5913 0 09:46 pts/11 00:00:00 sudo docker run --runtime=mine busybox sh
root 24338 24337 0 09:46 pts/11 00:00:00 docker run --runtime=mine busybox sh
root 24403 2 0 09:46 ? 00:00:00 [kdmflush]
root 24410 2 0 09:46 ? 00:00:00 [bioset]
root 24413 2 0 09:46 ? 00:00:00 [xfs-buf/dm-1]
root 24414 2 0 09:46 ? 00:00:00 [xfs-data/dm-1]
root 24415 2 0 09:46 ? 00:00:00 [xfs-conv/dm-1]
root 24416 2 0 09:46 ? 00:00:00 [xfs-cil/dm-1]
root 24417 2 0 09:46 ? 00:00:00 [xfs-reclaim/dm-]
root 24418 2 0 09:46 ? 00:00:00 [xfs-log/dm-1]
root 24419 2 0 09:46 ? 00:00:00 [xfs-eofblocks/d]
root 24420 2 0 09:46 ? 00:00:00 [xfsaild/dm-1]
root 24450 3187 0 09:46 ? 00:00:00 docker-containerd-shim 859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f /var/run/docker/libcontainerd/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f /home/eernst/go/src/github.com/clearcontainers/runtime/cc-runtime
root 24497 24450 8 09:46 ? 00:00:04 /usr/bin/qemu-cc-system-x86_64 -name pod-859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f -uuid a85ea297-2f2d-43a9-97e5-f36c9cc24c8a -machine pc,accel=kvm,kernel_irqchip,nvdimm -cpu host -qmp unix:/run/virtcontainers/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f/a85ea297-2f2d-43a,server,nowait -qmp unix:/run/virtcontainers/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f/a85ea297-2f2d-43a,server,nowait -m 2048M,slots=2,maxmem=97635M -device virtio-serial-pci,id=serial0 -device virtconsole,chardev=charconsole0,id=console0 -chardev socket,id=charconsole0,path=/run/virtcontainers/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f/console.sock,server,nowait -device nvdimm,id=nv0,memdev=mem0 -object memory-backend-file,id=mem0,mem-path=/usr/share/clear-containers/clear-19790-containers.img,size=235929600 -device pci-bridge,bus=pci.0,id=pci-bridge-0,chassis_nr=1,shpc=on -device virtserialport,chardev=charch0,id=channel0,name=sh.hyper.channel.0 -chardev socket,id=charch0,path=/run/virtcontainers/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f/hyper.sock,server,nowait -device virtserialport,chardev=charch1,id=channel1,name=sh.hyper.channel.1 -chardev socket,id=charch1,path=/run/virtcontainers/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f/tty.sock,server,nowait -device virtio-9p-pci,fsdev=extra-9p-hyperShared,mount_tag=hyperShared -fsdev local,id=extra-9p-hyperShared,path=/run/hyper/shared/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f,security_model=none -netdev tap,id=network-0,vhost=on,vhostfds=3:4:5:6:7:8:9:10,fds=11:12:13:14:15:16:17:18 -device driver=virtio-net-pci,netdev=network-0,mac=02:42:ac:11:00:02,mq=on,vectors=18 -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -vga none -no-user-config -nodefaults -nographic -daemonize -kernel /usr/share/clear-containers/vmlinuz-4.9.60-82.container -append root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 initcall_debug iommu=off cryptomgr.notests net.ifnames=0 pci=lastbus=0 debug systemd.show_status=true systemd.log_level=debug init=/usr/lib/systemd/systemd systemd.unit=clear-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket ip=::::::859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f::off:: -smp 32,cores=32,threads=1,sockets=1
root 24499 2 0 09:46 ? 00:00:00 [vhost-24497]
root 24500 2 0 09:46 ? 00:00:00 [vhost-24497]
root 24501 2 0 09:46 ? 00:00:00 [vhost-24497]
root 24502 2 0 09:46 ? 00:00:00 [vhost-24497]
root 24503 2 0 09:46 ? 00:00:00 [vhost-24497]
root 24504 2 0 09:46 ? 00:00:00 [vhost-24497]
root 24505 2 0 09:46 ? 00:00:00 [vhost-24497]
root 24506 2 0 09:46 ? 00:00:00 [vhost-24497]
root 24539 2 0 09:46 ? 00:00:00 [kvm-pit/24497]
root 24540 24450 0 09:46 ? 00:00:00 /usr/libexec/clear-containers/cc-proxy -uri unix:///run/virtcontainers/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f/proxy.sock -log debug
root 24545 24450 0 09:46 ? 00:00:00 /usr/libexec/clear-containers/cc-shim -c 859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f -t cEKcTOMZfCMRkenhaSOwWapca2aHGhwXbRhcRbjui60= -u unix:///run/virtcontainers/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f/proxy.sock -d
root 24546 24545 0 09:46 ? 00:00:00 /usr/libexec/clear-containers/cc-shim -c 859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f -t cEKcTOMZfCMRkenhaSOwWapca2aHGhwXbRhcRbjui60= -u unix:///run/virtcontainers/pods/859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f/proxy.sock -d
root 24547 3187 0 09:46 ? 00:00:00 /home/eernst/go/src/github.com/clearcontainers/runtime/cc-runtime start 859c68a3d767f2296b9c8b4e8fea8699a15d1518ad17432ddcc7fdcf1996155f
eernst 24567 5896 0 09:46 pts/10 00:00:00 ps -aef
~
jodh-intel commentedon Jan 11, 2018
That tells us it's blocked calling
vc.StartContainer()fwics, but it's unclear whereabouts in that function it's blocking. Could you add somevirtlog.Info("...")debug calls to./vendor/github.com/containers/virtcontainers/api.goin the runtime, rebuild and install it and re-run to see what that gives?18 remaining items
sboeuf commentedon Feb 22, 2018
@rarindam Thanks for tracking this internally. Is that possible to get access to this issue ?
egernst commentedon Feb 22, 2018
@rarindam -- 1 and 3, yes. For 2: it is actually the rootfs for a container which is mounted using virtio-blk (passed in via QMP).
sboeuf commentedon Mar 6, 2018
Hi @rarindam, just a reminder you never gave me access to the internal JIRA on this issue so that I can follow the progress ;)
stefanha commentedon Mar 9, 2018
@egernst Please check the kernel stack trace of the thread stuck in mount(2):
# cat /proc/$AGENT_PID/stackwhere $AGENT_PID is the thread in question.
egernst commentedon Mar 9, 2018
@stefanha
root@clrcont / # ps -ae | grep agent
153 ? 00:00:00 cc-agent
root@clrcont / # cat /proc/153/stack
[] futex_wait_queue_me+0xba/0x110
[] futex_wait+0xe6/0x220
[] do_futex+0x109/0x4d0
[] SyS_futex+0x68/0x140
[] do_syscall_64+0x81/0x340
[] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[] 0xffffffffffffffff
stefanha commentedon Mar 10, 2018
@egernst That looks like the agent's main thread, not the thread that is stuck in mount(2). Use
ps -eL -o lwp,stat,wchan,argsto list all threads. The status of the thread in mount is probably starts with "S". Its /proc/$PID/stack output should contain SyS_mount.If udevd hasn't timed out yet, it would also be interesting to see where it is stuck. You can use the same approach with /proc/$PID/stack. Systemd udevd forks a worker process to either execute programs or run built-in actions (see https://github.com/systemd/systemd/blob/master/src/udev/udevd.c#L328).
rarindam commentedon Mar 13, 2018
Hi @sboeuf , are you able to access this link?
-link-
You need to have access to this JIRA repo....
sboeuf commentedon Mar 13, 2018
@rarindam I have removed the link since we're not supposed to share internal links on external repos.
Please send me an email with the details including the link and the way to apply to get access to it.
Thanks
rarindam commentedon Mar 15, 2018
I tried to run git bisect inbetween qemu tags 2.7.0 and 2.9.0.
I hit a snag when using 2.8.0 and above versions...it seems there were some changes to QMP, and the command for adding the block dev was failing in these versions...
Continuing to debug the same.
sboeuf commentedon Mar 15, 2018
Thanks for the update @rarindam
amshinde commentedon Mar 15, 2018
@rarindam There was a change introduced in qemu 2.9 for the blockdev-add command. I dont know if you are hitting that :
amshinde commentedon Apr 9, 2018
This issue cannot be reproduced with the current version of cc-runtime(3.23). I am able to reproduce this with an older version - 3.10. With the latest versions, we have introduced some gap between the time the drive is attached and mounted, this is likely the reason why we are not hitting the issue with mount system call not returning. Note the issue still exists in qemu, we are just not seeing in it the latest cc-runtime versions.
rarindam commentedon Apr 10, 2018
@amshinde So this issue wont be seen in earlier versions of qemu, if you introduced the time gap there too?
virtcontainers: Add function supportGuestMemoryHotplug