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 13:21:50 +0530

Hi Simon,

Yes, i am using lwip with LWIP_TCPIP_CORE_LOCKING=1.

How to use the default one, is it the same code base with different options or is it completely a different code base?

Regarding the crash, i am getting kernel oops with the message "unable to handle kernel paging request at virtual address xxx".  xxx is the address of the data (dataptr).   

Thanks,
Anil 




On Tue, Sep 11, 2012 at 12:49 PM, Simon Goldschmidt <address@hidden> wrote:
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

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