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

Issue 638298 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

chrome.usb.getDevices reports the same device multiple times

Project Member Reported by juanlang@chromium.org, Aug 16 2016

Issue description

Chrome Version       : 52.0.2743.116

What steps will reproduce the problem?
1. Install an app with USB permissions, and insert a single USB device.
2. chrome.usb.getDevices({productId: x, vendorId: y}, function(x) { console.log(x); });

What is the expected result?
A single USB device is enumerated.

What happens instead of that?
Two devices are enumerated, with distinct IDs.

For example, using my Google-issued Yubico device, when I enumerate:
chrome.usb.getDevices({productId: 529, vendorId: 4176}, function(x) { console.log(x); });

I see the following objects logged:
0: Object
  device: 0
  manufacturerName: Yubico
  productId: 529
  productName: "Yubico WinUSB Gnubby (gnubby1)"
  serialNumber: ""
  vendorId: 4176
  version: 52
1: Object
  device: 1
  (remaining fields identical)

Reilly, mind taking a look?
 
Labels: -OS-Linux OS-Chrome
Labels: Needs-Feedback
I can't reproduce this issue on my Peach Pit. What hardware is this happening on? Can you attach the USB output from chrome://device-log and the output of lsusb from chrome://system?
fwiw, no repro here either, Samus, 52.0.2743.116

Comment 4 by juanlang@google.com, Aug 17 2016

Labels: -Needs-Feedback
Samus 53.0.2785.47 here. Sorry about the misleading version :(

chrome://device-log filtered for USB and HID:

USBUser[17:08:25] USB device added: path=/dev/bus/usb/001/015 vendor=8754 "NMGAAI00010200258400154", product=24577 "NCM-G102", serial="", guid=e7425c93-11d7-461d-a80e-30ba09a859ce
USBUser[17:08:25] USB device removed: path=/dev/bus/usb/001/012 guid=3425b85f-0af1-452b-b1c9-868d4e777e65
USBUser[16:48:38] USB device added: path=/dev/bus/usb/001/014 vendor=4176 "Yubico", product=529 "Yubico WinUSB Gnubby (gnubby1)", serial="", guid=5d97c658-dcf9-4b28-b9b2-d7f2254c65e3
USBUser[16:48:33] USB device removed: path=/dev/bus/usb/001/013 guid=39a3e21d-a6bc-4dbb-a844-be89bcb44a4c
HIDUser[16:48:33] HID device removed: deviceId='/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:1050:0200.0001/hidraw/hidraw0'
HIDUser[16:48:21] HID device added: vendorId=4176, productId=512, name='Yubico Yubico Gnubby (gnubby1)', serial='', deviceId='/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:1050:0200.0001/hidraw/hidraw0'
USBUser[16:48:21] USB device added: path=/dev/bus/usb/001/013 vendor=4176 "Yubico", product=512 "Yubico Gnubby (gnubby1)", serial="", guid=39a3e21d-a6bc-4dbb-a844-be89bcb44a4c
USBEvent[16:48:18] Permission broker failed to open the device: org.freedesktop.DBus.Error.Failed: permission_broker/permission_denied:Permission to open '/dev/bus/usb/001/002' denied
USBUser[16:48:11] USB device removed: path=/dev/bus/usb/001/002 guid=20bdc702-c598-4be8-b852-ec5909e4dfb1
USBUser[16:38:29] USB device added: path=/dev/bus/usb/001/012 vendor=8754 "NMGAAI00010200258400154", product=24577 "NCM-G102", serial="", guid=3425b85f-0af1-452b-b1c9-868d4e777e65
USBUser[16:38:29] USB device removed: path=/dev/bus/usb/001/011 guid=295b4489-1547-4076-a775-98004b220ba0
USBUser[16:37:23] USB device added: path=/dev/bus/usb/001/011 vendor=8754 "NMGAAI00010200258400154", product=24577 "NCM-G102", serial="", guid=295b4489-1547-4076-a775-98004b220ba0
USBUser[16:37:23] USB device removed: path=/dev/bus/usb/001/010 guid=e9437145-846c-4d36-891d-6038e00f0a21
USBUser[11:11:35] USB device added: path=/dev/bus/usb/001/010 vendor=8754 "NMGAAI00010200258400154", product=24577 "NCM-G102", serial="", guid=e9437145-846c-4d36-891d-6038e00f0a21
USBUser[11:11:35] USB device removed: path=/dev/bus/usb/001/009 guid=d300a0f7-8c9f-4081-9fa7-b038fdc80015
USBUser[10:55:00] USB device added: path=/dev/bus/usb/001/009 vendor=8754 "NMGAAI00010200258400154", product=24577 "NCM-G102", serial="", guid=d300a0f7-8c9f-4081-9fa7-b038fdc80015
USBUser[15:52:03] USB device removed: path=/dev/bus/usb/001/007 guid=14074b38-3cf9-4d04-ac39-c5b409dbfdbb
USBUser[15:32:41] USB device added: path=/dev/bus/usb/001/007 vendor=8754 "NMGAAI00010200258400154", product=24577 "NCM-G102", serial="", guid=14074b38-3cf9-4d04-ac39-c5b409dbfdbb
USBUser[15:32:41] USB device removed: path=/dev/bus/usb/001/006 guid=23272ee9-be5f-406a-aa25-a748c84ac538
USBUser[15:02:03] USB device added: path=/dev/bus/usb/001/006 vendor=8754 "NMGAAI00010200258400154", product=24577 "NCM-G102", serial="", guid=23272ee9-be5f-406a-aa25-a748c84ac538
USBUser[15:02:03] USB device removed: path=/dev/bus/usb/001/005 guid=34fea668-1f61-42d9-80a0-9b16225667ee

lsusb:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 8087:07dc Intel Corp. 
Bus 001 Device 015: ID 2232:6001 Silicon Motion 
Bus 001 Device 014: ID 1050:0211 Yubico.com Gnubby
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Ping. Multiple people complaining. Any updates from you?
I just reproduced this on Peach Pit. There are two entries for the device in chrome://device-log from first boot, one of them is removed when the system goes to sleep but the other remains. I'm investigating further. If this is a udev issue I will simply add a workaround to the enumeration code to detect duplicate entries.
Labels: ReleaseBlock-Stable M-53
Status: Started (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Aug 19 2016

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

commit f2c7b56f4a4f2c16b2f7062f60ad3041217e9f20
Author: reillyg <reillyg@chromium.org>
Date: Fri Aug 19 22:52:03 2016

Detect duplicate USB device notifications from udev.

This patch adds a check to detect when udev has sent Chrome multiple
notifications for the same device, ignoring the duplicates, as this
behavior has been observed in the wild.

I also fix DeviceReady() to not send a device added notification if a
device was disconnected while it was being enumerated. The device would
not have been added to the global device list in this case.

BUG= 638298 

Review-Url: https://codereview.chromium.org/2261783002
Cr-Commit-Position: refs/heads/master@{#413273}

[modify] https://crrev.com/f2c7b56f4a4f2c16b2f7062f60ad3041217e9f20/device/usb/usb_service_linux.cc

Labels: Merge-Request-53
Status: Fixed (was: Started)

Comment 10 by dimu@chromium.org, Aug 20 2016

Labels: -Merge-Request-53 Merge-Approved-53 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M53 (branch: 2785)
Project Member

Comment 11 by bugdroid1@chromium.org, Aug 23 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b69683e7f0dc6fcb3d06db36d4ada51fe56c3c18

commit b69683e7f0dc6fcb3d06db36d4ada51fe56c3c18
Author: Reilly Grant <reillyg@chromium.org>
Date: Tue Aug 23 17:29:25 2016

Detect duplicate USB device notifications from udev.

This patch adds a check to detect when udev has sent Chrome multiple
notifications for the same device, ignoring the duplicates, as this
behavior has been observed in the wild.

I also fix DeviceReady() to not send a device added notification if a
device was disconnected while it was being enumerated. The device would
not have been added to the global device list in this case.

BUG= 638298 

Review-Url: https://codereview.chromium.org/2261783002
Cr-Commit-Position: refs/heads/master@{#413273}
(cherry picked from commit f2c7b56f4a4f2c16b2f7062f60ad3041217e9f20)

Review URL: https://codereview.chromium.org/2269143002 .

Cr-Commit-Position: refs/branch-heads/2785@{#725}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[modify] https://crrev.com/b69683e7f0dc6fcb3d06db36d4ada51fe56c3c18/device/usb/usb_service_linux.cc

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

Labels: VerifyIn-57

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

Labels: VerifyIn-58

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

Labels: VerifyIn-59

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

Labels: VerifyIn-60
Labels: VerifyIn-61

Comment 17 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)

Sign in to add a comment