I am trying to run my program and once in a few runs I get an error:
terminate called after throwing an instance of 'std::system_error'
what(): Operation not permitted
My code is available here: https://github.com/Qabrt/turnstiles
gdb outputs:
Thread 31 "trivial_test" received signal SIGABRT, Aborted.
[Switching to thread 31 (Thread 0x7fff8a7fc700 (LWP 8716))]
#0 0x00007ffff6e7f83b in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff6e7f83b in raise () from /lib64/libc.so.6
#1 0x00007ffff6e81081 in abort () from /lib64/libc.so.6
#2 0x00007ffff78670e5 in __gnu_cxx::__verbose_terminate_handler ()
at /var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libstdc++-v3/libsupc++/vterminate.cc:95
#3 0x00007ffff7864cb6 in __cxxabiv1::__terminate (handler=<optimized out>)
at /var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4 0x00007ffff7864d01 in std::terminate ()
at /var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5 0x00007ffff789243f in std::execute_native_thread_routine (__p=0x555555790f80)
at /var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0/libstdc++-v3/src/c++11/thread.cc:91
#6 0x00007ffff7bbd96a in start_thread () from /lib64/libpthread.so.0
#7 0x00007ffff6f4d11f in clone () from /lib64/libc.so.6
g++ --version
g++ (Gentoo 7.3.0-r3 p1.4) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I am compiling with -lpthread flag:
/usr/bin/c++ -Wall -Wunused-function -Wwrite-strings -Wformat -Wformat-security -Wparentheses -Wsequence-point -Wno-system-headers -Werror -Winit-self -g -O0 -fstack-protector-all -D_GLIBXX_DEBUG -D_GLIBXX_DEBUG_PEDANTIC -rdynamic CMakeFiles/trivial_test.dir/trivial_test.cpp.o -o trivial_test ../libturnstile_lib.a -lpthread
How can I get more info about the problem?