Sebastian Sjöberg | 3 May 2010 11:14
Picon
Favicon

Re: 100% cpu utilization with openssl bufferevent.

On Apr 30, 2010, at 11:48 AM, Pavel Pisa wrote:

> Hello All,
> 

Hi,

Thanks for the nice information.

[...]

> 
> You can easily check, if this is cause of your troubles
> by running same code on 2.6.30+ kernel.
> If you need correct behavior even on older kernels,
> then it can be problematic. Basically you have to do
> no I/O or changes related to any of FDs registered in epoll
> if event count 0 is reported.

I tested with the latest kernel and I get the same problem anyway, it's probably a bug within libevent.

Best regards,
Sebastian Sjoberg

> 
> Best wishes,
> 
> 
>                Pavel Pisa
>    e-mail:     pisa <at> cmp.felk.cvut.cz
(Continue reading)

Péter Szabó | 3 May 2010 11:45
Picon

Re: registering the same filehandle with EV_READ (without EV_PERSIST) multiple times

>> I'd like to register two struct event's for the same filehandle, with
>> EV_READ (without EV_PERSIST), with multiple callbacks, and whenever
>> the file becomes readable, I'd like to get both of my callbacks be
>> called
>
> Libevent 1.4.x and earlier don't support this.  Libevent 2.0.x does.

Thanks for the clarification. It works properly for me with libevent 2.0.4.
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

Péter Szabó | 3 May 2010 11:51
Picon

resuming libevent2 after closing all file descriptors

Hi,

I'm doing the following with libevent 2.0.4 on Linux:

  strcut event_base *base = event_init()
  ...  /* not registering any events */
  for (int fd = 3; fd < 256; ++fd) close(fd);
  event_reinit(base);
  ...
This eventually reports the following warning:

  [warn] Epoll ADD on fd 7 failed.  Old events were 0; read change was
1; write change was 0.: Bad file descriptor

From ls -l /pro/self/fd, it seems that libevent opens a socketpair on
fds 7 and 8, which I close with close(fd), but event_reinit(base)
doesn't create the new socketpair. Do you think it would be possible
to recreate the socketpairs?

Please note that technically it would be very cumbersome for me to
call event_init() after the close(fd) loop.

Thanks,

Péter
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

(Continue reading)

Nick Mathewson | 3 May 2010 17:47

Re: 100% cpu utilization with openssl bufferevent.

On Thu, Apr 29, 2010 at 2:14 PM, Sebastian Sjöberg
<Sebastian.Sjoberg <at> axis.com> wrote:
[...]
> Cheers, I haven't yet been able to reproduce it when disabling epoll.
>
> I've started to debug the evmap_io_active calls and after a while there are a no events being activated as
you said so I guess at some point the there's a mismatch between what's in epoll and in the event map.

Hm.  In that case, I'd suspect a problem in the new(ish) changelist
code.  I'll let you know if I have any luck chasing it down.

--

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

Nick Mathewson | 6 May 2010 20:05

Re: resuming libevent2 after closing all file descriptors

2010/5/3 Péter Szabó <ptspts <at> gmail.com>:
> Hi,
>
> I'm doing the following with libevent 2.0.4 on Linux:
>
>  strcut event_base *base = event_init()
>  ...  /* not registering any events */
>  for (int fd = 3; fd < 256; ++fd) close(fd);
>  event_reinit(base);
>  ...
> This eventually reports the following warning:
>
>  [warn] Epoll ADD on fd 7 failed.  Old events were 0; read change was
> 1; write change was 0.: Bad file descriptor
>
> From ls -l /pro/self/fd, it seems that libevent opens a socketpair on
> fds 7 and 8, which I close with close(fd), but event_reinit(base)
> doesn't create the new socketpair. Do you think it would be possible
> to recreate the socketpairs?

Can you say more about why you closing all these fds, including ones
that belong to the event base?  Libevent doesn't like you to close its
socketpair fds any more than it will like it if you're closing its
epoll fd, or any more than it would like it if you call free() on the
internals of the event_base.

In any case, re-grabbing *all* resources isn't the point of
event_reinit().  The event_reinit() function is only supposed to be
called after a fork() to re-acquire or re-register any resources that
aren't inherited by a child process; it is not an alias for calling
(Continue reading)

Roger Pack | 7 May 2010 18:36
Picon

liboop

Is the link to liboop on http://monkey.org/~provos/libevent/ accurate?
(It doesn't seem to link to an asynchronous library...)

Also a small suggestion for http://monkey.org/~provos/libevent/ might
be to link to "what is different between 1.4 and 2.0" so people can
know better what to choose.

Thanks!
-rp
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

Roger Pack | 7 May 2010 18:47
Picon

Re: unable to build with mingw...

> with mingw/gcc 3.4.5, libevent-2.0.3-alpha, I receive the following
> when attempting to compile...

libevent 2.0.4 and 1.4.10 appear to build successfully now with mingw.
Thanks for anybody who submitted patches there.
-rp
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

Anomit Ghosh | 12 May 2010 20:55
Picon
Gravatar

Server closes connection to client just after accept()

This is the code in question: http://codepad.org/7eD9n14B
Run the code as `./server 127.0.0.1 <port number>`

I registered a callback(sock_callback) on the listening socket that
puts the new connections after accepting in a list. Now the problem
seems to be that even after doing event_add() in L73 the connection
closes immediately. I tested this by using telnet to connect to the
server. The printf() on L62 gets printed properly but nothing else
works properly. Where am I going wrong? Even a little help would be
appreciated (I'm kind of on a tight schedule :-| ).

Thanks

--

-- 
Anomit Ghosh
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

Nick Mathewson | 13 May 2010 03:15

ANN: Libevent 2.0.5-beta released; Libevent 2.0 now in feature-freeze

Hi everyone!

Thanks to many people's hard work, Libevent 2.0 has now had its first
beta release.  You can download it from:

 http://www.monkey.org/~provos/libevent-2.0.5-beta.tar.gz
 http://www.monkey.org/~provos/libevent-2.0.5-beta.tar.gz.sig

Don't forget to validate the signature.   The complete list of changes
is available in the ChangeLog file, included with the distribution.

*** What's new:

Some highlights include:
- The evdns module now uses the regular logging system
- The evbuffer backend is now more efficient in how it packs bytes when reading.
- The bufferevent rate-limiting logic has a few more features to help
mix it with existing code.
- Debugging mode now catches attempts to mix edge-triggered and
non-edge triggered events.
- There's a new evbuffer_copyout() function that acts like
evbuffer_remove(), but without draining the buffer.
- The request and reply members of rpc_req_generic are now exposed,
for use by extensions to the RPC protocol. [Shuo Chen]
- DNS errors that occur during bbufferevent_connect_hostname are now
visible to user code. [Christopher Davis]
- There's a new mode on bufferevents where, if you're using deferred
callbacks, you can have the bufferevent callbacks executed without
holding the lock on the bufferevent. [Joachim Bauch]

(Continue reading)

Nick Mathewson | 13 May 2010 08:05

Re: Server closes connection to client just after accept()

On Wed, May 12, 2010 at 2:55 PM, Anomit Ghosh <anomit.ghosh <at> gmail.com> wrote:
> This is the code in question: http://codepad.org/7eD9n14B
> Run the code as `./server 127.0.0.1 <port number>`
>
> I registered a callback(sock_callback) on the listening socket that
> puts the new connections after accepting in a list. Now the problem
> seems to be that even after doing event_add() in L73 the connection
> closes immediately. I tested this by using telnet to connect to the
> server. The printf() on L62 gets printed properly but nothing else
> works properly. Where am I going wrong? Even a little help would be
> appreciated (I'm kind of on a tight schedule :-| ).

Hm.  It works for me, so I'm suspecting something platform-dependent.
My first guess is that you're calling accept() wrong: you need to
initialize addrlen to sizeof(client_addr) before you call it, if I'm
reading the accept() documentation right.  But try checking for errors
on all of your syscalls to catch stuff like that, and see if that's
what the problem is?

--

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.


Gmane