[squid-users] Significant memory leak with version 5.x (not with 4.17)

Loučanský Lukáš Loucansky.Lukas at kjj.cz
Thu Jan 13 15:37:39 UTC 2022


Hello,
my squid 5.3 with 957 patch runs for 6 days now - so everything seems ok. 

	Maximum Resident Size: 3798688 KB
Memory accounted for:
	Total accounted:       326687 KB

But - I'd like to ask if I'm doing anything wrong. Am I correct when I think, that patch #957 is not backported/merged to tunnel.cc for v5.3 at the git repo v5 branch? Neither in the squid-5.3-20220112-r8ac83ed55 build avaible at the squid cache web page? But tunnel.cc file in the master (v6) branch is patched? As there is a "small" warning not to use v6 in production - I'd like to ask if is it wise to modify tunnel.cc file like I did it in my current 5.3-20211214-r832aa256c. Or it would be better to switch to git master branch. 

But FYI I had a compilation error due -wshadow option:

XactionRep.cc  -fPIC -DPIC -o .libs/libecapsquid_la-XactionRep.o
XactionRep.cc: In member function ‘const libecap::Area Adaptation::Ecap::XactionRep::masterxSharedValue(const libecap::Name&) const’:
XactionRep.cc:174:20: error: declaration of ‘String name’ shadows a parameter [-Werror=shadow]
             String name, value;
                    ^~~~
XactionRep.cc:166:71: note: shadowed declaration is here
 Adaptation::Ecap::XactionRep::masterxSharedValue(const libecap::Name &name) const
                                                  ~~~~~~~~~~~~~~~~~~~~~^~~~
XactionRep.cc: In member function ‘void Adaptation::Ecap::XactionRep::updateHistory(Http::Message*)’:
XactionRep.cc:486:33: error: declaration of ‘services’ shadows a previous local [-Werror=shadow]
         if (const libecap::Area services = theMaster->option(libecap::metaNextServices)) {
                                 ^~~~~~~~
XactionRep.cc:485:16: note: shadowed declaration is here
         String services;
                ^~~~~~~~
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-unused-private-field’ [-Werror]


gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6)

Description:    Debian GNU/Linux 10 (buster)

I have noticed differences in the configure.ac file between v5 and v6 branches.But the file src/adaptation/ecap/XactionRep.cc is the same. My configure command line is the same for both versions. So I commented out #SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wshadow]) in the configure.ac and run bootstrap, config, make again.

After that - squid is compiled without any problems:
./squid -v
Squid Cache: Version 6.0.0-VCS
Service Name: squid
v6 master

This binary uses OpenSSL 1.1.1d  10 Sep 2019. For legal restrictions on distribution see https://www.openssl.org/source/license.html

configure options:  '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/include' '--mandir=/share/man' '--infodir=/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=/lib/squid5' '--disable-maintainer-mode' '--disable-silent-rules' '--datadir=/usr/share/squid5' '--sysconfdir=/etc/squid5' '--mandir=/usr/share/man' '--enable-build-info=v6 master' '--enable-inline' '--enable-arp-acl' '--disable-wccp' '--disable-wccp2' '--disable-htcp--disable-arch-native' '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-icap-client' '--enable-follow-x-forwarded-for' '--enable-auth-basic=DB,fake,getpwnam,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper' '--enable-auth-ntlm=fake,SMB_LM' '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,time_quota,unix_group,wbinfo_group' '--enable-url-rewrite-helpers=fake' '--enable-security-cert-validators=fake' '--enable-storeid-rewrite-helpers=file' '--enable-eui' '--enable-esi' '--enable-icmp' '--enable-zph-qos' '--enable-ecap' '--enable-snmp' '--disable-ident-lookups' '--disable-translation' '--with-swapdir=/var/spool/squid5' '--with-logdir=/var/log/squid5' '--with-pidfile=/var/run/squid5.pid' '--with-large-files' '--with-default-user=proxy' '--with-openssl' '--with-filedescriptors=8192' '--enable-ssl-crtd' '--enable-security-cert-generators' '--enable-security-cert-validators' '--enable-linux-netfilter' '--enable-stacktraces' 'PKG_CONFIG_PATH=:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig' 'CFLAGS=-g -O2 -m64 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'LDFLAGS=-fPIE -pie -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -m64 -fPIE -fstack-protector-strong -Wformat -Werror=format-security' 'build_alias=x86_64-linux-gnu'

Sorry for a little thread hijack, but I'd like to confirm that the patch 957 seems to work and ask for advice about v5 brach on the github vs v6/master.

THX
LL


More information about the squid-users mailing list