From a5542f19c5c2450a685e1027c0d2d96259a28fdc Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Thu, 21 Nov 2024 12:03:55 -0800 Subject: [PATCH] netstack: more state output for the writeList panic This will help narrow down the cause, especially if it relates to sockets in a particular state e.g. in the middle of closing. PiperOrigin-RevId: 698867880 --- pkg/tcpip/transport/tcp/snd.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tcpip/transport/tcp/snd.go b/pkg/tcpip/transport/tcp/snd.go index 4d836eeea..f9fe69625 100644 --- a/pkg/tcpip/transport/tcp/snd.go +++ b/pkg/tcpip/transport/tcp/snd.go @@ -1568,7 +1568,8 @@ func (s *sender) handleRcvdSegment(rcvdSeg *segment) { // have no data, but do consume a sequence number. seg := s.writeList.Front() if seg == nil { - panic(fmt.Sprintf("invalid state: there are %d unacknowledged bytes left, but the write list is empty:\n%+v", ackLeft, s.TCPSenderState)) + panic(fmt.Sprintf("invalid state: there are %d unacknowledged bytes left, but the write list is empty:\n"+ + "TCPSenderState: %+v\nsender: %+v\nendpoint: %+v", ackLeft, s.TCPSenderState, s, s.ep)) } datalen := seg.logicalLen()