[riot-notifications] [RIOT] Endless loop produced in queue.c(63): queue_priority_add() (#328)

Hauke Petersen notifications at github.com
Thu Nov 14 19:59:30 CET 2013


Hej,
here is a riddle for you: put
```
queue_node_t *tmp_node = root;
while (tmp_node != NULL) {
    puts("again, and wait for it:");
    tmp_node = tmp_node->next;
}
```
into the queue_priority_add() function at after a new object was inserted, and you will most certainly run into an endless loop at some point. The loop is caused in the specific situation, that a object is inserted twice, the second time by having a priority so that the second instance is put into the queue right after the fist instance -> this leads to node->next = node -> Bad :-)

Now the interesting part: Where does this situation come from? I found that it seems that in destiny/tcp_timer.c the tcp_general_timer() function fuses that above described behavior, but there seem to be other usages of the queue that also lead to the endless loop.

I this behavior already known? (I hove not found open issues or pull requests...)

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/328
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20131114/2749f5f1/attachment-0001.html>


More information about the notifications mailing list