Open matwey opened 8 years ago
When configured with --enable-optimizer on x86_64 platform
--enable-optimizer
> gdb ./test_connect GNU gdb (GDB; devel:gcc) 7.8.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-suse-linux". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://bugs.opensuse.org/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... warning: /etc/gdbinit.d/gdb-heap.py: Нет такого файла или каталога Reading symbols from ./test_connect...done. (gdb) run Starting program: /home/matwey/lab/eixx/test/.libs/test_connect Missing separate debuginfos, use: zypper install glibc-debuginfo-2.19-16.15.1.x86_64 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Running 2 test cases... [New Thread 0x7ffff54fd700 (LWP 14952)] [New Thread 0x7ffff4cfc700 (LWP 14953)] [New Thread 0x7ffff44fb700 (LWP 14954)] [New Thread 0x7ffff3cfa700 (LWP 14955)] [Thread 0x7ffff54fd700 (LWP 14952) exited] [Thread 0x7ffff44fb700 (LWP 14954) exited] [Thread 0x7ffff3cfa700 (LWP 14955) exited] [Thread 0x7ffff4cfc700 (LWP 14953) exited] Program received signal SIGSEGV, Segmentation fault. 0x000000000040d976 in operator() (v=<optimized out>, ec=..., __closure=0x419cd9) at test_async_queue.cpp:159 159 [&abort] (int& v, const boost::system::error_code& ec) { return !abort; }, Missing separate debuginfos, use: zypper install libgcc_s1-debuginfo-4.8.3+r212056-2.2.4.x86_64 libstdc++6-debuginfo-4.8.3+r212056-2.2.4.x86_64 (gdb) bt #0 0x000000000040d976 in operator() (v=<optimized out>, ec=..., __closure=0x419cd9) at test_async_queue.cpp:159 #1 std::_Function_handler<bool(int&, const boost::system::error_code&), test_async_queue_concurrent::test_method()::__lambda9>::_M_invoke(const std::_Any_data &, int &, const boost::system::error_code &) (__functor=..., __args#0=@0x7fffffffd0e0: 4212224, __args#1=...) at /usr/include/c++/4.8/functional:2057 #2 0x0000000000418fc2 in eixx::util::async_queue<int, std::allocator<char> >::process_queue(std::function<bool (int&, boost::system::error_code const&)> const&, boost::system::error_code const&, std::chrono::duration<long, std::ratio<1l, 1000l> >, int) (this=0x62d780, h=..., ec=..., repeat=..., repeat_count=2147483647) at ./../include/eixx/util/async_queue.hpp:109 #3 0x000000000041968d in operator() (repeat_count=<optimized out>, repeat=..., ec=..., h=..., this=<optimized out>) at ./../include/eixx/util/async_queue.hpp:132 #4 operator() (e=..., __closure=0x7fffffffd200) at ./../include/eixx/util/async_queue.hpp:222 #5 operator() (this=0x7fffffffd200) at /usr/include/boost/asio/detail/bind_handler.hpp:47 #6 asio_handler_invoke<boost::asio::detail::binder1<eixx::util::async_queue<T, Alloc>::async_dequeue(const async_handler&, std::chrono::milliseconds, int) [with T = int; Alloc = std::allocator<char>; eixx::util::async_queue<T, Alloc>::async_handler = std::function<bool(int&, const boost::system::error_code&)>; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]::__lambda3, boost::system::error_code> > ( function=...) at /usr/include/boost/asio/handler_invoke_hook.hpp:69 #7 invoke<boost::asio::detail::binder1<eixx::util::async_queue<T, Alloc>::async_dequeue(const async_handler&, std::chrono::milliseconds, int) [with T = int; Alloc = std::allocator<char>; eixx::util::async_queue<T, Alloc>::async_handler = std::function<bool(int&, const boost::system::error_code&)>; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]::__lambda3, boost::system::error_code>, eixx::util::async_queue<T, Alloc>::async_dequeue(const async_handler&, std::chrono::milliseconds, int) [with T = int; Alloc = std::allocator<char>; eixx::util::async_queue<T, Alloc>::async_handler = std::function<bool(int&, const boost::system::error_code&)>; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]::__lambda3> (context=..., function=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37 #8 boost::asio::detail::wait_handler<eixx::util::async_queue<int, std::allocator<char> >::async_dequeue(std::function<bool (int&, boost::system::error_code const&)> const&, std::chrono::duration<long, std::ratio<1l, 1000l> >, int)::{lambda(boost::system::error_code const&)#2}>::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) ( owner=<optimized out>, base=<optimized out>) at /usr/include/boost/asio/detail/wait_handler.hpp:70 #9 0x0000000000413a60 in complete (bytes_transferred=<optimized out>, ec=..., owner=..., this=<optimized out>) at /usr/include/boost/asio/detail/task_io_service_operation.hpp:38 #10 do_run_one (ec=..., this_thread=..., lock=..., this=0x629b00) at /usr/include/boost/asio/detail/impl/task_io_service.ipp:372 #11 boost::asio::detail::task_io_service::run (this=0x629b00, ec=...) at /usr/include/boost/asio/detail/impl/task_io_service.ipp:149 #12 0x000000000040e4d4 in boost::asio::io_service::run (this=0x7fffffffd3c0) at /usr/include/boost/asio/impl/io_service.ipp:59 #13 0x000000000040f219 in test_async_queue_concurrent::test_method (this=this@entry=0x7fffffffd68f) at test_async_queue.cpp:174 #14 0x000000000040f59e in test_async_queue_concurrent_invoker () at test_async_queue.cpp:124 #15 0x00000000004109a7 in invoke<void (*)()> (this=<optimized out>, f=<optimized out>) at /usr/include/boost/test/utils/callback.hpp:56 #16 boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke (this=<optimized out>) at /usr/include/boost/test/utils/callback.hpp:89 #17 0x00007ffff7781c71 in boost::unit_test::ut_detail::callback0_impl_t<int, boost::unit_test::(anonymous namespace)::zero_return_wrapper_t<boost::unit_test::callback0<boost::unit_test::ut_detail::unused> > >::invoke() () from /usr/lib64/libboost_unit_test_framework.so.1.58.0 ---Type <return> to continue, or q <return> to quit--- #18 0x00007ffff776c8de in boost::execution_monitor::catch_signals(boost::unit_test::callback0<int> const&) () from /usr/lib64/libboost_unit_test_framework.so.1.58.0 #19 0x00007ffff776d123 in boost::execution_monitor::execute(boost::unit_test::callback0<int> const&) () from /usr/lib64/libboost_unit_test_framework.so.1.58.0 #20 0x00007ffff7781d72 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::unit_test::test_case const&) () from /usr/lib64/libboost_unit_test_framework.so.1.58.0 #21 0x00007ffff776f1d4 in boost::unit_test::framework_impl::visit(boost::unit_test::test_case const&) () from /usr/lib64/libboost_unit_test_framework.so.1.58.0 #22 0x00007ffff779a833 in boost::unit_test::traverse_test_tree(boost::unit_test::test_suite const&, boost::unit_test::test_tree_visitor&) () from /usr/lib64/libboost_unit_test_framework.so.1.58.0 #23 0x00007ffff776e09b in boost::unit_test::framework::run(unsigned long, bool) () from /usr/lib64/libboost_unit_test_framework.so.1.58.0 #24 0x00007ffff777f954 in boost::unit_test::unit_test_main(bool (*)(), int, char**) () from /usr/lib64/libboost_unit_test_framework.so.1.58.0 #25 0x00007ffff6738b05 in __libc_start_main () from /lib64/libc.so.6 #26 0x000000000040d8a4 in _start () at ../sysdeps/x86_64/start.S:122 (gdb)
Does is not happen when optimization is disabled?
No, without optimization it does not.
When configured with
--enable-optimizer
on x86_64 platform