Closed GoogleCodeExporter closed 9 years ago
Looks like debug info is fine - if you're symbolizing 0x20ac958 which
corresponds to the actual memory access (__tsan_read4), the stack trace is
correct. But instead TSan passes the return address (0x20ac959) to
llvm-symbolizer.
Original comment by samso...@google.com
on 11 Jun 2013 at 9:11
The second stack frame is also incorrect, there must be string-related frames.
Original comment by dvyu...@google.com
on 11 Jun 2013 at 9:32
Looks like it's incorrect to not subtract 1 from the top stack frame's address.
If I always set is_last to false in __tsan::SymbolizeStack(), I get the
following stack traces:
WARNING: ThreadSanitizer: data race (pid=12529)
Read of size 4 at 0x7d1800005050 by thread T2:
#0 _M_rep /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:187 (net_unittests+0x0000020b30e8)
#1 _M_leak /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:311 (net_unittests+0x0000020b30e8)
#2 IsSeparator /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:841 (net_unittests+0x0000020b30e8)
#3 base::FilePath::StripTrailingSeparatorsInternal() base/files/file_path.cc:1246 (net_unittests+0x0000020b30e8)
#4 base::FilePath::DirName() const base/files/file_path.cc:307 (net_unittests+0x0000020b2602)
#5 (anonymous namespace)::WriteToDiskInternal(base::FilePath const&, scoped_ptr<Pickle, base::DefaultDeleter<Pickle> >, base::TimeTicks const&, bool) net/disk_cache/simple/simple_index_file.cc:43 (net_unittests+0x000001dcc375)
#6 Run base/bind_internal.h:355 (net_unittests+0x000001dce5b6)
#7 MakeItSo base/bind_internal.h:957 (net_unittests+0x000001dce5b6)
#8 base::internal::Invoker<4, base::internal::BindState<base::internal::RunnableAdapter<void (*)(base::FilePath const&, scoped_ptr<Pickle, base::DefaultDeleter<Pickle> >, base::TimeTicks const&, bool)>, void (base::FilePath const&, scoped_ptr<Pickle, base::DefaultDeleter<Pickle> >, base::TimeTicks const&, bool), void (base::FilePath, base::internal::PassedWrapper<scoped_ptr<Pickle, base::DefaultDeleter<Pickle> > >, base::TimeTicks, bool)>, void (base::FilePath const&, scoped_ptr<Pickle, base::DefaultDeleter<Pickle> >, base::TimeTicks const&, bool)>::Run(base::internal::BindStateBase*) base/bind_internal.h:1568 (net_unittests+0x000001dce5b6)
#9 Run base/callback.h:396 (net_unittests+0x0000020c2fe1)
#10 base::MessageLoop::RunTask(base::PendingTask const&) base/message_loop.cc:484 (net_unittests+0x0000020c2fe1)
#11 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask const&) base/message_loop.cc:496 (net_unittests+0x0000020c33c7)
#12 base::MessageLoop::DoWork() base/message_loop.cc:688 (net_unittests+0x0000020c3929)
#13 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_pump_libevent.cc:235 (net_unittests+0x0000020a4a93)
#14 base::MessageLoop::RunInternal() base/message_loop.cc:441 (net_unittests+0x0000020c26a0)
#15 base::MessageLoop::RunHandler() base/message_loop.cc:414 (net_unittests+0x0000020c2559)
#16 base::RunLoop::Run() base/run_loop.cc:45 (net_unittests+0x0000020dae72)
#17 base::MessageLoop::Run() base/message_loop.cc:321 (net_unittests+0x0000020c1995)
#18 base::Thread::Run(base::MessageLoop*) base/threading/thread.cc:158 (net_unittests+0x0000020f3cc9)
#19 base::Thread::ThreadMain() base/threading/thread.cc:203 (net_unittests+0x0000020f3e6d)
#20 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:80 (net_unittests+0x0000020ece89)
Previous atomic write of size 4 at 0x7d1800005050 by thread T3:
#0 __tsan_atomic32_fetch_add /usr/local/google/asan/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:466 (net_unittests+0x0000002479b7)
#1 __exchange_and_add_dispatch /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ext/atomicity.h:80:9 (net_unittests+0x0000020b189d)
#2 _M_rep /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:240 (net_unittests+0x0000020b189d)
#3 ~basic_string /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:534 (net_unittests+0x0000020b189d)
#4 ~basic_string /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:534 (net_unittests+0x0000020b189d)
#5 base::FilePath::~FilePath() base/files/file_path.cc:184 (net_unittests+0x0000020b189d)
#6 ~BindState base/bind_internal.h:2620 (net_unittests+0x000001dce6e7)
#7 ~BindState base/bind_internal.h:2619 (net_unittests+0x000001dce6e7)
#8 base::internal::BindState<base::internal::RunnableAdapter<void (*)(base::FilePath const&, scoped_refptr<base::SingleThreadTaskRunner>, base::Callback<void (scoped_ptr<__gnu_cxx::hash_map<unsigned long, disk_cache::EntryMetadata, __gnu_cxx::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<disk_cache::EntryMetadata> >, base::DefaultDeleter<__gnu_cxx::hash_map<unsigned long, disk_cache::EntryMetadata, __gnu_cxx::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<disk_cache::EntryMetadata> > > >, bool)> const&)>, void (base::FilePath const&, scoped_refptr<base::SingleThreadTaskRunner>, base::Callback<void (scoped_ptr<__gnu_cxx::hash_map<unsigned long, disk_cache::EntryMetadata, __gnu_cxx::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<disk_cache::EntryMetadata> >, base::DefaultDeleter<__gnu_cxx::hash_map<unsigned long, disk_cache::EntryMetadata, __gnu_cxx::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<disk_cache::EntryMetadata> > > >, bool)> const&), void (base::FilePath, scoped_refptr<base::SingleThreadTaskRunner>, base::Callback<void (scoped_ptr<__gnu_cxx::hash_map<unsigned long, disk_cache::EntryMetadata, __gnu_cxx::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<disk_cache::EntryMetadata> >, base::DefaultDeleter<__gnu_cxx::hash_map<unsigned long, disk_cache::EntryMetadata, __gnu_cxx::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<disk_cache::EntryMetadata> > > >, bool)>)>::~BindState() base/bind_internal.h:2619 (net_unittests+0x000001dce6e7)
#9 DeleteInternal base/memory/ref_counted.h:151 (net_unittests+0x0000020a8208)
#10 Destruct base/memory/ref_counted.h:114 (net_unittests+0x0000020a8208)
#11 Release base/memory/ref_counted.h:142 (net_unittests+0x0000020a8208)
#12 ~scoped_refptr base/memory/ref_counted.h:250 (net_unittests+0x0000020a8208)
#13 ~scoped_refptr base/memory/ref_counted.h:248 (net_unittests+0x0000020a8208)
#14 base::internal::CallbackBase::~CallbackBase() base/callback_internal.cc:35 (net_unittests+0x0000020a8208)
#15 ~Callback base/callback_forward.h:11 (net_unittests+0x0000020d1daa)
#16 ~Callback base/callback_forward.h:11 (net_unittests+0x0000020d1daa)
#17 base::PendingTask::~PendingTask() base/pending_task.cc:38 (net_unittests+0x0000020d1daa)
#18 base::(anonymous namespace)::WorkerThread::ThreadMain() base/threading/worker_pool_posix.cc:106 (net_unittests+0x0000020f8c6e)
#19 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:80 (net_unittests+0x0000020ece89)
Original comment by gli...@google.com
on 11 Jun 2013 at 10:25
Should be fixed by r184112.
Please verify.
Original comment by dvyu...@google.com
on 17 Jun 2013 at 8:01
Works for me, thanks!
==================
WARNING: ThreadSanitizer: data race (pid=13374)
Read of size 4 at 0x7d1800004e10 by thread T2:
#0 _M_rep /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:187 (net_unittests+0x000001f0a318)
#1 _M_leak /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:311 (net_unittests+0x000001f0a318)
#2 IsSeparator /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:841 (net_unittests+0x000001f0a318)
#3 base::FilePath::StripTrailingSeparatorsInternal() base/files/file_path.cc:1246 (net_unittests+0x000001f0a318)
#4 base::FilePath::DirName() const base/files/file_path.cc:307 (net_unittests+0x000001f09832)
#5 (anonymous namespace)::WriteToDiskInternal(base::FilePath const&, scoped_ptr<Pickle, base::DefaultDeleter<Pickle> >, base::TimeTicks const&, bool) net/disk_cache/simple/simple_index_file.cc:44 (net_unittests+0x000001c1fbd5)
#6 Run base/bind_internal.h:355 (net_unittests+0x000001c21e26)
#7 MakeItSo base/bind_internal.h:957 (net_unittests+0x000001c21e26)
#8 base::internal::Invoker<4, base::internal::BindState<base::internal::RunnableAdapter<void (*)(base::FilePath const&, scoped_ptr<Pickle, base::DefaultDeleter<Pickle> >, base::TimeTicks const&, bool)>, void (base::FilePath const&, scoped_ptr<Pickle, base::DefaultDeleter<Pickle> >, base::TimeTicks const&, bool), void (base::FilePath, base::internal::PassedWrapper<scoped_ptr<Pickle, base::DefaultDeleter<Pickle> > >, base::TimeTicks, bool)>, void (base::FilePath const&, scoped_ptr<Pickle, base::DefaultDeleter<Pickle> >, base::TimeTicks const&, bool)>::Run(base::internal::BindStateBase*) base/bind_internal.h:1568 (net_unittests+0x000001c21e26)
#9 Run base/callback.h:396 (net_unittests+0x000001f19db1)
#10 base::MessageLoop::RunTask(base::PendingTask const&) base/message_loop/message_loop.cc:484 (net_unittests+0x000001f19db1)
#11 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask const&) base/message_loop/message_loop.cc:496 (net_unittests+0x000001f1a197)
#12 base::MessageLoop::DoWork() base/message_loop/message_loop.cc:688 (net_unittests+0x000001f1a6f9)
#13 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_pump_libevent.cc:235 (net_unittests+0x000001efbbf3)
#14 base::MessageLoop::RunInternal() base/message_loop/message_loop.cc:441 (net_unittests+0x000001f19470)
#15 base::MessageLoop::RunHandler() base/message_loop/message_loop.cc:414 (net_unittests+0x000001f19329)
#16 base::RunLoop::Run() base/run_loop.cc:45 (net_unittests+0x000001f320a2)
#17 base::MessageLoop::Run() base/message_loop/message_loop.cc:321 (net_unittests+0x000001f18765)
#18 base::Thread::Run(base::MessageLoop*) base/threading/thread.cc:158 (net_unittests+0x000001f4b219)
#19 base::Thread::ThreadMain() base/threading/thread.cc:203 (net_unittests+0x000001f4b3bd)
#20 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:80 (net_unittests+0x000001f440b9)
Previous atomic write of size 4 at 0x7d1800004e10 by main thread:
#0 __tsan_atomic32_fetch_add /usr/local/google/asan/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:465 (net_unittests+0x00000023e918)
#1 __exchange_and_add_dispatch /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ext/atomicity.h:80:9 (net_unittests+0x000001f08acd)
#2 _M_rep /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:240 (net_unittests+0x000001f08acd)
#3 ~basic_string /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:534 (net_unittests+0x000001f08acd)
#4 ~basic_string /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.h:534 (net_unittests+0x000001f08acd)
#5 base::FilePath::~FilePath() base/files/file_path.cc:184 (net_unittests+0x000001f08acd)
#6 disk_cache::SimpleIndexFile::~SimpleIndexFile() net/disk_cache/simple/simple_index_file.cc:116 (net_unittests+0x000001c1dbb0)
#7 disk_cache::SimpleIndexFile::~SimpleIndexFile() net/disk_cache/simple/simple_index_file.cc:116 (net_unittests+0x000001c1db69)
#8 operator() base/memory/scoped_ptr.h:137 (net_unittests+0x000001c17c78)
#9 ~scoped_ptr_impl base/memory/scoped_ptr.h:220 (net_unittests+0x000001c17c78)
#10 ~scoped_ptr_impl base/memory/scoped_ptr.h:216 (net_unittests+0x000001c17c78)
#11 ~scoped_ptr base/memory/scoped_ptr.h:310 (net_unittests+0x000001c17c78)
#12 ~list base/memory/scoped_ptr.h:310 (net_unittests+0x000001c17c78)
#13 disk_cache::SimpleIndex::~SimpleIndex() net/disk_cache/simple/simple_index.cc:122 (net_unittests+0x000001c17c78)
#14 disk_cache::SimpleIndex::~SimpleIndex() net/disk_cache/simple/simple_index.cc:114 (net_unittests+0x000001c17b19)
#15 operator() base/memory/scoped_ptr.h:137 (net_unittests+0x000001c07275)
#16 ~scoped_ptr_impl base/memory/scoped_ptr.h:220 (net_unittests+0x000001c07275)
#17 ~scoped_ptr_impl base/memory/scoped_ptr.h:216 (net_unittests+0x000001c07275)
#18 ~scoped_ptr base/memory/scoped_ptr.h:310 (net_unittests+0x000001c07275)
#19 ~hash_map base/memory/scoped_ptr.h:310 (net_unittests+0x000001c07275)
#20 disk_cache::SimpleBackendImpl::~SimpleBackendImpl() net/disk_cache/simple/simple_backend_impl.cc:179 (net_unittests+0x000001c07275)
#21 disk_cache::SimpleBackendImpl::~SimpleBackendImpl() net/disk_cache/simple/simple_backend_impl.cc:177 (net_unittests+0x000001c07199)
#22 DiskCacheTestWithCache::TearDown() net/disk_cache/disk_cache_test_base.cc:231 (net_unittests+0x000001608f6b)
#23 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) testing/gtest/src/gtest.cc:2051 (net_unittests+0x0000015d902e)
#24 testing::Test::Run() testing/gtest/src/gtest.cc:2075 (net_unittests+0x0000015d8f0e)
#25 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2244 (net_unittests+0x0000015da016)
#26 testing::TestCase::Run() testing/gtest/src/gtest.cc:2351 (net_unittests+0x0000015da7d8)
#27 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4177 (net_unittests+0x0000015e1eb7)
#28 impl testing/gtest/src/gtest.cc:2051 (net_unittests+0x0000015e183a)
#29 testing::UnitTest::Run() testing/gtest/src/gtest.cc:3810 (net_unittests+0x0000015e183a)
#30 base::TestSuite::Run() base/test/test_suite.cc:167 (net_unittests+0x0000015f5370)
#31 main net/test/run_all_unittests.cc:52 (net_unittests+0x000001411cc9)
Location is heap block of size 93 at 0x7d1800004e00 allocated by main thread:
#0 operator new(unsigned long) /usr/local/google/asan/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:497 (net_unittests+0x000000218244)
#1 <null> <null>:0 (libstdc++.so.6+0x00000009ea88)
#2 base::FilePath::AppendASCII(base::BasicStringPiece<std::string> const&) const base/files/file_path.cc:505 (net_unittests+0x000001f0ae7b)
#3 disk_cache::SimpleIndexFile::SimpleIndexFile(base::SingleThreadTaskRunner*, base::TaskRunner*, base::FilePath const&) net/disk_cache/simple/simple_index_file.cc:114 (net_unittests+0x000001c1db35)
#4 disk_cache::SimpleBackendImpl::Init(base::Callback<void (int)> const&) net/disk_cache/simple/simple_backend_impl.cc:189 (net_unittests+0x000001c07507)
#5 DiskCacheTestWithCache::CreateBackend(unsigned int, base::Thread*) net/disk_cache/disk_cache_test_base.cc:278 (net_unittests+0x000001606c88)
#6 DiskCacheTestWithCache::InitDiskCache() net/disk_cache/disk_cache_test_base.cc:263 (net_unittests+0x000001605c5f)
#7 DiskCacheTestWithCache::InitCache() net/disk_cache/disk_cache_test_base.cc:75 (net_unittests+0x000001604fbd)
#8 DiskCacheEntryTest_SimpleCacheSizeAtCreate_Test::TestBody() net/disk_cache/entry_unittest.cc:2361 (net_unittests+0x0000006b8296)
#9 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) testing/gtest/src/gtest.cc:2051 (net_unittests+0x0000015d902e)
#10 testing::Test::Run() testing/gtest/src/gtest.cc:2067 (net_unittests+0x0000015d8e90)
#11 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2244 (net_unittests+0x0000015da016)
#12 testing::TestCase::Run() testing/gtest/src/gtest.cc:2351 (net_unittests+0x0000015da7d8)
#13 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4177 (net_unittests+0x0000015e1eb7)
#14 impl testing/gtest/src/gtest.cc:2051 (net_unittests+0x0000015e183a)
#15 testing::UnitTest::Run() testing/gtest/src/gtest.cc:3810 (net_unittests+0x0000015e183a)
#16 base::TestSuite::Run() base/test/test_suite.cc:167 (net_unittests+0x0000015f5370)
Original comment by gli...@chromium.org
on 19 Jun 2013 at 8:09
Original issue reported on code.google.com by
gli...@google.com
on 11 Jun 2013 at 8:41