Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tcp: Fix assert in tcp::tcb::output_one
When _snd.window == 0, it is not allowed to send a tcp segment with more than 1 byte of data for zero window probe. However, it is legal to send an empty segment, even if _snd.window == 0. When a seastar tcp client connects to a tcp server: With: void do_syn_sent() { _state = SYN_SENT; _snd.syn_tx_time = clock_type::now(); + print("In do_syn_sent: _snd.window = %ld\n", _snd.window); // Send <SYN> to remote output(); } I saw: In do_syn_sent: _snd.window = 0 So the callchain is: do_syn_sent() (with a _snd.window == 0)-> output() -> get_packet() -> output_one -> get the assert client: net/tcp.hh:1691: void seastar::net::tcp<InetTraits>::tcb::output_one(bool) [with InetTraits = seastar::net::ipv4_traits]: Assertion `(_snd.window > 0) || ((_snd.window == 0) && (len == 1))' failed. $ addr2line -Cfpi -e ./client 0x000000000041fa8a 0x000000000041fb5c 0x000000000041fc13 /lib64/libpthread.so.0+0x000000000001241f /lib64/libc.so.6+0x00000000000369fa /lib64/libc.so.6+0x00000000000387ff /lib64/libc.so.6+0x000000000002f0d9 /lib64/libc.so.6+0x000000000002f151 0x00000000005d0cc7 0x00000000005d41f9 0x00000000005d46e8 0x00000000005cc2f3 0x00000000005a7ad0 0x00000000005a7bfb 0x000000000052c3b2 0x000000000052d752 0x000000000041a814 0x000000000046b47e 0x00000000004fb9f2 0x00000000004fc642 0x0000000000418e1d /lib64/libc.so.6+0x0000000000020889 0x0000000000418fc9 seastar::backtrace_buffer::append_backtrace() at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:378 (inlined by) print_with_backtrace at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:399 seastar::print_with_backtrace(char const*) at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:406 sigabrt_action at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:3914 (inlined by) operator() at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:3896 (inlined by) _FUN at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:3892 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 seastar::net::tcp<seastar::net::ipv4_traits>::tcb::output_one(bool) at /home/asias/src/cloudius-systems/scylla/seastar/net/tcp.hh:1691 (discriminator 2) seastar::net::tcp<seastar::net::ipv4_traits>::tcb::get_packet() at /home/asias/src/cloudius-systems/scylla/seastar/net/tcp.hh:2046 (inlined by) seastar::net::tcp<seastar::net::ipv4_traits>::tcp(seastar::net::ipv4_l4<(seastar::net::ip_protocol_num)6>&)::{lambda()#2}::operator()() at /home/asias/src/cloudius-systems/scylla/seastar/net/tcp.hh:770 std::_Function_handler<std::experimental::fundamentals_v1::optional<seastar::net::ipv4_traits::l4packet> (), seastar::net::tcp<seastar::net::ipv4_traits>::tcp(seastar::net::ipv4_l4<(seastar::net::ip_protocol_num)6>&)::{lambda()#2}>::_M_invoke(std::_Any_data const&) at /usr/include/c++/7/bits/std_function.h:302 std::function<std::experimental::fundamentals_v1::optional<seastar::net::ipv4_traits::l4packet> ()>::operator()() const at /usr/include/c++/7/bits/std_function.h:706 (inlined by) seastar::net::ipv4_l4<(seastar::net::ip_protocol_num)6>::register_packet_provider(std::function<std::experimental::fundamentals_v1::optional<seastar::net::ipv4_traits::l4packet> ()>)::{lambda()#1}::operator()() const at /home/asias/src/cloudius-systems/scylla/seastar/net/ip.hh:424 (inlined by) std::_Function_handler<std::experimental::fundamentals_v1::optional<seastar::net::ipv4_traits::l4packet> (), seastar::net::ipv4_l4<(seastar::net::ip_protocol_num)6>::register_packet_provider(std::function<std::experimental::fundamentals_v1::optional<seastar::net::ipv4_traits::l4packet> ()>)::{lambda()#1}>::_M_invoke(std::_Any_data const&) at /usr/include/c++/7/bits/std_function.h:302 std::function<std::experimental::fundamentals_v1::optional<seastar::net::ipv4_traits::l4packet> ()>::operator()() const at /usr/include/c++/7/bits/std_function.h:706 (inlined by) seastar::net::ipv4::get_packet() at /home/asias/src/cloudius-systems/scylla/seastar/net/ip.cc:302 operator() at /home/asias/src/cloudius-systems/scylla/seastar/net/ip.cc:54 (inlined by) _M_invoke at /usr/include/c++/7/bits/std_function.h:302 std::function<std::experimental::fundamentals_v1::optional<seastar::net::l3_protocol::l3packet> ()>::operator()() const at /usr/include/c++/7/bits/std_function.h:706 (inlined by) operator() at /home/asias/src/cloudius-systems/scylla/seastar/net/net.cc:246 (inlined by) _M_invoke at /usr/include/c++/7/bits/std_function.h:302 std::function<std::experimental::fundamentals_v1::optional<seastar::net::packet> ()>::operator()() const at /usr/include/c++/7/bits/std_function.h:706 (inlined by) seastar::net::qp::poll_tx() at /home/asias/src/cloudius-systems/scylla/seastar/net/net.cc:68 (inlined by) operator() at /home/asias/src/cloudius-systems/scylla/seastar/net/net.cc:89 (inlined by) poll at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.hh:1147 seastar::reactor::poll_once() at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:3254 (inlined by) operator() at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:3150 (inlined by) _M_invoke at /usr/include/c++/7/bits/std_function.h:302 std::function<bool ()>::operator()() const at /usr/include/c++/7/bits/std_function.h:706 (inlined by) seastar::reactor::run() at /home/asias/src/cloudius-systems/scylla/seastar/core/reactor.cc:3175 seastar::app_template::run_deprecated(int, char**, std::function<void ()>&&) at /home/asias/src/cloudius-systems/scylla/seastar/core/app-template.cc:185 seastar::app_template::run(int, char**, std::function<seastar::future<int> ()>&&) at /home/asias/src/cloudius-systems/scylla/seastar/core/app-template.cc:113 main at /home/asias/src/cloudius-systems/scylla/seastar/seastar_example_from_shanshanpt/client.cc:167 Message-Id: <5b6fddc098a1c936dd7c6833e33059d0264bb3b7.1526611968.git.asias@scylladb.com>
- Loading branch information