New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 618461 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Email to this user bounced
Closed: Jun 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

[crosperf] RunCommand can't output cros flash usb

Project Member Reported by cburden@google.com, Jun 8 2016

Issue description

I'm trying to flash a ChromeOS image to usb through the command_executer module via RunCommand. However it seems the "cros flash usb://" output hijacks my stdout/terminal causing it to be impossible for users to feasibly provide input.

To reproduce run this python code inside toolchain-utils in your chroot:
  from utils import command_executer

  ce = command_executer.GetCommandExecuter()
  ce.RunCommand('cros flash usb:// ~/trunk/src/build/images/daisy/latest/chromiumos_test_image.bin')

The usb device prompt never shows up and the program appears to hang. If you input 0 then the prompt will show up after the fact.
 
Labels: -Pri-3 Build-Toolchain OS-Chrome Pri-2
This seems to be related to not properly catching & propagating keyboard interrrupts (ctrl-c)
Project Member

Comment 2 by sheriffbot@chromium.org, Jun 9 2016

Labels: Hotlist-Google

Comment 3 by cburden@google.com, Jun 9 2016

There actually appears to be two separate problems here related to RunCommand/cros flash:
1. RunCommand won't output the prompt from cros flash usb://. This is solved by doing the following: "export PYTHONUNBUFFERED=1". Not sure why this is required, it appears that cros flash has a weird buffered outputting mechanism? And this isn't compatible with RunCommand's output polling?

2. If you ctrl-c inside a RunCommand invocation this can leave your terminal unusable. It seems the problem is the child process stays alive even if the program invoking RunCommand dies from a KeyboardInterrupt. I've submitted a patch to add a function that handles this edge case:

https://chrome-internal-review.googlesource.com/#/c/263665/

However, other users will have to opt-in and use this specific function if they want their RunCommand's protected from a stray KeyboardInterrupt/misc. exception.
Cc: shenhan@chromium.org
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 10 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/toolchain-utils/+/a02937d6530b19b5635119a3f40169a604b0ca26

commit a02937d6530b19b5635119a3f40169a604b0ca26
Author: Cassidy Burden <cburden@google.com>
Date: Wed Jun 08 23:34:23 2016

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 13 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/toolchain-utils/+/333fe383dcd0c35981a5473bc913d07b52c310a1

commit 333fe383dcd0c35981a5473bc913d07b52c310a1
Author: Cassidy Burden <cburden@google.com>
Date: Mon Jun 13 17:02:04 2016

Comment 7 by cmt...@chromium.org, Jun 14 2016

Owner: cburden@google.com

Comment 8 by cmt...@chromium.org, Jun 14 2016

Status: Fixed (was: Unconfirmed)
Labels: VerifyIn-53
Labels: VerifyIn-54
Labels: VerifyIn-55

Comment 12 by dchan@google.com, Nov 19 2016

Labels: VerifyIn-56

Comment 13 by dchan@google.com, Jan 21 2017

Labels: VerifyIn-57

Comment 14 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 15 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 16 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61
Status: Verified (was: Fixed)
Closing. Please reopen it if its not fixed. Thanks!

Sign in to add a comment