[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #20875 [Core Tor/Tor]: Non-fatal assertion !(delay == INT_MAX) failed in next_random_exponential_delay at src/or/directory.c:3792



#20875: Non-fatal assertion !(delay == INT_MAX) failed in
next_random_exponential_delay at src/or/directory.c:3792
--------------------------+------------------------------------
 Reporter:  arma          |          Owner:
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.2.9.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------

Comment (by teor):

 Having delay == INT_MAX is entirely reasonable, and isn't a bug.
 It happens every time the last delay was INT_MAX.

 I think we should turn:
 {{{
  if (BUG(delay == INT_MAX))
    delay -= 1; /* prevent overflow */
 }}}

 Into:
 {{{
  if (delay == INT_MAX)
    delay -= 1; /* prevent overflow */
 }}}

 Or:
 {{{
  if (delay == INT_MAX)
    return INT_MAX;
 }}}

 I also think we should add a precondition right at the top:
 {{{
  if (BUG(max_delay < 0))
    max_delay = 0;
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20875#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs