```
2021.06.29 15:33:35.465543 [ 1217 ] {} <Fatal> BaseDaemon: ########################################
2021.06.29 15:33:35.465927 [ 1217 ] {} <Fatal> BaseDaemon: (version 21.7.1.1, build id: D81B42454FD6D582368906119A9E1D413BF97F04) (from thread 54464) (no query) Received signal Aborted (6)
2021.06.29 15:33:35.466168 [ 1217 ] {} <Fatal> BaseDaemon: 
2021.06.29 15:33:35.466367 [ 1217 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f081a8aa18b 0x7f081a889859 0x99cd809 0x15910619 0x15913cf5 0x15917b78 0x15917b3d 0x15917ae1 0x159179f2 0x159178e7 0x159177fd 0x159177bd 0x15917795 0x15917760 0x99cb049 0x99ca175 0x9a2ad0e 0x9a31ea4 0x9a31dfd 0x9a31d25 0x9a31642 0x7f081aa70609 0x7f081a986103
2021.06.29 15:33:35.468194 [ 1217 ] {} <Fatal> BaseDaemon: 4. /build/glibc-YYA7BZ/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51: raise @ 0x4618b in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
2021.06.29 15:33:35.473831 [ 1217 ] {} <Fatal> BaseDaemon: 5. /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81: abort @ 0x25859 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
2021.06.29 15:33:35.781159 [ 1217 ] {} <Fatal> BaseDaemon: 6. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ThreadPool.h:0: ThreadFromGlobalPool::join() @ 0x99cd809 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:35.989815 [ 1217 ] {} <Fatal> BaseDaemon: 7. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ZooKeeper/ZooKeeperImpl.cpp:855: Coordination::ZooKeeper::finalize(bool, bool) @ 0x15910619 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:36.196407 [ 1217 ] {} <Fatal> BaseDaemon: 8. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ZooKeeper/ZooKeeperImpl.cpp:662: Coordination::ZooKeeper::receiveThread() @ 0x15913cf5 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:36.425076 [ 1217 ] {} <Fatal> BaseDaemon: 9. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ZooKeeper/ZooKeeperImpl.cpp:348: Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1::operator()() const @ 0x15917b78 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:36.648686 [ 1217 ] {} <Fatal> BaseDaemon: 10. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/type_traits:3682: decltype(std::__1::forward<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&>(fp)()) std::__1::__invoke_constexpr<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&) @ 0x15917b3d in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:36.872204 [ 1217 ] {} <Fatal> BaseDaemon: 11. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/tuple:1415: decltype(auto) std::__1::__apply_tuple_impl<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&, std::__1::tuple<>&>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&, std::__1::tuple<>&, std::__1::__tuple_indices<>) @ 0x15917ae1 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:37.094658 [ 1217 ] {} <Fatal> BaseDaemon: 12. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/tuple:1424: decltype(auto) std::__1::apply<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&, std::__1::tuple<>&>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&, std::__1::tuple<>&) @ 0x159179f2 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:37.314470 [ 1217 ] {} <Fatal> BaseDaemon: 13. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ThreadPool.h:182: ThreadFromGlobalPool::ThreadFromGlobalPool<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&&)::'lambda'()::operator()() @ 0x159178e7 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:37.543417 [ 1217 ] {} <Fatal> BaseDaemon: 14. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/type_traits:3676: decltype(std::__1::forward<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&&)::'lambda'()&>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&&) @ 0x159177fd in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:37.765759 [ 1217 ] {} <Fatal> BaseDaemon: 15. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/__functional_base:349: void std::__1::__invoke_void_return_wrapper<void>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&&)::'lambda'()&>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&&...) @ 0x159177bd in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:37.984789 [ 1217 ] {} <Fatal> BaseDaemon: 16. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:1608: std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&&)::'lambda'(), void ()>::operator()() @ 0x15917795 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:38.207903 [ 1217 ] {} <Fatal> BaseDaemon: 17. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:2089: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1>(Coordination::ZooKeeper::ZooKeeper(std::__1::vector<Coordination::ZooKeeper::Node, std::__1::allocator<Coordination::ZooKeeper::Node> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Timespan, Poco::Timespan, Poco::Timespan)::$_1&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0x15917760 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:38.466300 [ 1217 ] {} <Fatal> BaseDaemon: 18. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:2221: std::__1::__function::__policy_func<void ()>::operator()() const @ 0x99cb049 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:38.715619 [ 1217 ] {} <Fatal> BaseDaemon: 19. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:2560: std::__1::function<void ()>::operator()() const @ 0x99ca175 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:38.802943 [ 1217 ] {} <Fatal> BaseDaemon: 20. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ThreadPool.cpp:266: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x9a2ad0e in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:38.902628 [ 1217 ] {} <Fatal> BaseDaemon: 21. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ThreadPool.cpp:136: void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()::operator()() const @ 0x9a31ea4 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:38.997773 [ 1217 ] {} <Fatal> BaseDaemon: 22. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/type_traits:3676: decltype(std::__1::forward<void>(fp)(std::__1::forward<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(fp0)...)) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()&&...) @ 0x9a31dfd in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:39.091823 [ 1217 ] {} <Fatal> BaseDaemon: 23. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/thread:281: void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>&, std::__1::__tuple_indices<>) @ 0x9a31d25 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:39.185721 [ 1217 ] {} <Fatal> BaseDaemon: 24. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/thread:291: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) @ 0x9a31642 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
2021.06.29 15:33:39.185974 [ 1217 ] {} <Fatal> BaseDaemon: 25. start_thread @ 0x9609 in /lib/x86_64-linux-gnu/libpthread-2.31.so
2021.06.29 15:33:39.186476 [ 1217 ] {} <Fatal> BaseDaemon: 26. /build/glibc-YYA7BZ/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97: __GI___clone @ 0x122103 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
2021.06.29 15:33:41.682519 [ 1217 ] {} <Fatal> BaseDaemon: Calculated checksum of the binary: 1CD0B6327A590862799A5EBCDC8723CB. There is no information about the reference checksum.
```
{
    int32_t handshake_length;
    int32_t protocol_version_read;
    int32_t timeout;
    std::array<char, PASSWORD_LENGTH> passwd;
    read(handshake_length);
    if (handshake_length != SERVER_HANDSHAKE_LENGTH)
        throw Exception("Unexpected handshake length received: " + DB::toString(handshake_length), Error::ZMARSHALLINGERROR);
    read(protocol_version_read);
    if (protocol_version_read != ZOOKEEPER_PROTOCOL_VERSION)
        throw Exception("Unexpected protocol version: " + DB::toString(protocol_version_read), Error::ZMARSHALLINGERROR);
    read(timeout);
    if (timeout != session_timeout.totalMilliseconds())
        
        session_timeout = timeout * Poco::Timespan::MILLISECONDS;
    read(session_id);
    read(passwd);
}
void ZooKeeper::sendAuth(const String & scheme, const String & data)