summaryrefslogtreecommitdiff
path: root/src/or/scheduler.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-10-03 14:38:30 -0400
committerNick Mathewson <nickm@torproject.org>2017-11-02 10:30:33 -0400
commit3931a6f264355d7fe017219f76bd5bec1d8bcbd8 (patch)
tree35750425f43f95761ec7110d974099fe25a9a36d /src/or/scheduler.c
parent2e8de0de3b5ae10277cd0fd72e782d2f6aa30c81 (diff)
downloadtor-3931a6f264355d7fe017219f76bd5bec1d8bcbd8.tar.gz
tor-3931a6f264355d7fe017219f76bd5bec1d8bcbd8.zip
sched: Use SCHED_BUG() macro in scheduler
When a BUG() occurs, this macro will print extra information about the state of the scheduler and the given channel if any. This will help us greatly to fix future bugs in the scheduler especially when they occur rarely. Fixes #23753 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/scheduler.c')
-rw-r--r--src/or/scheduler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index c656c80e9c..67911ff81e 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -607,7 +607,7 @@ scheduler_release_channel,(channel_t *chan))
}
if (chan->scheduler_state == SCHED_CHAN_PENDING) {
- if (smartlist_pos(channels_pending, chan) == -1) {
+ if (SCHED_BUG(smartlist_pos(channels_pending, chan) == -1, chan)) {
log_warn(LD_SCHED, "Scheduler asked to release channel %" PRIu64 " "
"but it wasn't in channels_pending",
chan->global_identifier);