Crash when closing socket with unconsumed input after network is closed #1390
Labels
bug
Something isn't working
critical
This is a critical issue
platform-freertos
This issue is for the FreeRTOS platform build
When closing TCP and UDP sockets on the ESP32, we call
pbuf_free
if we hold onto network packets that we got from the underlying network layer (like wifi). This in return calls back into the network layer, but if the specific network has been closed before we get to this point, this crashes:The behavior can be reproduced by running this code on the device:
and connecting to it from another device or machine using something like this:
The crash happens when closing the accepted socket on the device (server side), which happens after we've closed the network.
It should be possible to come up with a similar reproduction case for UDP, but there the problematic pbufs are the ones hanging off of the queued and spare packets.
The text was updated successfully, but these errors were encountered: