Closed hlef closed 2 weeks ago
Hi @hlef,
Thanks for reporting this issue. Please let us know if you prefer us to make a PR or if you prefer to create one since you have already figured out the cause of this bug.
Hi @tony-josi-aws I would prefer if you could handle the PR as this may take a while to reach the top of my TODO list :slightly_smiling_face:
@hlef
Closing this ticket as PR #1152 should fix this issue.
Describe the bug When the allocation of
xTCPSegments
inprvCreateSectors
fails (here), an error code is returned. However this error code is ignored by the callervTCPWindowCreate
(here - see the explicitvoid
cast). The result is a network stack that seems to correctly initialize, but fails to send packets throughFreeRTOS_send
later on.We are encountering this issue in a setting where the network stack is initialized late, and not enough memory is available to satisfy the relatively large allocation in
prvCreateSectors
.This is a very tricky issue to debug, because not all packets are impacted by this allocation failure. In our case, we perform a TLS handshake: the TCP handshake goes through, but the TLS client hello does not send because of this problem.
Target Any, AFAIK this is not a target-specific bug.
Host Same.
To Reproduce
ipconfigUSE_TCP_WIN
.xTCPSegments
inprvCreateSectors
fails (here)FreeRTOS_send
later onExpected behavior The failure of
prvCreateSectors
should be noticed byvTCPWindowCreate
, and further propagated up the call stack. This should ultimately result in the network stack failing to initialize.Screenshots N/A.
Wireshark logs In Wireshark, we observe that the TCP handshake goes through, but the client hello packet of our TLS handshake is not sent.
Additional context N/A.