New issue
Advanced search Search tips

Issue 882002 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 18
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Vsh can hang and use 100% cpu

Project Member Reported by jkardatzke@chromium.org, Sep 7

Issue description

This has happened occasionally during manual runs of tast-test, and now I have a repro case for it.

If you SSH into the DUT and run this script (replace owner_id):

x=0; while [ 1 ] ; do vsh --vm_name=termina --target_container=penguin --owner_id=533dd0c6a9276e2629fa1eac6a5ccbb8eeb24d59 -- sh -c "echo 'nothing but the web ${x}' > ~/index.html"; echo ${x}; x=`expr ${x} + 1`; done

Then after a little bit it will end up hanging. If you then connect into the terminal you'll see vsh using 100% of the CPU and a defunct sh process.

Occasionally it also spits out this error:

[ERROR:utils.cc(32)] Failed to write message size to socket: Broken pipe
[ERROR:vsh_client.cc(264)] Failed to send tty window resize message

Putting the DUT under load makes this happen faster; it's also more likely to happen if there isn't another active vsh session.
 
Components: OS>Systems>Containers
Labels: -Pri-2 M-71 Pri-1
Status: Started (was: Assigned)
Starting this now. Raising priority since this is causing test failures.
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/4b2c3d1581b4a413b0596134dff2fbba75cf3e99

commit 4b2c3d1581b4a413b0596134dff2fbba75cf3e99
Author: Stephen Barber <smbarber@chromium.org>
Date: Tue Sep 18 21:03:51 2018

vm_tools: vsh: block SIGCHLD before fork

It's possible for SIGCHLD to be delivered before the parent has started
listening for it. So set the signal disposition to be blocked rather than
ignored, so we can get the signal delivered later.

BUG= chromium:882002 
TEST=run vsh commands in a loop; no hang

Change-Id: I45b2810496dfce4353d3806d40a7b49d7c4e5ca1
Reviewed-on: https://chromium-review.googlesource.com/1227380
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>

[modify] https://crrev.com/4b2c3d1581b4a413b0596134dff2fbba75cf3e99/vm_tools/vsh/vsh_forwarder.cc

Status: Fixed (was: Started)

Sign in to add a comment