Skip to content
Snippets Groups Projects
Commit e1b59973 authored by Nadav Har'El's avatar Nadav Har'El Committed by Pekka Enberg
Browse files

timers: add assertion


Issue #178, and recent netperf 3 experiments by Vlad, suggests we have a
bug in our timer code which very rarely causes crashes on
timer_list::fired(). It appears we somehow corrupt our per-cpu timer list,
or some armed timer object - but I still haven't been able to figure out
where.

This patch adds an assertion that the timer we find on the list is
actually armed. Unfortunately, it consistantly fails (I can see the same
assertion failure once every 100-200 runs of tst-queue-mpsc.so), and this
failure seems to replace the page-fault crash of issue #178.

Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 9a451ec7
No related branches found
No related tags found
No related merge requests found
...@@ -986,6 +986,7 @@ void timer_list::fired() ...@@ -986,6 +986,7 @@ void timer_list::fired()
// don't hold iterators across list iteration, since the list can change // don't hold iterators across list iteration, since the list can change
while (!_list.empty() && _list.begin()->_time <= now) { while (!_list.empty() && _list.begin()->_time <= now) {
auto j = _list.begin(); auto j = _list.begin();
assert(j->_state == timer_base::state::armed);
_list.erase(j); _list.erase(j);
j->expire(); j->expire();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment