[riot-devel] Odd problems with xtimer

Kaspar Schleiser kaspar at schleiser.de
Wed Feb 10 11:45:37 CET 2016


Hey Michael,

On 02/10/2016 07:57 AM, Michael Andersen wrote:
> it seems that one of the nodes in the list points to itself, hence the
> endless loop.
> 
> My first question is: when is this possible? It seems at first glance
> that all code paths that lead here call remove_timer to prevent this
> sort of problem. 
It should not be possible (tm).

I took another look at the code, it seems to me that timer->next gets
overwritten whenever a timer is set, so there can't be some outdated value.

It might be that the list logic has a bug somewhere, but I remember
testing them quite rigourously.

> I don't access a the same timer object from two
> different threads. My code using xtimer functions is not reentered.
> 
> I don't use that many timer operations in my application code, but I do
> assume that the following functions don't require any freeing or
> removing afterwards, am I wrong?
Completely right.

Could you tell us more on how you are using timers?

Interesting would be things like

- what platform are you on
- how many timers are simultaneously active
- how are the intervals
- how is the interrupt load

... that might help corner the issue.

You should consider xtimer just showing a problem which might be caused
by memory corruption.

Kaspar


More information about the devel mailing list