Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(647)

Issue 2218983003: Force non-joinable SimpleThreads to be leaked. (Closed)

Created:
4 years, 4 months ago by gab
Modified:
4 years, 4 months ago
Reviewers:
Lei Zhang, sdefresne
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@f1_eatsecondparam_expectdcheckdeath
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Force non-joinable SimpleThreads to be leaked. The downstream iOS bots caught a race in https://codereview.chromium.org/2204333003/. The race is reproducible on all platforms by forcing a sleep in SimpleThread::ThreadMain() just before invoking Run(). The issue is that the tests return from Start() after the |event_| is signaled but there's no guarantee that Run() is called before the SimpleThread object goes out of scope and is destroyed. Making a race to invoke a virtual method on a potentially deleted object. The iOS10 kernel just so happens to exercise that race more reliably. And worse, the crash often occurred in the next, unrelated, test... Non-joinable base::Threads are forced to be leaked and non-joinable base::SimpleThreads will have to follow suit. BUG=634835, 629716

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -14 lines) Patch
M base/threading/simple_thread.h View 1 chunk +8 lines, -3 lines 0 comments Download
M base/threading/simple_thread.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M base/threading/simple_thread_unittest.cc View 2 chunks +20 lines, -8 lines 2 comments Download

Depends on Patchset:

Messages

Total messages: 9 (4 generated)
gab
Lei, PTAL, this addresses a live issue on the upstream iOS bots (http://crbug.com/634835). Thanks
4 years, 4 months ago (2016-08-05 16:13:55 UTC) #3
sdefresne
nit: in description, the bot is downstream, not upstream https://codereview.chromium.org/2218983003/diff/1/base/threading/simple_thread_unittest.cc File base/threading/simple_thread_unittest.cc (right): https://codereview.chromium.org/2218983003/diff/1/base/threading/simple_thread_unittest.cc#newcode151 base/threading/simple_thread_unittest.cc:151: ...
4 years, 4 months ago (2016-08-05 16:48:34 UTC) #5
gab
https://codereview.chromium.org/2218983003/diff/1/base/threading/simple_thread_unittest.cc File base/threading/simple_thread_unittest.cc (right): https://codereview.chromium.org/2218983003/diff/1/base/threading/simple_thread_unittest.cc#newcode151 base/threading/simple_thread_unittest.cc:151: SleepRunner runner; On 2016/08/05 16:48:33, sdefresne (travelling - slow) ...
4 years, 4 months ago (2016-08-05 17:28:33 UTC) #7
Reilly Grant (use Gerrit)
Take a look at base_unittests under TSan as well before landing this. It looks like ...
4 years, 4 months ago (2016-08-05 22:24:19 UTC) #8
gab
4 years, 4 months ago (2016-08-08 21:19:49 UTC) #9
Re-opened https://codereview.chromium.org/2204333003/ and will continue there
(closing this one).

On 2016/08/05 22:24:19, Reilly Grant wrote:
> Take a look at base_unittests under TSan as well before landing this. It looks
> like two more tests may be failing because of this change.
> 
>
https://build.chromium.org/p/chromium.memory.full/builders/Linux%20TSan%20Tes...

Will make sure to run TSAN try bots before landing, thanks!

Powered by Google App Engine
This is Rietveld 408576698