I am using libevent 1.1a in our product. We have ever ported our product
from 32-bit Solaris to 64-bit Solaris,
that time I did not make any change to libevent source code, for from my
point of view, libevent is safe for 64-bit porting.
The first question I would like to confirm is, whether libevent pass 64-bit
Solaris environment test?

The second problem is, our tester came across the following problem when he
run our product with high call load on 64-bit Solaris environment.

Assertion failed: events[i].fd < devpollop->nfds, file
/vobs/css/siptrans/contrib/libevent/src/devpoll.c, line 271.
I can not figure out what caused such failure, appreciate your help.
Thanks a lot,
Liang

I pasted the related function as below,
    227 int
    228 devpoll_dispatch(struct event_base *base, void *arg, struct timeval
*tv)
    229 {
    230         struct devpollop *devpollop = arg;
    231         struct pollfd *events = devpollop->events;
    232         struct dvpoll dvp;
    233         struct evdevpoll *evdp;
    234         int i, res, timeout;
    235
    236         if (evsignal_deliver(&devpollop->evsigmask) == -1)
    237                 return (-1);
    238
    239         if (devpollop->nchanges)
    240                 devpoll_commit(devpollop);
    241
    242         timeout = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000;
    243
    244         dvp.dp_fds = devpollop->events;
    245         dvp.dp_nfds = devpollop->nevents;
    246         dvp.dp_timeout = timeout;
    247
    248         res = ioctl(devpollop->dpfd, DP_POLL, &dvp);
    249
    250         if (evsignal_recalc(&devpollop->evsigmask) == -1)
    251                 return (-1);
    252
    253         if (res == -1) {
    254                 if (errno != EINTR) {
    255                         event_warn("ioctl: DP_POLL");
    256                         return (-1);
    257                 }
    258
    259                 evsignal_process();
    260                 return (0);
    261         } else if (evsignal_caught)
    262                 evsignal_process();
    263
    264         event_debug(("%s: devpoll_wait reports %d", __func__, res));
   265
    266         for (i = 0; i < res; i++) {
    267                 int which = 0;
    268                 int what = events[i].revents;
    269                 struct event *evread = NULL, *evwrite = NULL;
    270
    271                 assert(events[i].fd < devpollop->nfds);
    272                 evdp = &devpollop->fds[events[i].fd];
    273
    274                 if (what & POLLHUP)
    275                         what |= POLLIN | POLLOUT;
    276                 else if (what & POLLERR)
    277                         what |= POLLIN | POLLOUT;
    278
    279                 if (what & POLLIN) {
    280                         evread = evdp->evread;
    281                         which |= EV_READ;
    282                 }
    283
    284                 if (what & POLLOUT) {
    285                         evwrite = evdp->evwrite;
    286                         which |= EV_WRITE;
    287                 }
    288
    289                 if (!which)
    290                         continue;
    291
    292                 if (evread != NULL && !(evread->ev_events &
EV_PERSIST))
    293                         event_del(evread);
    294                 if (evwrite != NULL && evwrite != evread &&
    295                     !(evwrite->ev_events & EV_PERSIST))
    296                         event_del(evwrite);
    297
    298                 if (evread != NULL)
    299                         event_active(evread, EV_READ, 1);
    300                 if (evwrite != NULL)
    301                         event_active(evwrite, EV_WRITE, 1);
    302         }
    303
    304         return (0);
    305 }



_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to