I've encountered a seg fault connection_zk::get. It seems to be attempting to get the future from a promise after the promise has been destroyed.
`#0 0x000055ee5976e19c in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x55ee5ad3fed0)
at /usr/include/c++/7/bits/shared_ptr_base.h:154
1 0x00007ff4db1e5c01 in std::shared_count<(__gnu_cxx::_Lock_policy)2>::~shared_count (this=0x7ffe0a1dcdd8,
__in_chrg=<optimized out>) at /usr/include/c++/7/bits/shared_ptr_base.h:684
at /root/zookeeper-cpp/src/zk/connection_zk.cpp:38
9 zk::connection_zk::get (this=0x7ff4c0002d10, path=...) at /root/zookeeper-cpp/src/zk/connection_zk.cpp:359
10 0x00007ff4db1cbfcd in zk::client::get (this=, path=...)
at /root/zookeeper-cpp/src/zk/client.cpp:79
11 0x000055ee59b0c427 in stateless::config::get_entry (db=...,
path="/stateless/user/3005d1d2-0bc2-6494-e6f0-d257aaf5cf8f", formats=...)
at ../src/stateless/config/client.cpp:95
12 0x000055ee59b0917c in stateless::config::client::get_user (this=0x7ff4c0003b50, id=...)
at ../src/stateless/config/client.cpp:373
13 0x000055ee59b07ba6 in stateless::config::client::create_endpoint (this=0x7ff4c0003b50, endpoint=...)
at ../src/stateless/config/client.cpp:250
14 0x000055ee599a7123 in stateless::config::test_configuration::make_basic (db=...)
at ../src/stateless/config/tests/test_configuration.cpp:91
15 0x000055ee599a203b in stateless::config::configured_fixture::setup (this=0x55ee5ad30300)
at ../src/stateless/config/tests/configured_fixture.cpp:51
16 0x000055ee599d93c6 in stateless::kv::fixture::setup (this=0x55ee5ad30300)
at ../src/stateless/kv/tests/fixture.ipp:42
17 0x000055ee599f1485 in stateless::dataplane::packet_match_connection_tracking_tests::packet_match_connection_tracking_tests::setup (this=0x55ee5ad30300) at ../src/stateless/dataplane/packet_match_tests.cpp:485
---Type to continue, or q to quit---
18 0x000055ee59a44a1c in stateless::test::test_fixture::SetUp (this=0x55ee5ad30300)
at ../src/stateless/tests/test.cpp:134
19 0x00007ff4db742d65 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (
object=0x55ee5ad30300, method=&virtual testing::Test::SetUp(), location=0x7ff4db753d8b "SetUp()")
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:2402
20 0x00007ff4db73c856 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (
object=0x55ee5ad30300, method=&virtual testing::Test::SetUp(), location=0x7ff4db753d8b "SetUp()")
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:2438
21 0x00007ff4db720669 in testing::Test::Run (this=0x55ee5ad30300)
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:2470
22 0x00007ff4db720f40 in testing::TestInfo::Run (this=0x55ee5ad21660)
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:2656
23 0x00007ff4db721597 in testing::TestCase::Run (this=0x55ee5ad20080)
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:2774
24 0x00007ff4db728111 in testing::internal::UnitTestImpl::RunAllTests (this=0x55ee5acf1880)
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:4649
25 0x00007ff4db743eef in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x55ee5acf1880,
method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7ff4db727e4e <testing::internal::UnitTestImpl::RunAllTests()>,
location=0x7ff4db7545d0 "auxiliary test code (environments or event listeners)")
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:2402
26 0x00007ff4db73d712 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x55ee5acf1880,
method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7ff4db727e4e <testing::internal::UnitTestImpl::RunAllTests()>,
location=0x7ff4db7545d0 "auxiliary test code (environments or event listeners)")
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:2438
27 0x00007ff4db726de8 in testing::UnitTest::Run (this=0x7ff4db779c20 <testing::UnitTest::GetInstance()::instance>)
at generated/external/gtest-1.8.0/googletest/src/../src/gtest.cc:4257
28 0x000055ee59765252 in RUN_ALL_TESTS () at generated/external/gtest-1.8.0/googletest/include/gtest/gtest.h:2233
29 0x000055ee59764098 in main (argc=1, argv=0x7ffe0a1de128) at ../src/stateless/tests/main.cpp:44`
This is a general problem with all ZK results which make a server round trip before the local thread gets to the next line. It's rare, but definitely a problem.
I've encountered a seg fault
connection_zk::get
. It seems to be attempting to get the future from a promise after the promise has been destroyed.`#0 0x000055ee5976e19c in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x55ee5ad3fed0) at /usr/include/c++/7/bits/shared_ptr_base.h:154
1 0x00007ff4db1e5c01 in std::shared_count<(__gnu_cxx::_Lock_policy)2>::~shared_count (this=0x7ffe0a1dcdd8,
2 std::shared_ptr<std::__future_base::_State_baseV2, (gnu_cxx::_Lock_policy)2>::~__shared_ptr (
3 std::shared_ptr::~shared_ptr (this=0x7ffe0a1dcdd0,
4 std::basic_future:: basic_future (
5 std::future::future (
6 std::promise::get_future (this=) at /usr/include/c++/7/future:1105
7 zk::connection_zk::<lambda(zk::ptr)>::operator() (
8 zk::with_str<zk::connection_zk::get(zk::string_view)::<lambda(zk::ptr)> > (action=..., src=...)
9 zk::connection_zk::get (this=0x7ff4c0002d10, path=...) at /root/zookeeper-cpp/src/zk/connection_zk.cpp:359
10 0x00007ff4db1cbfcd in zk::client::get (this=, path=...)
11 0x000055ee59b0c427 in stateless::config::get_entry (db=...,
12 0x000055ee59b0917c in stateless::config::client::get_user (this=0x7ff4c0003b50, id=...)
13 0x000055ee59b07ba6 in stateless::config::client::create_endpoint (this=0x7ff4c0003b50, endpoint=...)
14 0x000055ee599a7123 in stateless::config::test_configuration::make_basic (db=...)
15 0x000055ee599a203b in stateless::config::configured_fixture::setup (this=0x55ee5ad30300)
16 0x000055ee599d93c6 in stateless::kv::fixture::setup (this=0x55ee5ad30300)
17 0x000055ee599f1485 in stateless::dataplane::packet_match_connection_tracking_tests::packet_match_connection_tracking_tests::setup (this=0x55ee5ad30300) at ../src/stateless/dataplane/packet_match_tests.cpp:485
---Type to continue, or q to quit---
18 0x000055ee59a44a1c in stateless::test::test_fixture::SetUp (this=0x55ee5ad30300)
19 0x00007ff4db742d65 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (
20 0x00007ff4db73c856 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (
21 0x00007ff4db720669 in testing::Test::Run (this=0x55ee5ad30300)
22 0x00007ff4db720f40 in testing::TestInfo::Run (this=0x55ee5ad21660)
23 0x00007ff4db721597 in testing::TestCase::Run (this=0x55ee5ad20080)
24 0x00007ff4db728111 in testing::internal::UnitTestImpl::RunAllTests (this=0x55ee5acf1880)
25 0x00007ff4db743eef in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x55ee5acf1880,
26 0x00007ff4db73d712 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x55ee5acf1880,
27 0x00007ff4db726de8 in testing::UnitTest::Run (this=0x7ff4db779c20 <testing::UnitTest::GetInstance()::instance>)
28 0x000055ee59765252 in RUN_ALL_TESTS () at generated/external/gtest-1.8.0/googletest/include/gtest/gtest.h:2233
29 0x000055ee59764098 in main (argc=1, argv=0x7ffe0a1de128) at ../src/stateless/tests/main.cpp:44`