librelist archives

« back to archive

Problem with libevent 2.0

Problem with libevent 2.0

From:
Christian Bayle
Date:
2011-11-22 @ 17:06
Thank you for the great Job,

I found a problem with libevent 2.0
It seems that proxy with http (both methods) don't work properly
when using libevent 2.0 but socks5 continues to work.

I found this because redsocks was not working on my ubuntu oneiric, 
though perfectly on
debian squeeze

I downgraded libevent with the 1.4 and all started to work again.
If you can fix the problem, I'll be happy to send feedback.

Cheers

Christian

Re: [redsocks] Problem with libevent 2.0

From:
Leonid Evdokimov
Date:
2011-11-23 @ 17:38
On Tue, Nov 22, 2011 at 21:06, Christian Bayle
<christian.bayle@orange.com> wrote:
> It seems that proxy with http (both methods) don't work properly
> when using libevent 2.0 but socks5 continues to work.

Ok, I need several answers to speedup debugging:

What proxy do you use?
Do you use authentication?
Can you give me access to that proxy for debugging purposes?
Is it true, that both http-relay & http-connect work for you with
libevent1.4 and both do not work for you with libevent2?
What libevent2 version do you have?

--
WBRBW, Leonid Evdokimov
xmpp:leon@darkk.net.ru && http://darkk.net.ru
tel:+79816800702 && tel:+79050965222

Re: [redsocks] Problem with libevent 2.0

From:
Christian Bayle
Date:
2011-11-23 @ 17:58
Hi,

Le 23/11/2011 18:38, Leonid Evdokimov a écrit :
> On Tue, Nov 22, 2011 at 21:06, Christian Bayle
> wrote :
>> It seems that proxy with http (both methods) don't work properly
>> when using libevent 2.0 but socks5 continues to work.
> Ok, I need several answers to speedup debugging:
>
> What proxy do you use?
As far as could see it's a netcache proxy 
(http://www.netapp.com/us/products/netcache.html)
> Do you use authentication?
I don't use authentication
> Can you give me access to that proxy for debugging purposes?
Sorry, I can't do this, it's on a private network, and I don't have any 
control on this server
> Is it true, that both http-relay&  http-connect work for you with
> libevent1.4 and both do not work for you with libevent2?
Excactly, while socks5 works all the time, but socks5 is provided by a 
different server.
> What libevent2 version do you have?
On ubuntu oneric
1.4.13-stable-1 works
2.0.12-stable-1 don't work

I downgraded using
apt-get -t natty install libevent-dev=1.4.13-stable-1
after adding natty lines in /etc/apt/sources.list
This is the only thing I changed to make it work, that's why libevent is 
highly suspected to be part of the problem.

Cheers

Christian

Re: [redsocks] Problem with libevent 2.0

From:
Leonid Evdokimov
Date:
2011-11-23 @ 18:10
On Wed, Nov 23, 2011 at 21:58, Christian Bayle
<christian.bayle@orange.com> wrote:
>> Can you give me access to that proxy for debugging purposes?
> Sorry, I can't do this, it's on a private network, and I don't have any
> control on this server

Ok, I see.

There are three more things you can do to help me (they're optional,
but I would really appreciate it):

1. Gather redsocks.log with log_debug = on & log_info = on for both
failing and working cases. I need log, `ip addr` output,
`iptables-save` output and redsocks.conf - to understand network
topology without guessing.

2. Show me output of `git describe --tags` in the directory that you
used to build redsocks. I would like to know exact version.

3. Gather wireshark (and/or tcpdump) packet dumps on external
interface while running with libevent1.4 and libevent2. If you're
going to use tcpdump, ensure, that you use `-s 0` option to avoid
packet truncation.
I would like to see full network dump for both "working" and "failing" scenario.

--
WBRBW, Leonid Evdokimov
xmpp:leon@darkk.net.ru && http://darkk.net.ru
tel:+79816800702 && tel:+79050965222

Re: [redsocks] Problem with libevent 2.0

From:
Christian Bayle
Date:
2011-11-24 @ 08:53
Le 23/11/2011 19:10, Leonid Evdokimov a écrit :
> On Wed, Nov 23, 2011 at 21:58, Christian Bayle wrote:
>>> Can you give me access to that proxy for debugging purposes?
>> Sorry, I can't do this, it's on a private network, and I don't have any
>> control on this server
> Ok, I see.
>
> There are three more things you can do to help me (they're optional,
> but I would really appreciate it):
>
> 1. Gather redsocks.log with log_debug = on&  log_info = on for both
> failing and working cases. I need log, `ip addr` output,
> `iptables-save` output and redsocks.conf - to understand network
> topology without guessing.
redsocks.log OK
---------------------
1322123157.796348 main.c:146 main(...) redsocks started
1322123432.220623 redsocks.c:604 redsocks_accept_client(...) 
[10.194.11.246:47258->82.233.119.151:80]: accepted
1322123432.344423 redsocks.c:279 redsocks_start_relay(...) 
[10.194.11.246:47258->82.233.119.151:80]: data relaying started
1322123432.349653 redsocks.c:352 redsocks_shutdown(...) 
[10.194.11.246:47258->82.233.119.151:80]: both client and server 
disconnected
1322123432.349719 redsocks.c:289 redsocks_drop_client(...) 
[10.194.11.246:47258->82.233.119.151:80]: dropping client
1322123469.433459 main.c:150 main(...) redsocks goes down

redsocks.log FAILURE
----------------------------
1322123889.578226 main.c:146 main(...) redsocks started
1322123897.976938 redsocks.c:604 redsocks_accept_client(...) 
[10.194.11.246:47263->82.233.119.151:80]: accepted
1322123964.568342 main.c:150 main(...) redsocks goes down
1322123964.568537 redsocks.c:741 redsocks_fini_instance(...) There are 
connected clients during shutdown! Disconnecting them.
1322123964.568568 redsocks.c:289 redsocks_drop_client(...) 
[10.194.11.246:47263->82.233.119.151:80]: dropping client

> 2. Show me output of `git describe --tags` in the directory that you
> used to build redsocks. I would like to know exact version.
release-0.2-2-g9fce864
I build from a fresh git clone / pull
> 3. Gather wireshark (and/or tcpdump) packet dumps on external
> interface while running with libevent1.4 and libevent2. If you're
> going to use tcpdump, ensure, that you use `-s 0` option to avoid
> packet truncation.
> I would like to see full network dump for both "working" and "failing" scenario.
I send you this privately

I also noticed the following information
redsocks built with libevent 1.4 works with libevent 2.0 installed
I got the problem only when I rebuild with libevent 2.0

Christian

Re: [redsocks] Problem with libevent 2.0

From:
Leonid Evdokimov
Date:
2011-11-27 @ 00:07
On Thu, Nov 24, 2011 at 12:53, Christian Bayle
<christian.bayle@orange.com> wrote:
> [...]

iptables-save & redsocks.conf & redsocks.log were useful :)

Bin Jin have already fixed the bug in http/http-connect, but I forgot
to merge his commit. I've finally merged it now.

Can you try release-0.2-4-gdcbdcae and check if it works for you?

Leonid.

Re: [redsocks] Problem with libevent 2.0

From:
Christian Bayle
Date:
2011-11-28 @ 10:15
Hello,

the patch fixed the problem for http and https
It seems I have got the same kind of problem with

google talk (XMPP/5222) using socks5
strangely the problem doesn't occur with an openfire XMPP server

If I setup a socks5 proxy in the pidgin client the connection is ok 
though very slow to establish
(I measured 75 seconds)


Christian


Le 27/11/2011 01:07, Leonid Evdokimov a écrit :
> On Thu, Nov 24, 2011 at 12:53, Christian Bayle
>> [...]
> iptables-save&  redsocks.conf&  redsocks.log were useful :)
>
> Bin Jin have already fixed the bug in http/http-connect, but I forgot
> to merge his commit. I've finally merged it now.
>
> Can you try release-0.2-4-gdcbdcae and check if it works for you?
>
> Leonid.

Re: [redsocks] Problem with libevent 2.0

From:
Leonid Evdokimov
Date:
2011-12-06 @ 10:26
On Mon, Nov 28, 2011 at 14:15, Christian Bayle
<christian.bayle@orange.com> wrote:
> the patch fixed the problem for http and https
> It seems I have got the same kind of problem with
> google talk (XMPP/5222) using socks5

It looks like different kind of problem, at least the root reason is different.

> strangely the problem doesn't occur with an openfire XMPP server
> If I setup a socks5 proxy in the pidgin client the connection is ok
> though very slow to establish
> (I measured 75 seconds)

So, if I get you right, gtalk is slow in both cases:
1. xmpp-client routed by iptables to redsocks to socks5
2. xmpp-client using socks5

That looks like slow socks5 server. I think, tcpdump of the connection
to socks5 server can confirm that.

--
WBRBW, Leonid Evdokimov
xmpp:leon@darkk.net.ru && http://darkk.net.ru
tel:+79816800702 && tel:+79050965222