lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP crash


From: Anil kumar
Subject: Re: [lwip-users] LWIP crash
Date: Tue, 11 Sep 2012 12:17:27 +0530

I am using lwip version 1.4.0

As per my understanding of lwip, the transmitting and receiving paths works in two different threads. Both of them uses some locking mechanism before entering the core.

 The transmitting sequence of execution is invoked by the application and the flow of execution is as follows:
 netconn_write -> do_write -> do_writemore -> tcp->write ..

The other flow of execution is the receiving path and it executes in the following sequence:
tcpip_thread -> ethernet_input -> ip_input -> tcp_input ...

In the first flow of execution, if the do_writemore function returns ERR_MEM, the thread waits on semaphore op_completed  in do_write function. This thread waits until it is signaled by the other thread.
tcp_input -> sent_tcp -> do_writemore -> signal first thread.

In my case lwip is crashing when the dataptr is accessed from the second thread context in do_writemore function.
 
I tried the following work around and it is working fine for me:
Instead of calling do_writemore from the second thread context, i am signalling the first thread and calling do_writemore again from the do_write function from the first thread context.

My question here is, is it an issue with lwip or is there any mistake in the way i am using lwip.

Regards,
Anil

 

 







On Mon, Sep 10, 2012 at 7:02 PM, Simon Goldschmidt <address@hidden> wrote:
Anil kumar wrote:

> Please let me know if any one is able to use multi-threaded netconn api in cases where do_writemore returns ERR_MEM.

Last time I checked this certainly worked. What version of lwIP are you using and what do you mean when you say the other thread cannot access the dataptr?

Some on
_______________________________________________
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]