[Bug 262743] Memory leak in security/strongswan's charon daemon when communicating over vici socket.

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 08 Aug 2022 15:35:30 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262743

--- Comment #7 from MichaƂ Skalski <mskalski13@gmail.com> ---
OK, thank you very much for all the help.

The problem was wrong (missing) `--with-printf-hooks=builtin` option for
configure script. 

To be sure, I made longer (1.5 week lasting) tests with more strongswan's
daemon `charon` stressing.

I configured few tunnels with short lifetime and started executing stressing
tests like below:

     sh -c 'while :; do swanctl -l >/dev/null && swanctl -L >/dev/null &&
swanctl -x >/dev/null || sleep 10; done'

which lists all SAs, all configured tunnels and all certificates in an endless
loop.

Results show that during time some memory (RSS) footprint increases over the
time, but when memory is needed strongswan )or system) drops unused memory.
And indeed first few minutes memory increase is quite large, which made me
think `printf-hook=builtin` option does not work at all.

Attaching new shell script used for memory tracking using only `ps` (also
`printf` and `date`) command and doesn't need python, adding also logs from
this test and graph generated by gnuplot (gnuplot's script below).


    #!/usr/bin/env gnuplot

    set style line 1 linecolor rgb '#0060ad' linetype 1 linewidth 2 pointtype 7
pointsize 0.5

    set xdata time
    set xlabel '[Time]'
    set ylabel '[MB]'

    plot 'charon_mem.log' using ($1):($5/1024) with linespoints linestyle 1
title columnhead(4)



So the issue may be closed.

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