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
This commit is contained in:
Kevin Krakauer
2024-11-21 12:07:37 -08:00
committed by gVisor bot
parent 0752ab653e
commit a5542f19c5
+2 -1
View File
@@ -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()