[Top][All Lists]

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

Re: [lwip-users] LWIP Threading and other issues

From: Simon Goldschmidt
Subject: Re: [lwip-users] LWIP Threading and other issues
Date: Wed, 1 Feb 2017 10:09:09 +0100

Sandra Gilge wrote:
> [..]
> For this I added a function sys_get_thread_id [..] Then
> I compare in get_socket the ID in lwip_sock with the calling thread and the
>tcpip thread.
> This could be a useful debug feature for all LWIP users to be added in the
> LWIP Stack?

I'm not sure I get it. You checked that sockets are used from only one thread? 
The thing to check would be to ensure that *every* core function (not sockets) 
is only called from tcpip_thread and not from an interrupt. That would indeed 
be useful for debugging. I could imagine adding a macro for this which whould 
need to be implemented by an lwIP port.

However, I suspect many of the users getting lwIP's threading wrong might get 
the implementation of this check wrong, too... :-)

> 1. unsent oversize mismatch
> When stressing my system with a flood of HTTP get requests getting JPEG
> images, I get (very sporadically) the assert "unsent_oversize mismatch (pcb
> vs. last_unsent)"

That's bad. I don't get that when stressing my system. Unfortunately, there's 
not much we can do for you here: either you debug where this comes from or you 
get a repro on win32/linux port so we can debug this.

> 2. read after shutdown
> [..]
> When "#define MEMP_SANITY_CHECK 1" is set I get sporadically an assert from
> the sanity check.
> When I remove the recv after shutdown it works. Maybe this receive is the
> problem?

Again, that's strange but I don't see how this could happen and I can't 
reproduce it, so I cannot help you much here, either :-(

> I'v seen following comment in sockets.c
> /**
> * Unimplemented: Close one end of a full-duplex connection.
> * Currently, the full connection is closed.
> */

That comment is just wrong (i.e. outdated). I'll fix it, thanks for the 


reply via email to

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