lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] tcp_active_pcbs corrupt after resetting connection ???


From: Terence D
Subject: [lwip-users] tcp_active_pcbs corrupt after resetting connection ???
Date: Wed, 27 Mar 2019 12:05:46 -0700 (MST)

Hi, I'm using lwIP 1.41 with a Texas Instruments Tiva Launchpad development
board (the TM4C1294).  I'm seeing an odd issue occur when resetting a
connection during stress testing.  The Tiva board is the TCP/IP server.  I
have a client application I made that runs on a Windows machine and connects
automatically when starting up.

My stress test consists of making multiple connections to the board.  A new
connection - a new instance of the Windows client app - is made every two
seconds until there are six connections.  I then wait five seconds, kill all
of the Windows client apps and start over making new connections every two
seconds.

The Tiva dev board does some various send/receive communication between the
client app and the board - which all appears to work fine - but then under
certain logic will reset the client connection using the following code:

        tcp_arg(pcb, NULL);
        tcp_sent(pcb, NULL);
        tcp_recv(pcb, NULL);
        tcp_err(pcb, NULL);
        tcp_close(pcb);

This code is run in the lwIPHostTimerHandler.  Which of course is called
from the Ethernet interrupt handler.  Based on other examples, I see no
problem with this.  However, intermittently, it appears to corrupt the
lwIP's tcp.c's tcp_active_pcbs linked list.

Maybe one out of five times, at some point after resetting the client
connection using the above code, the firmware code will get stuck usually in
tcp_fasttmr of tcp.c.  This is because one of the pcb "next" pointers will
point to itself or one of the earlier pcb pointers.  This results in an
infinite loop in tcp_fasttmr as it walks the list - it never gets to a null
next pointer.

Anyone have any idea of what may be happening here?



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]