New issue
Advanced search Search tips

Issue 853907 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

"HidApiTest.GetUserSelectedDevices" is flaky under TSan

Project Member Reported by chromium...@appspot.gserviceaccount.com, Jun 18 2018

Issue description

"HidApiTest.GetUserSelectedDevices" is flaky.

This issue was created automatically by the chromium-try-flakes app. Please find the right owner to fix the respective test/step and assign this issue to them. If the step/test is infrastructure-related, please add Infra-Troopers label and change issue status to Untriaged. When done, please remove the issue from Sheriff Bug Queue by removing the Sheriff-Chromium label.

We have detected 3 recent flakes. List of all flakes can be found at https://chromium-try-flakes.appspot.com/all_flake_occurrences?key=ahVzfmNocm9taXVtLXRyeS1mbGFrZXNyLAsSBUZsYWtlIiFIaWRBcGlUZXN0LkdldFVzZXJTZWxlY3RlZERldmljZXMM.

Flaky tests should be disabled within 30 minutes unless culprit CL is found and reverted. Please see more details here: https://sites.google.com/a/chromium.org/dev/developers/tree-sheriffs/sheriffing-bug-queues#triaging-auto-filed-flakiness-bugs
 

Comment 1 by holte@chromium.org, Jun 18 2018

Owner: reillyg@chromium.org
Status: Assigned (was: Untriaged)
See also:
https://bugs.chromium.org/p/chromium/issues/detail?id=853915
https://bugs.chromium.org/p/chromium/issues/detail?id=853907

Found instances of what look like flakes for other HidApiTests too, so disabling all of them
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 18 2018

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

commit 86d4b6f07473322a034256ee817cdd34dd6a0230
Author: Steven Holte <holte@google.com>
Date: Mon Jun 18 22:01:29 2018

Disable HidApiTest on tsan builds.

Bug:853907, 853915 
TBR=reillyg
NOTRY=true

Change-Id: Ib8e489de591b014a3f33da233bd55cddb56abb59
Reviewed-on: https://chromium-review.googlesource.com/1105302
Reviewed-by: Steven Holte <holte@chromium.org>
Commit-Queue: Steven Holte <holte@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568187}
[modify] https://crrev.com/86d4b6f07473322a034256ee817cdd34dd6a0230/extensions/browser/api/hid/hid_apitest.cc

Comment 3 by holte@chromium.org, Jun 18 2018

Labels: -Sheriff-Chromium Test-Disabled
Components: Platform>Apps>API>HID
Cc: reillyg@chromium.org
 Issue 853915  has been merged into this issue.
Cc: thestig@chromium.org
Labels: OS-Linux
Summary: "HidApiTest.GetUserSelectedDevices" is flaky under TSan (was: "HidApiTest.GetUserSelectedDevices" is flaky)
The data races being reported by TSan appear to be basic stuff around setup and shutdown where no data races should be possible because there is only one thread running at a time. In addition to races around service_manager::ServiceContext::SetGlobalBinderForTesting I'm also seeing other test runs complaining about the ExtensionMessageFilter setup in the logs:

https://chromium-swarm.appspot.com/task?id=3e2d3a39b0a02510&refresh=10&show_raw=1&wide_logs=true

thestig@, am I right that these setup/teardown tasks shouldn't be triggering data race warnings?
There's definitely 2 threads active. +rockot since it's service_manager code.

See this log for example: https://logs.chromium.org/v/?s=chromium%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8943354276391596960%2F%2B%2Fsteps%2Fextensions_browsertests__with_patch_%2F0%2Flogs%2FHidApiTest.OnDeviceRemoved%2F0

TSAN explains "Thread T2 'Chrome_IOThread' (tid=26027, running) created by main thread at" ...
There are eventually 2 threads but during SetUpOnMainThread() is the IO thread active?
Yes, the IO thread is active during SetUpOnMainThread().

The Chrome_IOThread creation stack trace has:

    #6 content::ContentServiceManagerMainDelegate::GetServiceManagerTaskRunnerForEmbedderProcess() content/app/content_service_manager_main_delegate.cc:132:32 (extensions_browsertests+0x404083a)
    #7 service_manager::Main(service_manager::MainParams const&) services/service_manager/embedder/main.cc:456:23 (extensions_browsertests+0x7b0e4b2)
    #8 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:19:10 (extensions_browsertests+0x40414be)

and the SetUpOnMainThread() stack trace has:

    #23 content::ContentServiceManagerMainDelegate::RunEmbedderProcess() content/app/content_service_manager_main_delegate.cc:53:32 (extensions_browsertests+0x40401bf)
    #24 service_manager::Main(service_manager::MainParams const&) services/service_manager/embedder/main.cc:459:29 (extensions_browsertests+0x7b0e4ee)
    #25 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:19:10 (extensions_browsertests+0x40414be)

main.cc line 456 is just before line 459.
Status: Started (was: Assigned)
I have a patch out for review that updates a bunch of the tests using this to do initialization and cleanup in the test constructor/destructor rather than in SetUpOnMainThread():

https://chromium-review.googlesource.com/c/chromium/src/+/1121588
Project Member

Comment 11 by bugdroid1@chromium.org, Jul 11

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

commit 633165605e93f34bcc0c149248fd8773e34d4596
Author: Reilly Grant <reillyg@chromium.org>
Date: Wed Jul 11 00:48:03 2018

Move global binder overrides before browser thread initialization

The structure that tracks global binder overrides is not thread-safe.
This is fine because these overrides should be static for the life of
the browser. Some tests however configured these overrides after the
browser threads were started which the thread sanitizer complains about.

Bug:  853907 
Change-Id: Ibf282aa403be37639261dab66c9c73a99b6fb767
Reviewed-on: https://chromium-review.googlesource.com/1121588
Reviewed-by: Alexander Alekseev <alemate@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574008}
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/chrome/browser/chromeos/login/bluetooth_host_pairing_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/chrome/browser/chromeos/login/hid_detection_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/chrome/browser/chromeos/login/kiosk_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/chrome/browser/chromeos/login/screens/hid_detection_screen_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/content/browser/battery_monitor_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/content/browser/device_sensors/device_sensor_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/content/browser/generic_sensor/generic_sensor_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/content/browser/power_monitor_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/content/browser/vibration_browsertest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/extensions/browser/api/hid/hid_apitest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/extensions/browser/api/serial/serial_apitest.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/services/audio/public/cpp/fake_system_info.cc
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/services/audio/public/cpp/fake_system_info.h
[modify] https://crrev.com/633165605e93f34bcc0c149248fd8773e34d4596/services/audio/test/in_process_service_test.cc

Status: Fixed (was: Started)

Sign in to add a comment