lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] LWIP - TCP receive assert failed


From: Jackie
Subject: [lwip-users] LWIP - TCP receive assert failed
Date: Mon, 05 Jan 2015 23:59:00 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

Hi all,

Recently when I am working on LWIP to do some stress test, e.g.
continuously uploading data to a server via TCP connection, the device
often crashed on an assert statement in tcp_receive(),

        if (pcb->snd_queuelen != 0) {
          LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked !=
NULL ||
                      pcb->unsent != NULL);
        }

After debugging the crash case, I found some possible cause that the pcb
structure has been corrupted by another thread during a context switch.
I singled out one likely candidate, tcp_slowtmr(). In this timer, it
calls another function tcp_pcb_purge(), in which it resets both unacked
and unsent queue to NULL but without setting queuelen to 0. In some
cases (like tcp state is FIN_WAIT_2), this timer will interrupt the
current tcp thread in a preemptive OS environment, modifying the current
pcb before hitting the assert statement afterwards.

How likely will it be if so? Has anyone encountered a similar issue? Any
suggestions?


Thanks,
Jackie



reply via email to

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