[Click] schedule_timeout: wrong timeout value ffffffff

Brian Kim(김계연) double73 at gmail.com
Sat Jan 31 03:41:20 EST 2009


Hi,

I got panic message like this.

[45126.836299] schedule_timeout: wrong timeout value ffffffff
[45126.836302] Pid: 27420, comm: kclick Not tainted 2.6.24.7 #1
[45126.836307]  [<c0103bfa>] show_trace_log_lvl+0x1a/0x30
[45126.836315]  [<c0104602>] show_trace+0x12/0x20
[45126.836322]  [<c0104f6e>] dump_stack+0x6e/0x80
[45126.836329]  [<c03a746b>] schedule_timeout+0x9b/0xc0
[45126.836336]  [<f90b81b2>] _ZN12RouterThread6driverEv+0x502/0x610
[45126.836525]  [<f9164ce2>] _Z11click_schedPv+0xd2/0x1f0 [genianclick]
[45126.836739]  [<c01037eb>] kernel_thread_helper+0x7/0x1c

I running click on my linux 2.6.24.7.
I had some investigation of this problem. And I found some weird code.

============
diff --git a/lib/routerthread.cc b/lib/routerthread.cc
index dfd7bf4..6cf7291 100644
--- a/lib/routerthread.cc
+++ b/lib/routerthread.cc
@@ -441,7 +441,7 @@ RouterThread::run_os()
    if (wait.sec() >= LONG_MAX / CLICK_HZ - 1)
        (void) schedule_timeout(LONG_MAX - CLICK_HZ - 1);
    else
-       (void) schedule_timeout((wait.sec() * CLICK_HZ) + (wait.subsec()
* CLICK_HZ / Timestamp::NSUBSEC) - 1);
+       (void) schedule_timeout((wait.sec() * CLICK_HZ) +
(wait.subsec() / (Timestamp::NSUBSEC / CLICK_HZ)) - 1);
     } else
    goto block;
     SET_STATE(S_RUNNING);
============

wait.subsec() * CLICK_HZ is possibly overflow. So result is -1.
I still no problem with this patch.

Is this patch is correct ?

Thanks,




More information about the click mailing list