Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCPListener Conn leak on RST receive #25

Open
soypat opened this issue Jun 27, 2024 · 1 comment
Open

TCPListener Conn leak on RST receive #25

soypat opened this issue Jun 27, 2024 · 1 comment

Comments

@soypat
Copy link
Owner

soypat commented Jun 27, 2024

As title suggests, a TCPListener connection resource is lost on a correct RST receive due to how initiating SYN packets are handled. This bug yields the following characteristic log messages (if your log level is not low enough you may only see the last message)

time=1970-01-01T00:18:54.865Z level=DEBUG msg=rcv:RST state=SynRcvd
time=1970-01-01T00:18:54.866Z level=DEBUG-2 msg=tcb:rcv.reject state=Listen rcv.nxt=203488617 rcv.wnd=2030 challenge=false
time=1970-01-01T00:18:54.899Z level=DEBUG-2 msg=tcb:rcv.reject seg.seq=3076528933 seg.ack=0 seg.wnd=0 seg.flags=[RST] seg.data=0
time=1970-01-01T00:18:54.900Z level=ERROR msg=tcb:rcv.reject err="drop segment"

followed by many msg=TCPConn.recv:start and no detailed prints on what is being received via TCP on that connection.

@soypat
Copy link
Owner Author

soypat commented Oct 24, 2024

This issue can be circumvented by using a TCPConn directly to receive data instead of a TCPListener. See https://github.com/soypat/cyw43439/blob/main/examples/tcpserver/main.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant