librelist archives

« back to archive

Bugs in redsocks ?

Bugs in redsocks ?

From:
Paul Courbis
Date:
2015-08-30 @ 10:02
Hi

I'm running latest revision on Redsocks compiled on a Debian 8.1 64 bits
machine.

I'm having two kinds of bugs :

1/ Sometimes the process uses 100 % of the CPU. The only solution I found
is to kill/restart the process. this happens a few times / day

2/ The process sometimes vanishes. I sometimes get memory-related errors
such as :

*** Error in `/usr/sbin/redsocks': malloc(): memory corruption:
0x0000000000ad1628 ***
*** Error in `/usr/sbin/redsocks': free(): invalid pointer:
0x000000000062ac40 ***
*** Error in `/usr/sbin/redsocks': double free or corruption (fasttop):
0x00000000012b8550 **
*** Error in `/usr/sbin/redsocks': double free or corruption (!prev):
0x000000000181fe20 ***
*** Error in `/usr/sbin/redsocks': corrupted double-linked list:
0x0000000001f51380 ***
.../...

This happens many times a day.

Anyone has a hint to get rid of these issues ?

Thanks

-- 
Paul Courbis

Re: [redsocks] Bugs in redsocks ?

From:
Leonid Evdokimov
Date:
2015-09-07 @ 11:06
On Thu, Aug 27, 2015 at 10:52 AM, Paul Courbis <paul@courbis.com> wrote:
> 1/ Sometimes the process uses 100 % of the CPU. The only solution I found is
> to kill/restart the process

There are two things you can do to help debugging the issue:

*) run `strace -ttt -p $(pidof redsocks) |& tee strace.log` for 5-10
seconds and ^C that afterwards
*) run `gdb --batch  --ex 'set pagination 0' --ex 'thread apply all bt
full' --pid $(pidof redsocks) |& tee gdb.bt.$(date +%s.%N)` for 5-10
times

And fill bug at https://github.com/darkk/redsocks/issues with these
files attacehd.


> 2/ The process sometimes vanishes. I sometimes get memory-related errors
> such as:

Is your installation traffic-heavy? Can you try to run redsocks under
`valgrind` profiling tool to catch memory errors?


> I had a look to the log files but didn't noticed usefull information.
> LogLevel is log_info. Would it help to switch to log_debug ?

Not much. `debug` may be useful to debug protocol


> I use the latest revision of redsocks compiled from sources

In this case it's really useful to send SHA-1 of last commit.
`redsocks -v` should tell it.
redsocks was forked several times, so I can't tell what is the
__latest__ revision: https://github.com/darkk/redsocks/network

You may also want to try redsocks2 that is major rewrite of redsocks
code by Zhuofei Wang: https://github.com/semigodking/redsocks

I'm not heavy redsocks user myself nowadays, that's why development is
almost stopped.


> One again, let me tell you how much I *do* apreciate Redsocks !

Thank you for warm words :-)


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