lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] sys_timeout handler will not be called


From: Jani Monoses
Subject: Re: [lwip-users] sys_timeout handler will not be called
Date: Mon, 9 Feb 2004 10:52:32 +0200

> Question - why does calling memp frequently crash the system?  Is the
> buffer pool being exhausted and the code is not properly handling the
> out-of-buffer condition?  Or is there bug in the memp code itself that
> does not show up until the memp code is put under stress as in the
> your test above?

I don't think it's a mem_pool problem, here's what I think could happen
sys_sem_wait in the 'timeout occured' case goes on to run the alarm but
_first_ deallocates it with memp_free. mempools use a semaphore unless
light interrupt based protection is used and so another sys_sem_wait is
called which again goes to see which timers should fire. And it might be
that the previous sys_sem took the last timeout without running it so
without it being rescheduled so the timeout list is NULL hence wait
forever.
This could be happening in kuwa's case, do you find this plausible?
I don't know why it crashes here on ecos (but only with combinations of
say 40 timers each firing at 10ms or 100 timers each firing at 80ms) so
only when heavily loaded.Might be related but I am not sure.

I don't think it's a mem_pool problem because I checked to see if
memp_alloc ever returnes NULL and it did not.

Jani




reply via email to

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