lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Infinite hang in tcp_slowtmr()


From: Stephen Cowell
Subject: Re: [lwip-users] Infinite hang in tcp_slowtmr()
Date: Mon, 12 Oct 2015 16:59:19 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0



On 10/12/2015 3:41 PM, Sylvain Rochet wrote:
Hi Stephen,

On Mon, Oct 12, 2015 at 02:51:14PM -0500, Stephen Cowell wrote:
I find that I sometimes get an infinite loop when stepping to
pcb->next...
I didn't have to read further. As usual, it looks like a broken port or
usage which violate lwIP threading model.

Summary:

- Do *NOT* call anything in interrupt context, nothing, never,
absolutely never, use your OS semaphore signaling to an
Ethernet/serial/… RX thread

I don't think I'm doing that, Sylvain... this is non-OS, so there
are no 'threads'.   Atmel wrote the port.  I'm running sntp and ftpd, they
hook in using their own _init() routines that have not been
modified.

Here's more links describing the problem:

http://savannah.nongnu.org/bugs/?45433
https://lists.gnu.org/archive/html/lwip-users/2004-10/msg00033.html

"

Why would a pcb->next pointer end up pointing to itself (pcb)?

"

Indeed... that's the whole problem.  I solved my problem with a hack that
nobody gets to see here... not sure why.

It looks like this code has had many bugs and problems... I'm glad I could
at least fix my issue.  I won't bother you with any more, since obviously
I'm not making it to the main list.
__
Steve
.


- memp_*, pbuf_*, functions are thread-safe if SYS_LIGHTWEIGHT_PROT is
set, and again, thread safe does not mean it is interrupt safe

- Do *NOT* call any function from the RAW API outside lwIP thread

- Use Netconn or Socket API in others threads, but keep in mind you
should not share a Netconn/Socket control block between threads, (or use
proper locking if you really have to, of course).

- Please read doc/rawapi.txt from the lwIP source which explain that
more comprehensively

Sylvain


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

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