DescriptionFix the following tsan errors:
1. Race updating the allocation stats for a class
WARNING: ThreadSanitizer: data race (pid=16346)
Write of size 8 at 0x7bac00011930 by thread T4:
#0 dart::AllocStats<long>::AddOld(long, long) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/class_table.h:56 (dart+0x000000769278)
#1 dart::ClassTable::UpdateAllocatedOld(long, long) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/class_table.cc:423 (dart+0x00000076923a)
#2 dart::Object::Allocate(long, long, dart::Heap::Space) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/object.cc:1880 (dart+0x00000092ddff)
#3 dart::Array::New(long, long, dart::Heap::Space) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/object.cc:21586 (dart+0x00000098d3fd)
Previous write of size 8 at 0x7bac00011930 by thread T3:
#0 dart::AllocStats<long>::AddOld(long, long) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/class_table.h:56 (dart+0x000000769278)
#1 dart::ClassTable::UpdateAllocatedOld(long, long) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/class_table.cc:423 (dart+0x00000076923a)
#2 dart::Object::Allocate(long, long, dart::Heap::Space) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/object.cc:1880 (dart+0x00000092ddff)
#3 dart::Array::New(long, long, dart::Heap::Space) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/object.cc:21586 (dart+0x00000098d3fd)
#4 dart::Array::New(long, dart::Heap::Space) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/object.cc:21575 (dart+0x000000932f6d)
2. Race while updating c++ table entry into Object::builtin_vtables_
WARNING: ThreadSanitizer: data race (pid=16346)
Atomic write of size 8 at 0x00000210c970 by main thread:
#0 __tsan_atomic64_compare_exchange_val <null> (dart+0x0000005bad8a)
#1 dart::AtomicOperations::CompareAndSwapWord(unsigned long*, unsigned long, unsigned long) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/atomic_linux.h:63 (dart+0x00000074b744)
#2 dart::ClassTable::Register(dart::Class const&) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/class_table.cc:127 (dart+0x000000767cbc)
#3 dart::Isolate::RegisterClass(dart::Class const&) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/isolate.cc:170 (dart+0x0000008e0046)
#4 dart::RawClass* dart::Class::New<dart::Array>() /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/object.cc:2037 (dart+0x000000931055)
Previous read of size 8 at 0x00000210c970 by thread T3:
#0 dart::ClassTable::Register(dart::Class const&) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/class_table.cc:130 (dart+0x000000767cc9)
#1 dart::Isolate::RegisterClass(dart::Class const&) /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/isolate.cc:170 (dart+0x0000008e0046)
#2 dart::RawClass* dart::Class::New<dart::Array>() /usr/local/google/home/asiva/workspace/dart-ws3/sdk/out/DebugX64/../../runtime/vm/object.cc:2037 (dart+0x000000931055)
BUG=
R=regis@google.com
Committed: https://github.com/dart-lang/sdk/commit/d77809e15fded186470ae6813643ca4a5ba12a37
Patch Set 1 #
Messages
Total messages: 5 (2 generated)
|