[PYTHON] Possible bugs revealed by socket_wrapper

Andreas Schneider asn at samba.org
Mon Nov 12 17:42:48 UTC 2018


Hi,

we have socket_wrapper 1.2.0 with threading support ready. So I've pushed the 
changes to the gitlab CI to see if everything is working.

It doesn't work and revealed some bugs :-)

New in socket_wrapper 1.2.0 is that we have a default limit of handling 65535 
open sockets! This can be increased if needed. However if we try to setup the 
chgdcpass environment samba-tool wants to open 1 million sockets!

It is running:

python ./bin/samba-tool domainprovision --configfile=/home/gitlab-runner/
samba/st/chgdcpass/etc/smb.conf --host-name=chgdcpass --host-ip=127.0.0.32 --
quiet --domain=CHDCDOMAIN --realm=CHGDCPASSWORD.SAMBA.EXAMPLE.COM --domain-
sid=S-1-5-21-1879926001-2232171230-2460190490 --adminpass=chgDCpass1 --
krbtgtpass=krbtgtchgDCpass1 --machinepass=machinechgDCpass1 --root=gitlab-
runner --server-role=domain controller --function-level=2008 --dns-
backend=BIND9_DLZ

Which after some time starts to report that it reached the limit!

...
SWRAP_ERROR[python (20259)] - find_socket_info_index: The max socket index 
limit of 65535 has been reached, trying to add 65855
SWRAP_ERROR[python (20259)] - find_socket_info_index: The max socket index 
limit of 65535 has been reached, trying to add 65856
...


This is either a python bug in Ubuntu 14.04 leaking file descriptors (sockets) 
or an issue with our code and that python version.



	I'm not able to reproduce this locally on a modern Linux system, Fedora 29!




Reproducer:
docker run -ti registry.gitlab.com/samba-team/samba:latest /bin/bash

sudo -i
apt-get install tmux
logout

tmux
git clone git://git.samba.org/asn/samba.git
cd samba
git checkout master-swrap
./configure --enable-developer
make -j8

make -j8 testenv SELFTEST_TESTENV=chgdcpass SCREEN=1



-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D





More information about the samba-technical mailing list