-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
vtimer_sleep fails after long uptime #2435
Comments
sounds like a timer overrun |
Is there a timer which stops the main thread ? Because there is no timer timer in the code I have implemented. |
What exactly do you mean with "the main thread is automatically killed"? |
After less than two hours the |
Are any other threads still running? what is ps saying? |
(I assumed the whole node crashed due to some null pointer dereference or the likes of it after the timer overflowed..) |
Actually the node is still running in idle thread after leaving main thread |
I think that using |
Actually, when I execute a
So the main thread is not killed as I said before but it looks like a mutex somewhere stopped it. |
when I talked with @haukepetersen @authmillenon and @phiros in the RoMe meeting, I got the impression that they said something about the vtimer having an overflow when running the rpl_udp example for a long time. maybe you guys wanna add something here? |
@maxencechotard Could you try running |
@thomaseichinger I am going try those |
I tried a |
I tried this morning and it tooks between 2h to 2h20minutes to stop main thread. I'll try to be more precise in next experiment. |
Judging from the ps output and your main loop, the |
@LudwigOrtmann Is there any way I can debug vtimer_sleep function ? |
If you have a look at the implementation of index 4662ac8..721962e 100644
--- a/sys/vtimer/vtimer.c
+++ b/sys/vtimer/vtimer.c
@@ -32,7 +32,7 @@
#include "vtimer.h"
-#define ENABLE_DEBUG (0)
+#define ENABLE_DEBUG (1)
#include "debug.h" Feel free to add some debug output in the same fashion you find all over the place to |
I can confirm that every time it take between 2h12 and 2h14 to stop the main thread. Sounds really like a timer problem :) |
I have also observed it. Can not say more currently, but it is around 2hxx |
Could be related to #1753 |
vtimer does not handle well the different timers (vtimer <-> hwtimer) with regard to their overflows: * in update_shortterm HWTIMER_TICKS cannot be just applied to next, this will be wrong when next overflows. * in vtimer_now wrong parentheses mix up vtimer and hwtimer ticks. Maybe related issues: * RIOT-OS#2435 * RIOT-OS#1753
vtimer does not handle well the different timers (vtimer <-> hwtimer) with regard to their overflows: * in update_shortterm HWTIMER_TICKS cannot be just applied to next, this will be wrong when next overflows. * in vtimer_now wrong parentheses mix up vtimer and hwtimer ticks. Maybe related issues: * RIOT-OS#2435 * RIOT-OS#1753
I managed to get a backtrace on a hanged system running the vtimer_msg test. The timer ran fine until hwtimer_now reported 12313 seconds (decimal) and 0x44e9 ticks (hexadecimal, 1/32768 second per tick). This was on a mulle with #3140, #3147 and #3146 applied. The short term queue contains a loop:
I still have the system paused in the debugger so I can investigate more but I don't have any time to start reading through the vtimer code right now. Edit: Added some more debug information (hwtimer_stats and below) |
vtimer was removed (replaced by xtimer) |
I have experienced a problem with nodes on samr21 : after running about two hours, the main thread is automatically killed even if there is
while(1)
loop inside. I also tried to create thewhile(1)
loop in a thread launched from the main thread and it also stopped after less than two hours. Finally, I tried the rpl_udp example on native and it also stopped after two hours. Is the problem coming from the watchdog ? The branch I used is :https://github.com/maxencechotard/RIOT/tree/UDP_ONLY
.The text was updated successfully, but these errors were encountered: