apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kashyap Ashwin" <Ashwin.Kash...@thomson.net>
Subject epoll.c bug
Date Mon, 24 Jan 2005 20:31:24 GMT
Hi,

I noticed that pollset->nalloc is not checked in pollset_add in epoll.c.

select.c has:

    if (pollset->nelts == pollset->nalloc) {

        return APR_ENOMEM;

    }

 

Shouldn't epoll.c also have this check? 

 

Also, you are incrementing nelts for every pollset_add, but never
decrementing it. This will eventually cause an overflow. It will also
make the above fix to epoll.c broken.

 

This is really causing me trouble, I am trying to implement something
like SEDA (staged event driven execution) where I have to add and remove
pollfd from a pollset a few thousand times, whenever there is some
event.  

 

Can someone please confirm that this is a bug in apr/poll/unix/epoll.c
or that it has been fixed in a recent version? I am using
apr_20050104234900.

 

 

 

Thanks,

Ashwin

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            \|/ ____ \|/ 
Ashwin Kashyap                                   @~/ ,. \~@ 
Member Technical Staff                          /_( \__/ )_\ 
Thomson - Corporate Research                       \__U_/ 
(609) 987-7334                                  Don't Panic!

 


Mime
View raw message