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

Issue 725320 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

chrome://inspect cannot authorize USB devices

Project Member Reported by reillyg@chromium.org, May 23 2017

Issue description

Chrome Version: 60.0.3100.0
OS: Chrome OS 9554.2.0

What steps will reproduce the problem?
(1) Open chrome://inspect
(2) Connect an Android device with USB debugging enabled
(3) Acknowledge the authorization prompt on the device, checking the "always trust this device" box.

What is the expected result?
Device should be listed in chrome://inspect as online.

What happens instead?
Device remains listed as "pending authorization".

This issue is reproducible on both samus and peach_pit. It is not reproducible on Linux (which shares all the same user space logic).
 
Labels: -Type-Bug Type-Bug-Regression
Confirmed that this broke between M-59 and M-60.
Labels: -Pri-3 M-60 Pri-1
Labels: Needs-Bisect
Owner: eostroukhov@chromium.org
Status: Assigned (was: Available)
Is it possible to get a narrow bisect?
Eugene, could you please take a look?
On the phone, I see an "Allow USB debugging" prompt popping up over and over again. Looking into it.
You will also see numerous log entries in chrome://device-log claiming that it failed to release an interface because the kernel returned an "Invalid argument" error.
It would be great if someone can have a look as it currently prevents me to debug web apps running on Android from my chromebook. Thanks in advance.

I can provide more logs if needed.
Labels: ReleaseBlock-Stable

Comment 8 by gkihumba@google.com, Jul 10 2017

Any updates? M60 goes stable in 3 weeks.
Cc: caseq@chromium.org
@caseq: mind taking a look. I completely missed this one...
reillyg@: I don't think we touched usb-related code between 59 and 60. Any suspects on your side? Or is it plain ChromeOS issue? In case of latter, it needs to go to someone in ChromeOS land for per-revision bisect.
I don't have any suspects. The Linux and Chrome OS code are almost entirely the same and I can't reproduce it on my workstation. I've been meaning to add a bunch of debugging to the ADB code to see if I can pinpoint exactly what failure it is encountering.
I added some logging and determined that transfers to the device are failing with ESHUTDOWN. On my device with an xHCI controller that shouldn't happen unless the controller has hit an error. I'm recompiling the kernel with xHCI debugging to figure out where that is coming from.
Cc: vpalatin@chromium.org
Further investigation indicates that the permission broker, in response to an OpenPath request, is detaching the driver that has claimed the device. The problem is that this "driver" is actually Chrome and so it ends up disconnecting itself every time it attempts to probe the device.

There are a couple things to investigate:

1) Should permission_broker not detach the driver when it is "usbfs" which indicates a user application like Chrome is accessing the device?

2) Why is Chrome attempting to open devices it already has open?
That an external application is detaching Chrome from the device also explains the "Invalid argument" errors from USBDEVFS_RELEASEINTERFACE, as the interface has already been forcibly released.

Adding some logging to android_usb_device.cc I see now that the same device is being opened twice in a row, setting up this situation in which there will always be two competing connections to the device.
Labels: -Needs-Bisect
Owner: reillyg@chromium.org
Status: Started (was: Assigned)
I have a patch to work around this issue: https://chromium-review.googlesource.com/572300
Project Member

Comment 16 by bugdroid1@chromium.org, Jul 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2aeec8604ce03838f45abac42f003f9bbf09c734

commit 2aeec8604ce03838f45abac42f003f9bbf09c734
Author: Reilly Grant <reillyg@chromium.org>
Date: Wed Jul 19 23:52:43 2017

Prevent chrome://inspect from creating duplicate USB connections

Recently chrome://inspect started to open USB devices multiple times
while probing for ADB devices. On Chrome OS this causes a problem
because the permission_broker will disconnect the previous connection in
favor of the new connection. This caused an endless cycle of connection
failures.

This patch maintains a list of the devices that are currently open and
refused to reopen them during probing until the previous connection is
fully closed.

Bug:  725320 
Change-Id: Id9b01d8d14c55ee2576499e2f1c778fea6c7dedc
Reviewed-on: https://chromium-review.googlesource.com/572300
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488049}
[modify] https://crrev.com/2aeec8604ce03838f45abac42f003f9bbf09c734/chrome/browser/devtools/device/usb/android_usb_browsertest.cc
[modify] https://crrev.com/2aeec8604ce03838f45abac42f003f9bbf09c734/chrome/browser/devtools/device/usb/android_usb_device.cc

Will verify in tomorrow's canary build and request merge.
Labels: Merge-Request-60
Verified on Chrome OS canary build 9762.0.0.
Project Member

Comment 19 by sheriffbot@chromium.org, Jul 20 2017

Labels: -Merge-Request-60 Hotlist-Merge-Review Merge-Review-60
This bug requires manual review: We are only 4 days from stable.
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-60 Merge-Approved-60
Project Member

Comment 21 by bugdroid1@chromium.org, Jul 24 2017

Labels: -merge-approved-60 merge-merged-3112
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e3f22953244d7f4301a21d94679c2602e393eb7e

commit e3f22953244d7f4301a21d94679c2602e393eb7e
Author: Reilly Grant <reillyg@chromium.org>
Date: Mon Jul 24 18:26:48 2017

Prevent chrome://inspect from creating duplicate USB connections

Recently chrome://inspect started to open USB devices multiple times
while probing for ADB devices. On Chrome OS this causes a problem
because the permission_broker will disconnect the previous connection in
favor of the new connection. This caused an endless cycle of connection
failures.

This patch maintains a list of the devices that are currently open and
refused to reopen them during probing until the previous connection is
fully closed.

TBR=reillyg@chromium.org

(cherry picked from commit 2aeec8604ce03838f45abac42f003f9bbf09c734)

Bug:  725320 
Change-Id: Id9b01d8d14c55ee2576499e2f1c778fea6c7dedc
Reviewed-on: https://chromium-review.googlesource.com/572300
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#488049}
Reviewed-on: https://chromium-review.googlesource.com/583431
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/branch-heads/3112@{#666}
Cr-Branched-From: b6460e24cf59f429d69de255538d0fc7a425ccf9-refs/heads/master@{#474897}
[modify] https://crrev.com/e3f22953244d7f4301a21d94679c2602e393eb7e/chrome/browser/devtools/device/usb/android_usb_browsertest.cc
[modify] https://crrev.com/e3f22953244d7f4301a21d94679c2602e393eb7e/chrome/browser/devtools/device/usb/android_usb_device.cc

Status: Fixed (was: Started)

Comment 23 by ka...@chromium.org, Jul 27 2017

Labels: platformtest
Status: Verified (was: Fixed)
Verified on build 9592.71.0

Sign in to add a comment