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

Re: [Libevent-users] SSL problems after update to libeven 2.1.8



On Thu, Sep 13, 2018 at 03:05:41AM +0200, Till Toenshoff wrote:
> > On 10. Sep 2018, at 12:02, Azat Khuzhin <a3at.mail@xxxxxxxxx> wrote:
> > 
> >>> commit f4b6284b8393dbabf389ddce734a30f4cdeffa17
> >>>   be_openssl: don't add events during bev creation (like be_sock)
> > 
> > Thanks for the bisect!
> > 
> > Interesting, just revering it doesn't fixes the issue to me (on linux).
> > And to reset to this commit I need openssl 1.0 (since I have 1.1), will
> > prepare env for it and get back.
> > 
> >> The above bisect was done on macOS 10.14 - which works fine with Mesos l+ libevent 2.1.5 but breaks with libevent 2.1.8.
> >> 
> >> Will do the same bisect on Ubuntu 18.04 as well - just to be sure.
> > 
> Bisect on Ubuntu 18.04 resulted in the very same offender.
> 
> Reverting that commit makes things worse, not better. Instead of a timeout on the receive, we then get a failure already on the accept.
> 
> ../../../3rdparty/libprocess/src/tests/ssl_tests.cpp:254: Failure
> (socket).failure(): Failed accept: connection error: error:00000000:lib(0):func(0):reason(0)
> 
> This bisect and the revert results are based on libssl 1.0.
> 
> Will also keep pondering … and get back with new results.

Hi Till,

So finally I had time to investigate this, and after looking into mesos
sources I find out that you libevent wrappers do not enable needable
events for openssl bufferevents. And that is why everything hangs (why I
didn't check this before?).

I just added bufferevent_enable() into two places and now SSLTest.*
passes.

You will find patches for mesos here:
  https://github.com/azat-archive/mesos.git le-dev

Also it contains some fixes for cmake (since I don't like autotools due
to how difficult to handle every single dependency right there, in
particular "make -C 3rdparty/libprocess/ -j4 libprocess-tests" will not
built all dependencies, if you curious).

And here is startup script for your docker image to pass libevent/mesos
sources into it that I came up with:
  https://gist.github.com/azat/41ee673d2b5dec9f1ac14a5970265be2

Before this I used your autotools build and hacks around to pass my
libevent version into the image (things got complicated because that
unit tests start binaries which reset environ) but maybe I messed up
maybe not, but you bisect indeed correct. Anyway you should enable
events manually if you want reliable code.

Also since you wrote that "reverting makes thing worse" could you
verify referenced patches (including osx) ?

And thanks again for the docker image, details and your correct bisect!

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