lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP crash


From: Simon Goldschmidt
Subject: Re: [lwip-users] LWIP crash
Date: Tue, 11 Sep 2012 09:19:03 +0200

Anil kumar wrote:
> 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.

This is only true for LWIP_TCPIP_CORE_LOCKING==1, which is not the default. 
Also, while this code exists for some time now, the potential for bugs is still 
higher than in the default code.

The default is that all lwIP-internal processing is done in one thread only and 
that application threads use mailboxes and semaphores to communicate with this 
thread.

> [..]
> In my case lwip is crashing when the dataptr is accessed from the second
> thread context in do_writemore function.

Can you say why it crashes (and how it crashes, i.e. what exactly do you mean 
with "crashing"?) when accessing the dataptr from there? Is the pointer invalid 
or do you have an MPU that prevents this?

> 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.

That might work, but it's less performant as it adds another context switch 
(unless you're finished with the 2nd call to do_writemore, of course).


Simon



reply via email to

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