[riot-devel] Odd problems with xtimer

Michael Andersen michael at steelcode.com
Wed Feb 10 07:57:47 CET 2016


Hi

I am new to RIOT, so I hope this is user error, but I am having some grief
inside xtimer. I am running a mesh of nodes with a full RPL stack (in case
that's relevant) and the biggest problem I have at the moment is nodes
hanging in _add_timer_to_list in xtimer_core (link
<https://github.com/RIOT-OS/RIOT/blob/master/sys/xtimer/xtimer_core.c#L210>)

Using GDB, it seems that one of the nodes in the list points to itself,
hence the endless loop.

(gdb) print/x *list_head
$3 = 0x200010a4
(gdb) print/x (*list_head)->next
$4 = 0x200010a4

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

xtimer_now
xtimer_set_msg (the msg is statically alllocated)
xtimer_msg_receive_timeout
xtimer_usleep_until

Any help would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20160209/1f9cd140/attachment.html>


More information about the devel mailing list