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

Re: [Libevent-users] Signals and priority queues



On Fri, Jan 13, 2012 at 10:13 AM, Ralph Castain <rhc@xxxxxxxxxxxx> wrote:

>> What kind of illegal value are you seeing,
>
> 1326467251, 774650

Okay, that looks like it's the actual current time!  I wonder why that
would make select() give an error, though.  Maybe because the current
time plus that many seconds exceeds a 32-bit TIME_MAX ?

>> coming from where?
>
> I'm not sure who calls "select_dispatch" - the value is passed into it.

The line is
                 res = evsel->dispatch(base, tv_p);
in event_base_loop() in event.c

>> Are you
>> using the common_timeout code?
>
> This is just flowing thru from a call to event_loop - I'm not sure of the progression that takes us down to select_dispatch.

I meant, is any part of your code calling
event_base_init_common_timeout() ? It sounds like "no".

So, three possibilities come to mind:
  1) Something is calling event_add with an absolute time rather than
a number of seconds/usec to delay.
  2) Something in Libevent is calling event_add_internal with an
absolute time rather than a delay, and is not setting the
tv_is_absolute flag
  3) timeout_correct has gone crazy, and thinks that the current time
has been reset to 0 for some reason.

Adding some assertions in event_add_internal might track this down.
Trivially, you could do
   if (tv && !tv_is_absolute) {
       /* waiting one billion seconds should be enough for anyone */
       EVUTIL_ASSERT(tv->tv_sec < 1000000000);
   }

to try to detect 1 and 2.

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.