lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP - TCP receive assert failed


From: Sylvain Rochet
Subject: Re: [lwip-users] LWIP - TCP receive assert failed
Date: Thu, 22 Jan 2015 15:48:12 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hello Jackie,


On Thu, Jan 22, 2015 at 10:36:17PM +0800, Jackie wrote:
> Hi Simon & Sylvain,
> 
> After re-examining the code, finally I got more understanding of what
> can cause this problem. Instead of more than one threads are calling
> tcp_output(), there is only one thread tcpip_thread(), but in which
> tcp_output() is called recursively.
> 
> The case happens when the lower-layer protocol (PPP) uses
> sys_sem_wait(). In this function, it is not only waiting a semaphore,
> but it also gives the timer chances to run. As long as it times out, the
> tcp timer will be called, and in the timer, tcp_output() will be called
> again, like,
> 
> tcpip_thread()
> {
>     ...
>     tcp_input()
>     {
>         ...
>         tcp_output()
>         {
>             ...
>             pppifOutput()
>             {
>                 ...
>                 sys_sem_wait();  // Here the tcp_slowtmr() has a chance
> to run again and tcp_output() may be called again in it.

Which PPP function is actually calling sys_sem_wait() ?


> @Sylvain,
> You are right, this PPP protocol implementation is from a third party,

Well, the "third party" for master is actually me.


> so that I am not allowed to modify it so much.

Of course you are, not fixing a bug because the software is third party 
does not make sense, not at all.


> But I think this design is quite buggy, and the worst case is 
> tcp_output() can be called recursively several times.

Yes, it looks buggy :)


Sylvain

Attachment: signature.asc
Description: Digital signature


reply via email to

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