[Click] schedule_timeout: wrong timeout value ffffffff

Eddie Kohler kohler at cs.ucla.edu
Mon Feb 23 02:19:46 EST 2009


Hi Brian,

Thanks very much for this bug report and patch.  I agree with your analysis, 
and the patch is correct.  I wonder what your values for CLICK_HZ and NSUBSEC 
were?... (I don't believe this problem could occur unless NSUBSEC was 10^9, or 
CLICK_HZ was more than 2000.  Although newer kernels do set NSUBSEC to 10^9.) 
  I have checked in a version of this patch, but instead of the direct 
arithmetic you have done, I called the Timestamp function 
Timestamp::jiffies(), which does the same thing.  Please let me know if you 
have any issues with this patch.

http://www.read.cs.ucla.edu/gitweb?p=click;a=commitdiff;h=1ca9a3e8fef727492bb0e0b106bbc7b601f7f22c

Thanks again.
Eddie


Brian Kim(김계연) wrote:
> 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,
> 
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list