Hi Anil,

On Fri, Sep 07, 2012 at 11:09:47AM +0530, Anil kumar wrote:
> We are using lwip as a linux kernel module in a multi threaded environment.
> 
> Here is the sequence of events that are leading to the crash in my case.
> 
> As the application is continuously sending data, do_write continuously
> calls do_writemore, which internally calls tcp_write. At some point
> tcp_write returns ERR_MEM and do_write waits on semaphore op_completed.
> 
> [...]
> 
>  What could be the reason for the crash in the first case,  is it i am
> using lwip threads incorrectly ?

It looks like you are using the raw API with threads, raw API is -NOT- 
thread safe, you have to use netconn or socket API. Please read 
doc/rawapi.txt, but no worry, we all (At least I did) made the mistake 
until we find out this file :-)

Also, if you are allocating pbuf outside of the lwIP thread, you have to 
set SYS_LIGHTWEIGHT_PROT=1 in your lwipopts.h

Sylvain

Attachment: signature.asc
Description: Digital signature

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

Reply via email to