Status: Untriaged
Owner: [email protected]
CC: [email protected],  maruelatchromium
Labels: Type-Bug Pri-2 OS-All Area-Misc Valgrind ThreadSanitizer

New issue 25385 by [email protected]: Data race on vfptr in base::Thread
http://code.google.com/p/chromium/issues/detail?id=25385

base::Thread joins the OS thread in its destructor.
This results in a data race on vfptr.
See http://code.google.com/p/data-race-test/wiki/PopularDataRaces for the
details.

If we don't subclass base::Thread, this data race is benign.
Othewise, this can be harmful.
I saw a few base::Thread subclasses in unittests (e.g.
base/thread_unittest.cc).

In either case, this data race results in a ThreadSanitizer report like
the following:
INFO: T0 is program's main thread
WARNING: Possible data race during write of size 4 at 0xFEFE657C: {{{
    T0 (locks held: {}):
     #0  base::Thread::~Thread() base/thread.cc:46
     ...
   Concurrent read(s) happened at (OR AFTER) these points:
    T15 (locks held: {}):
     #0  base::Thread::ThreadMain() base/thread.cc:153
     #1  ThreadFunc(void*) base/platform_thread_posix.cc:26
     #2  ThreadSanitizerStartThread ts_valgrind_intercepts.c:504
   ...
}}}

Do we have base::Thread subclasses outside unittests?

Anyway, I'd recommend sealing base::Thread and re-writing the tests that
subclass it.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to