Skip to content

Instantly share code, notes, and snippets.

@mrzzzrm
Created February 4, 2019 08:27
Show Gist options
  • Save mrzzzrm/c6efc52d918a46471b1df80feb9dc8b3 to your computer and use it in GitHub Desktop.
Save mrzzzrm/c6efc52d918a46471b1df80feb9dc8b3 to your computer and use it in GitHub Desktop.
WARNING: ThreadSanitizer: data race (pid=14582)
Write of size 8 at 0x7b2000000bb8 by thread T1 (mutexes: write M2287):
#0 void std::vector<std::shared_ptr<opossum::Chunk>, std::allocator<std::shared_ptr<opossum::Chunk> > >::_M_realloc_insert<std::shared_ptr<opossum::Chunk> >(__gnu_cxx::__normal_iterator<std::shared_ptr<opossum::Chunk>*, std::vector<std::shared_ptr<opossum::Chunk>, std::allocator<std::shared_ptr<opossum::Chunk> > > >, std::shared_ptr<opossum::Chunk>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/vector.tcc:471:30 (hyrisePlayground+0x345eb2c)
#1 std::shared_ptr<opossum::Chunk>& std::vector<std::shared_ptr<opossum::Chunk>, std::allocator<std::shared_ptr<opossum::Chunk> > >::emplace_back<std::shared_ptr<opossum::Chunk> >(std::shared_ptr<opossum::Chunk>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/vector.tcc:109:4 (hyrisePlayground+0x345bb31)
#2 opossum::Table::append_chunk(std::vector<std::shared_ptr<opossum::BaseSegment>, boost::container::pmr::polymorphic_allocator<std::shared_ptr<opossum::BaseSegment> > > const&, std::optional<boost::container::pmr::polymorphic_allocator<opossum::Chunk> > const&, std::shared_ptr<opossum::ChunkAccessCounter> const&) /home/moritz/Coding/hyrise2/src/lib/storage/table.cpp:170:11 (hyrisePlayground+0x34595da)
#3 opossum::Table::append_mutable_chunk() /home/moritz/Coding/hyrise2/src/lib/storage/table.cpp:106:3 (hyrisePlayground+0x345925d)
#4 opossum::Insert::_on_execute(std::shared_ptr<opossum::TransactionContext>) /home/moritz/Coding/hyrise2/src/lib/operators/insert.cpp:161:24 (hyrisePlayground+0x2c522f8)
#5 opossum::AbstractOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_operator.cpp:46:15 (hyrisePlayground+0x2b281db)
#6 opossum::AbstractReadWriteOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_read_write_operator.cpp:24:23 (hyrisePlayground+0x2b2fbd9)
#7 opossum::Update::_on_execute(std::shared_ptr<opossum::TransactionContext>) /home/moritz/Coding/hyrise2/src/lib/operators/update.cpp:51:12 (hyrisePlayground+0x3025e1a)
#8 opossum::AbstractOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_operator.cpp:46:15 (hyrisePlayground+0x2b281db)
#9 opossum::AbstractReadWriteOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_read_write_operator.cpp:24:23 (hyrisePlayground+0x2b2fbd9)
#10 test_concurrent_updates(unsigned long, unsigned long)::$_1::operator()(unsigned long) const /home/moritz/Coding/hyrise2/src/bin/playground.cpp:67:15 (hyrisePlayground+0x24d06b2)
#11 test_concurrent_updates(unsigned long, unsigned long)::$_2::operator()() const /home/moritz/Coding/hyrise2/src/bin/playground.cpp:81:44 (hyrisePlayground+0x24d042a)
#12 void std::__invoke_impl<void, test_concurrent_updates(unsigned long, unsigned long)::$_2>(std::__invoke_other, test_concurrent_updates(unsigned long, unsigned long)::$_2&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:60:14 (hyrisePlayground+0x24d03dd)
#13 std::__invoke_result<test_concurrent_updates(unsigned long, unsigned long)::$_2>::type std::__invoke<test_concurrent_updates(unsigned long, unsigned long)::$_2>(test_concurrent_updates(unsigned long, unsigned long)::$_2&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:95:14 (hyrisePlayground+0x24d034d)
#14 _ZNSt6thread8_InvokerISt5tupleIJZ23test_concurrent_updatesmmE3$_2EEE9_M_invokeIJLm0EEEEDTclsr3stdE8__invokespcl10_S_declvalIXT_EEEEESt12_Index_tupleIJXspT_EEE /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:234:13 (hyrisePlayground+0x24d0315)
#15 std::thread::_Invoker<std::tuple<test_concurrent_updates(unsigned long, unsigned long)::$_2> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:243:11 (hyrisePlayground+0x24d02d5)
#16 std::thread::_State_impl<std::thread::_Invoker<std::tuple<test_concurrent_updates(unsigned long, unsigned long)::$_2> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:186:13 (hyrisePlayground+0x24d0199)
#17 <null> <null> (libstdc++.so.6+0xbd57e)
Previous read of size 8 at 0x7b2000000bb8 by thread T2:
#0 std::vector<std::shared_ptr<opossum::Chunk>, std::allocator<std::shared_ptr<opossum::Chunk> > >::size() const /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/stl_vector.h:806:66 (hyrisePlayground+0x345b935)
#1 opossum::Table::chunk_count() const /home/moritz/Coding/hyrise2/src/lib/storage/table.cpp:119:93 (hyrisePlayground+0x34598fc)
#2 opossum::Validate::_on_execute(std::shared_ptr<opossum::TransactionContext>) /home/moritz/Coding/hyrise2/src/lib/operators/validate.cpp:64:50 (hyrisePlayground+0x302789f)
#3 opossum::AbstractOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_operator.cpp:46:15 (hyrisePlayground+0x2b281db)
#4 test_concurrent_updates(unsigned long, unsigned long)::$_1::operator()(unsigned long) const /home/moritz/Coding/hyrise2/src/bin/playground.cpp:65:17 (hyrisePlayground+0x24d0676)
#5 test_concurrent_updates(unsigned long, unsigned long)::$_2::operator()() const /home/moritz/Coding/hyrise2/src/bin/playground.cpp:81:44 (hyrisePlayground+0x24d042a)
#6 void std::__invoke_impl<void, test_concurrent_updates(unsigned long, unsigned long)::$_2>(std::__invoke_other, test_concurrent_updates(unsigned long, unsigned long)::$_2&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:60:14 (hyrisePlayground+0x24d03dd)
#7 std::__invoke_result<test_concurrent_updates(unsigned long, unsigned long)::$_2>::type std::__invoke<test_concurrent_updates(unsigned long, unsigned long)::$_2>(test_concurrent_updates(unsigned long, unsigned long)::$_2&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:95:14 (hyrisePlayground+0x24d034d)
#8 _ZNSt6thread8_InvokerISt5tupleIJZ23test_concurrent_updatesmmE3$_2EEE9_M_invokeIJLm0EEEEDTclsr3stdE8__invokespcl10_S_declvalIXT_EEEEESt12_Index_tupleIJXspT_EEE /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:234:13 (hyrisePlayground+0x24d0315)
#9 std::thread::_Invoker<std::tuple<test_concurrent_updates(unsigned long, unsigned long)::$_2> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:243:11 (hyrisePlayground+0x24d02d5)
#10 std::thread::_State_impl<std::thread::_Invoker<std::tuple<test_concurrent_updates(unsigned long, unsigned long)::$_2> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:186:13 (hyrisePlayground+0x24d0199)
#11 <null> <null> (libstdc++.so.6+0xbd57e)
Location is heap block of size 128 at 0x7b2000000b80 allocated by main thread:
#0 operator new(unsigned long) <null> (hyrisePlayground+0x24cca76)
#1 __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<opossum::Table, std::allocator<opossum::Table>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ext/new_allocator.h:111:27 (hyrisePlayground+0x24d8b5c)
#2 std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<opossum::Table, std::allocator<opossum::Table>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<opossum::Table, std::allocator<opossum::Table>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/alloc_traits.h:436:20 (hyrisePlayground+0x24d8ab0)
#3 std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<opossum::Table, std::allocator<opossum::Table>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<opossum::Table, std::allocator<opossum::Table>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<opossum::Table, std::allocator<opossum::Table>, (__gnu_cxx::_Lock_policy)2> >&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/allocated_ptr.h:97:21 (hyrisePlayground+0x24d8820)
#4 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<opossum::Table, std::allocator<opossum::Table>, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType, int, opossum::UseMvcc>(std::_Sp_make_shared_tag, opossum::Table*, std::allocator<opossum::Table> const&, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType&&, int&&, opossum::UseMvcc&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:654:19 (hyrisePlayground+0x24d86d5)
#5 std::__shared_ptr<opossum::Table, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<opossum::Table>, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType, int, opossum::UseMvcc>(std::_Sp_make_shared_tag, std::allocator<opossum::Table> const&, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType&&, int&&, opossum::UseMvcc&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:1321:14 (hyrisePlayground+0x24d8627)
#6 std::shared_ptr<opossum::Table>::shared_ptr<std::allocator<opossum::Table>, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType, int, opossum::UseMvcc>(std::_Sp_make_shared_tag, std::allocator<opossum::Table> const&, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType&&, int&&, opossum::UseMvcc&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr.h:360:4 (hyrisePlayground+0x24d8571)
#7 std::shared_ptr<opossum::Table> std::allocate_shared<opossum::Table, std::allocator<opossum::Table>, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType, int, opossum::UseMvcc>(std::allocator<opossum::Table> const&, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType&&, int&&, opossum::UseMvcc&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr.h:706:14 (hyrisePlayground+0x24d8451)
#8 std::shared_ptr<opossum::Table> std::make_shared<opossum::Table, std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType, int, opossum::UseMvcc>(std::vector<opossum::TableColumnDefinition, std::allocator<opossum::TableColumnDefinition> >&, opossum::TableType&&, int&&, opossum::UseMvcc&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr.h:722:14 (hyrisePlayground+0x24d1106)
#9 test_concurrent_updates(unsigned long, unsigned long) /home/moritz/Coding/hyrise2/src/bin/playground.cpp:38:16 (hyrisePlayground+0x24cfb87)
#10 main /home/moritz/Coding/hyrise2/src/bin/playground.cpp:24:3 (hyrisePlayground+0x24cfa39)
Mutex M2287 (0x7b0c0000a200) created at:
#0 pthread_mutex_lock <null> (hyrisePlayground+0x2447df7)
#1 __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748:12 (hyrisePlayground+0x2519673)
#2 std::mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:103:17 (hyrisePlayground+0x25225e5)
#3 std::unique_lock<std::mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:267:17 (hyrisePlayground+0x25a8fbb)
#4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:197:2 (hyrisePlayground+0x25a4bc1)
#5 opossum::Table::acquire_append_mutex() /home/moritz/Coding/hyrise2/src/lib/storage/table.cpp:194:69 (hyrisePlayground+0x345a487)
#6 opossum::Insert::_on_execute(std::shared_ptr<opossum::TransactionContext>) /home/moritz/Coding/hyrise2/src/lib/operators/insert.cpp:125:39 (hyrisePlayground+0x2c51f92)
#7 opossum::AbstractOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_operator.cpp:46:15 (hyrisePlayground+0x2b281db)
#8 opossum::AbstractReadWriteOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_read_write_operator.cpp:24:23 (hyrisePlayground+0x2b2fbd9)
#9 opossum::Update::_on_execute(std::shared_ptr<opossum::TransactionContext>) /home/moritz/Coding/hyrise2/src/lib/operators/update.cpp:51:12 (hyrisePlayground+0x3025e1a)
#10 opossum::AbstractOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_operator.cpp:46:15 (hyrisePlayground+0x2b281db)
#11 opossum::AbstractReadWriteOperator::execute() /home/moritz/Coding/hyrise2/src/lib/operators/abstract_read_write_operator.cpp:24:23 (hyrisePlayground+0x2b2fbd9)
#12 test_concurrent_updates(unsigned long, unsigned long)::$_1::operator()(unsigned long) const /home/moritz/Coding/hyrise2/src/bin/playground.cpp:67:15 (hyrisePlayground+0x24d06b2)
#13 test_concurrent_updates(unsigned long, unsigned long)::$_2::operator()() const /home/moritz/Coding/hyrise2/src/bin/playground.cpp:81:44 (hyrisePlayground+0x24d042a)
#14 void std::__invoke_impl<void, test_concurrent_updates(unsigned long, unsigned long)::$_2>(std::__invoke_other, test_concurrent_updates(unsigned long, unsigned long)::$_2&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:60:14 (hyrisePlayground+0x24d03dd)
#15 std::__invoke_result<test_concurrent_updates(unsigned long, unsigned long)::$_2>::type std::__invoke<test_concurrent_updates(unsigned long, unsigned long)::$_2>(test_concurrent_updates(unsigned long, unsigned long)::$_2&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:95:14 (hyrisePlayground+0x24d034d)
#16 _ZNSt6thread8_InvokerISt5tupleIJZ23test_concurrent_updatesmmE3$_2EEE9_M_invokeIJLm0EEEEDTclsr3stdE8__invokespcl10_S_declvalIXT_EEEEESt12_Index_tupleIJXspT_EEE /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:234:13 (hyrisePlayground+0x24d0315)
#17 std::thread::_Invoker<std::tuple<test_concurrent_updates(unsigned long, unsigned long)::$_2> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:243:11 (hyrisePlayground+0x24d02d5)
#18 std::thread::_State_impl<std::thread::_Invoker<std::tuple<test_concurrent_updates(unsigned long, unsigned long)::$_2> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/thread:186:13 (hyrisePlayground+0x24d0199)
#19 <null> <null> (libstdc++.so.6+0xbd57e)
Thread T1 (tid=14584, running) created by main thread at:
#0 pthread_create <null> (hyrisePlayground+0x243b326)
#1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xbd834)
#2 test_concurrent_updates(unsigned long, unsigned long) /home/moritz/Coding/hyrise2/src/bin/playground.cpp:81:26 (hyrisePlayground+0x24cfc79)
#3 main /home/moritz/Coding/hyrise2/src/bin/playground.cpp:24:3 (hyrisePlayground+0x24cfa39)
Thread T2 (tid=14585, running) created by main thread at:
#0 pthread_create <null> (hyrisePlayground+0x243b326)
#1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xbd834)
#2 test_concurrent_updates(unsigned long, unsigned long) /home/moritz/Coding/hyrise2/src/bin/playground.cpp:81:26 (hyrisePlayground+0x24cfc79)
#3 main /home/moritz/Coding/hyrise2/src/bin/playground.cpp:24:3 (hyrisePlayground+0x24cfa39)
SUMMARY: ThreadSanitizer: data race /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/vector.tcc:471:30 in void std::vector<std::shared_ptr<opossum::Chunk>, std::allocator<std::shared_ptr<opossum::Chunk> > >::_M_realloc_insert<std::shared_ptr<opossum::Chunk> >(__gnu_cxx::__normal_iterator<std::shared_ptr<opossum::Chunk>*, std::vector<std::shared_ptr<opossum::Chunk>, std::allocator<std::shared_ptr<opossum::Chunk> > > >, std::shared_ptr<opossum::Chunk>&&)
==================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment