Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEGV in the test framework #1904

Closed
whatsthecraic opened this issue Apr 6, 2020 · 1 comment
Closed

SEGV in the test framework #1904

whatsthecraic opened this issue Apr 6, 2020 · 1 comment

Comments

@whatsthecraic
Copy link

Hi there,
I'm hitting a spurious SEGV in a multithreaded test, but, at this point, I'm not sure whether this depends by my program or by the test framework:

Thread 32 "test_parallel" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff4cab700 (LWP 9574)]
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string (this=0x58, __in_chrg=<optimized out>) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:658
658	/build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h: No such file or directory.
(gdb) bt
#0  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string (this=0x58, __in_chrg=<optimized out>) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:658
#1  0x00005555555a4178 in Catch::AssertionResultData::~AssertionResultData (this=0x38, __in_chrg=<optimized out>) at ../tests/catch.hpp:5322
#2  0x00005555555aa7b6 in Catch::AssertionResult::~AssertionResult (this=0x0, __in_chrg=<optimized out>) at ../tests/catch.hpp:5336
#3  0x00005555555c459d in Catch::Option<Catch::AssertionResult>::reset (this=0x7fffffffde88) at ../tests/catch.hpp:4385
#4  0x00005555555b49bd in Catch::Option<Catch::AssertionResult>::operator= (this=0x7fffffffde88, _value=...) at ../tests/catch.hpp:4378
#5  0x000055555557a578 in Catch::RunContext::assertionEnded (this=0x7fffffffde40, result=...) at ../tests/catch.hpp:12597
#6  0x000055555557c333 in Catch::RunContext::handleNonExpr (this=0x7fffffffde40, info=..., resultType=Catch::ResultWas::Ok, reaction=...) at ../tests/catch.hpp:12924
#7  0x000055555556bb8c in Catch::AssertionHandler::handleExceptionThrownAsExpected (this=0x7ffff4caad60) at ../tests/catch.hpp:8201
#8  0x0000555555594cda in <lambda(uint64_t)>::operator()(uint64_t) const (__closure=0x5555556beb20, vertex_id=70) at ../tests/test_parallel.cpp:131
#9  0x00005555555a2f71 in std::__invoke_impl<void, ____C_A_T_C_H____T_E_S_T____2()::<lambda(uint64_t)>, long unsigned int>(std::__invoke_other, <lambda(uint64_t)> &&) (__f=...) at /usr/include/c++/9.3.0/bits/invoke.h:60
#10 0x00005555555a2e9a in std::__invoke<____C_A_T_C_H____T_E_S_T____2()::<lambda(uint64_t)>, long unsigned int>(<lambda(uint64_t)> &&) (__fn=...) at /usr/include/c++/9.3.0/bits/invoke.h:95
#11 0x00005555555a2a63 in std::thread::_Invoker<std::tuple<____C_A_T_C_H____T_E_S_T____2()::<lambda(uint64_t)>, long unsigned int> >::_M_invoke<0, 1>(std::_Index_tuple<0, 1>) (this=0x5555556beb18) at /usr/include/c++/9.3.0/thread:244
#12 0x00005555555a1e12 in std::thread::_Invoker<std::tuple<____C_A_T_C_H____T_E_S_T____2()::<lambda(uint64_t)>, long unsigned int> >::operator()(void) (this=0x5555556beb18) at /usr/include/c++/9.3.0/thread:251
#13 0x00005555555a162a in std::thread::_State_impl<std::thread::_Invoker<std::tuple<____C_A_T_C_H____T_E_S_T____2()::<lambda(uint64_t)>, long unsigned int> > >::_M_run(void) (this=0x5555556beb10) at /usr/include/c++/9.3.0/thread:195
#14 0x00007ffff7d0cb24 in std::execute_native_thread_routine (__p=0x5555556beb10) at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
#15 0x00007ffff7e3146f in start_thread () from /usr/lib/libpthread.so.0
#16 0x00007ffff7a163d3 in clone () from /usr/lib/libc.so.6
(gdb) info threads 
  Id   Target Id                                        Frame 
  1    Thread 0x7ffff76b2780 (LWP 9540) "test_parallel" 0x00007ffff7e32a67 in __pthread_clockjoin_ex () from /usr/lib/libpthread.so.0
  25   Thread 0x7ffff76b1700 (LWP 9567) "Teseo.GC"      0x00007ffff79de2d1 in clock_nanosleep@GLIBC_2.2.5 () from /usr/lib/libc.so.6
  26   Thread 0x7ffff6eb0700 (LWP 9568) "Teseo.TcTimer" 0x00007ffff7a1670e in epoll_wait () from /usr/lib/libc.so.6
  27   Thread 0x7fffde7fc700 (LWP 9569) "test_parallel" 0x00007ffff7cdf881 in base_of_encoded_value (encoding=<optimized out>, context=0x0) at /build/gcc/src/gcc/libstdc++-v3/../libgcc/unwind-pe.h:118
  28   Thread 0x7fffdeffd700 (LWP 9570) "test_parallel" 0x00007ffff7e3b4cf in __lll_lock_wait () from /usr/lib/libpthread.so.0
  29   Thread 0x7ffff64ae700 (LWP 9571) "test_parallel" 0x00007ffff7e3b4cf in __lll_lock_wait () from /usr/lib/libpthread.so.0
  30   Thread 0x7ffff5cad700 (LWP 9572) "test_parallel" 0x00007ffff7e3b4cf in __lll_lock_wait () from /usr/lib/libpthread.so.0
  31   Thread 0x7ffff54ac700 (LWP 9573) "test_parallel" std::_Head_base<1ul, bool&, false>::_M_head (__b=...) at /usr/include/c++/9.3.0/tuple:160
* 32   Thread 0x7ffff4cab700 (LWP 9574) "test_parallel" std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string (this=0x58, __in_chrg=<optimized out>)
    at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:658
  33   Thread 0x7fffdffff700 (LWP 9575) "test_parallel" 0x00007ffff7f766bc in teseo::internal::context::ScopedEpoch::ScopedEpoch (this=0x7fffdfffead6) at ../src/context/scoped_epoch.cpp:26
  34   Thread 0x7fffdf7fe700 (LWP 9576) "test_parallel" 0x00007ffff7e3b4cf in __lll_lock_wait () from /usr/lib/libpthread.so.0
  35   Thread 0x7fffddffb700 (LWP 9577) "test_parallel" 0x00007ffff7e3b4cf in __lll_lock_wait () from /usr/lib/libpthread.so.0
  36   Thread 0x7fffdd7fa700 (LWP 9578) "test_parallel" 0x00007ffff7e3b4cf in __lll_lock_wait () from /usr/lib/libpthread.so.0
  37   Thread 0x7fffdcff9700 (LWP 9579) "test_parallel" 0x00007ffff7e3b4cf in __lll_lock_wait () from /usr/lib/libpthread.so.0
  38   Thread 0x7fffcffff700 (LWP 9580) "test_parallel" 0x00007ffff7f82d9e in teseo::internal::memstore::Index::Node::prefix_compare (this=0x7fffc0082100, search_key=..., search_key_level=@0x7fffcfffe804: 4)
    at ../src/memstore/index.cpp:863
  39   Thread 0x7fffcf7fe700 (LWP 9581) "test_parallel" 0x00007ffff7e3b4cf in __lll_lock_wait () from /usr/lib/libpthread.so.0
  40   Thread 0x7fffceffd700 (LWP 9582) "test_parallel" 0x00007ffff7aec2bb in uw_frame_state_for (context=0x7fffceffc5e0, fs=0x7fffceffc6d0) at /build/gcc/src/gcc/libgcc/unwind-dw2.c:1250
  41   Thread 0x7fffce7fc700 (LWP 9583) "test_parallel" teseo::internal::context::ScopedEpoch::ScopedEpoch (this=0x7fffce7fbaff) at ../src/context/scoped_epoch.cpp:24
  42   Thread 0x7fffcdffb700 (LWP 9584) "test_parallel" std::__shared_ptr_access<teseo::internal::context::ThreadContext, (__gnu_cxx::_Lock_policy)2, false, false>::operator-> (this=0x7fffaff8f000)
    at /usr/include/c++/9.3.0/bits/shared_ptr_base.h:1015

The incriminated code is: REQUIRE_THROWS(tx.get_weight(vertex_id, 10));

Linux, GCC v9.3.0, Catch v2.11.1

@horenmar
Copy link
Member

As per documentation, multiple threads touching sections/assertions is not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants