Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2022 17:14:38 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 262743] Memory leak in security/strongswan's charon daemon when communicating over vici socket.
Message-ID:  <bug-262743-227-KKrmgHOuIX@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-262743-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-262743-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262743

--- Comment #5 from Micha=C5=82 Skalski <mskalski13@gmail.com> ---
Thank you very much for the clues


(In reply to Mark Millard from comment #4)

Yes, using default value 12 (I used stock qemu VM image):

    # sysctl vm.pageout_oom_seq
    vm.pageout_oom_seq: 12




(In reply to Kubilay Kocak from comment #3)


Result of `uname -a` (vm image FreeBSD-13.1-RELEASE)|

    FreeBSD freebsd 13.1-RELEASE FreeBSD 13.1-RELEASE
releng/13.1-n250148-fc952ac2212 GENERIC  amd64


and the same is for:

    FreeBSD freebsd 13.1-RELEASE FreeBSD 13.1-RELEASE
releng/13.1-n250148-fc952ac2212 GENERIC  arm64


Indeed, the packaged version (strongswan-5.9.6_2, either installed from bin=
ary
package or built from ports) behaves different. Still memory usage increase=
s,
but only RSS one (VMS does not change in observable period) and in much low=
er
scale, raise is rather logarithmic than linear.

I compared then configure options for strongswan port and among other
differences `--with-printf-hooks=3Dbuiltin` option is specified by default =
for
the port version.=20


So I tested again sources of strongswan 5.9.6 - the same as used for ports =
and
when the strongswan is configured with:

    ./configure --disable-kernel-netlink --enable-kernel-pfroute
--enable-kernel-pfkey --disable-gmp --enable-openssl \
                --enable-mediation --disable-scripts --with-group=3Dwheel
--enable-gcm --enable-ccm --enable-pkcs11 \
                --with-printf-hooks=3Dbuiltin


(only `--with-printf-hooks=3Dbuiltin` is added) the memory usage is similar=
 to
packaged version even for unpatched original sources. Without this option (=
or
when port version is compiled with `libc` printf-hook which I believe is
default one) memory usage raises quickly as in this bug report.


I must have missed that on previous tests, I didn't notice that VMS does not
rise, and RSS raises on much smaller scale.
Also checked for `printf-hooks=3Dvstr` and it is memory usage increase is
slightly bigger than for `builtin`, but still VMS is constant.

I'm still not sure if for `printf-hooks=3Dbuiltin` memory does not raise too
much, I will check it.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-262743-227-KKrmgHOuIX>