New issue
Advanced search Search tips

Issue 885188 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Oct 3
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

data_race browsing_data_remover_test_util

Reported by marytara...@yandex-team.ru, Sep 18

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15

Steps to reproduce the problem:
1. build browser_tests with ThreadSanitizer
2. run browser_test BrowsingDataRemoverBrowserTestP.EmptyIndexedDb several times
3. ThreadSanitizer reports data race

What is the expected behavior?
no data_race

What went wrong?
ThreadSanitizer: data race

Did this work before? N/A 

Chrome version: <Copy from: 'about:version'>  Channel: n/a
OS Version: 
Flash Version:
 
data_race.txt
33.0 KB View Download
Labels: Needs-Milestone
Project Member

Comment 3 by bugdroid1@chromium.org, Sep 25

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

commit 185ec6285ddeb538ecda4f0e057a406a226b524f
Author: Maria Tarasova <marytarasova@yandex-team.ru>
Date: Tue Sep 25 17:33:23 2018

Fix data race in browsing_data_remover_test_util

If browser_tests is built with tsan enabled, Thread Sanitizer reports
data races in browsing_data_remover_test_util.

There are two threads to concurrently access the shared data, the
test’s main thread and a thread controlled by TaskScheduler singleton.
Both access browsing_data_remover_done_ and/or
flush_for_testing_complete_ fields to break run loop and exit test
after some cleanup occurs. In TaskScheduler’s thread, the write access
is done by the lambda function.

The proposed solution is to use the lambda call only to report the
asynchronous event to main thread, which becomes the only one to
access the fields implementing run loop break logic.

R=sky@chromium.org

Bug:  885188 
Change-Id: I706edb24ed362444cf46e558b1d54389179884da
Reviewed-on: https://chromium-review.googlesource.com/1233613
Reviewed-by: Robert Liao <robliao@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593987}
[modify] https://crrev.com/185ec6285ddeb538ecda4f0e057a406a226b524f/content/public/test/browsing_data_remover_test_util.cc
[modify] https://crrev.com/185ec6285ddeb538ecda4f0e057a406a226b524f/content/public/test/browsing_data_remover_test_util.h

Status: Fixed (was: Unconfirmed)

Sign in to add a comment