Comment #2 on issue 361 by [email protected]: ThreadSanitizer reports  
dubious practices in V8
http://code.google.com/p/v8/issues/detail?id=361

There are few more race reports. E.g. this one:
<pre>
WARNING: Possible data race during write of size 4 at 0x831A134: {{{
    T1 (locks held: {L3}):
     #0  v8::internal::StackGuard::set_limits(unsigned int,  
v8::internal::ExecutionAccess const&) src/execution.h:203
     #1  v8::internal::StackGuard::Preempt() src/execution.cc:285
     #2  v8::internal::ContextSwitcher::Run() src/v8threads.cc:436
     #3  v8::internal::ThreadEntry(void*) src/platform-linux.cc:429
     #4  ThreadSanitizerStartThread ts_valgrind_intercepts.c:504
   Concurrent read(s) happened at (OR AFTER) these points:
    T0 (locks held: {L2}):
     #0  v8::internal::StackGuard::climit() src/execution.h:187
     #1  v8::internal::StackLimitCheck::HasOverflowed() const  
src/execution.h:260
     #2  v8::internal::AstVisitor::CheckStackOverflow() src/ast.h:1746
     #3  v8::internal::Slot::Accept(v8::internal::AstVisitor*) src/ast.cc:53
     #4  v8::internal::AstVisitor::Visit(v8::internal::AstNode*)  
src/ast.h:1734
     #5   
v8::internal::CodeGenerator::VisitVariableProxy(v8::internal::VariableProxy*)  
src/ia32/codegen-ia32.cc:3969
     #6  v8::internal::VariableProxy::Accept(v8::internal::AstVisitor*)  
src/ast.cc:53
     #7  v8::internal::AstVisitor::Visit(v8::internal::AstNode*)  
src/ast.h:1734
     #8   
v8::internal::CodeGenerator::LoadCondition(v8::internal::Expression*,  
v8::internal::TypeofState, v8::internal::ControlDestination*, bool)  
src/ia32/codegen-
ia32.cc:425
     #9  v8::internal::CodeGenerator::Load(v8::internal::Expression*,  
v8::internal::TypeofState) src/ia32/codegen-ia32.cc:471
   Address 0x831A134 is 12 bytes inside data  
symbol "_ZN2v88internal10StackGuard13thread_local_E"
   Locks involved in this report (reporting last lock sites): {L2, L3}
    L2
     #0  pthread_mutex_lock ts_valgrind_intercepts.c:751
     #1  v8::internal::ThreadManager::Lock() src/v8threads.cc:181
     #2  v8::Locker::Locker() src/v8threads.cc:57
     #3  TestPreemption() test/cctest/test-threads.cc:36
     #4  CcTest::Run() test/cctest/cctest.h:57
     #5  main test/cctest/cctest.cc:96
    L3
     #0  pthread_mutex_lock ts_valgrind_intercepts.c:751
     #1  v8::internal::LinuxMutex::Lock() src/platform-linux.cc:495
     #2  v8::internal::ExecutionAccess::ExecutionAccess() src/top.cc:981
     #3  v8::internal::StackGuard::Preempt() src/execution.cc:283
     #4  v8::internal::ContextSwitcher::Run() src/v8threads.cc:436
     #5  v8::internal::ThreadEntry(void*) src/platform-linux.cc:429
     #6  ThreadSanitizerStartThread ts_valgrind_intercepts.c:504
}}}
</pre>

v8::internal::StackGuard::set_limits() happens under ExecutionAccess lock.
StackGuard::climit() happens w/o ExecutionAccess lock

The comment above climit tells:
   // This provides an asynchronous read of the stack limit for the current
   // thread.  There are no locks protecting this, but it is assumed that you
   // have the global V8 lock if you are using multiple V8 threads.

So, I assume this particular race is expected. Right?

--
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

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to