mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
netstack: panic early with TCP state for debugging
We've seen panics in `segment.payloadSize()` stemming from what seems to be an out of sync write list and sender state. That is, SndUna and SndNxt indicate there are unacknowledged bytes remaining, but the write list -- which contains all sent bytes until they're acknowledged -- is empty. Panic early with TCP state for debugability. PiperOrigin-RevId: 643120793
This commit is contained in:
committed by
gVisor bot
parent
447bfca733
commit
45a6d96c6a
@@ -1572,8 +1572,11 @@ func (s *sender) handleRcvdSegment(rcvdSeg *segment) {
|
||||
// segments (which are always at the end of list) that
|
||||
// have no data, but do consume a sequence number.
|
||||
seg := s.writeList.Front()
|
||||
datalen := seg.logicalLen()
|
||||
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))
|
||||
}
|
||||
|
||||
datalen := seg.logicalLen()
|
||||
if datalen > ackLeft {
|
||||
prevCount := s.pCount(seg, s.MaxPayloadSize)
|
||||
seg.TrimFront(ackLeft)
|
||||
|
||||
Reference in New Issue
Block a user