Perhaps fix an overflow bug relate to timer#426
Open
yulincoder wants to merge 2 commits intotinyos:masterfrom
Open
Perhaps fix an overflow bug relate to timer#426yulincoder wants to merge 2 commits intotinyos:masterfrom
yulincoder wants to merge 2 commits intotinyos:masterfrom
Conversation
…f other task to fail
Author
|
Any review? |
Member
|
I could have sworn I asked what machine you are building this for? But don't see any reference to it. So what processor are you building this for? I've looked at the code and don't understand why your code doesn't work. More investigation into the root cause is warranted. |
Author
|
@cire831 I am sorry to close another pull request so that did not notice your comment.
if (min_remaining <= 0)
fireTimers(now);
|
Member
|
okay. I'll see what I can do. I'll take a look at it in the next few days. |
Author
|
@cire831 Do you have a good fix? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, I find a bug relates to timer system and try to fix it, which causes overflow task to execute and all of the other tasks to fail. The system will crash and the battery is quickly exhausted (not "slightly higher runtime cost" in the comments of code author in the function because 'remaining' will always be negative and cannot be corrected). The following code can trigger bugs,
then you can see that the node is always running at full capacity, it will run the timer task with bugs forever.
Although the code author noticed the overflow problem, he/she did not solve it.
This problem appears to have been triggered in an early CTP protocol, but it has not really been resolved in underlying. [ 11ff964 ]
The idea my fix is to disable the timer that triggered the bug so that timer with the bug can not influent each other task. In this case, other tasks in the system can handle events normally, and the battery won't be drained quickly.