tempesta icon indicating copy to clipboard operation
tempesta copied to clipboard

Memory leak found in ping flood

Open kingluo opened this issue 1 year ago • 0 comments

Motivation

Fix memory leak caused by TLS errors in ping floods https://github.com/tempesta-tech/tempesta/issues/2117.

Scope

You can observe memory leaks by running a golang h2 test program and waiting for error cases. In my environment (4 CPU, 4 GB memory, two VMs), after the test the memory increased from 20% to 30%, which means a 10% memory leak.

./ping_flood -address 192.168.2.1:443 -threads 1 -connections 10 -debug 1

log:

[ 3824.299249] net_ratelimit: 1459 callbacks suppressed
[ 3824.299252] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.304515] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.310823] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.385908] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.389382] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.393002] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.396539] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.400946] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.405525] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3824.409623] [tempesta tls] Warning: [::ffff:192.168.2.2] TLS cannot decrypt msg on state Handshake Over, ret=-74(bad ciphertext)
[ 3837.658748] net_ratelimit: 871 callbacks suppressed
[ 3837.659059] [tempesta tls] Warning: bad TLS version 12:23
[ 3837.659200] [tempesta tls] Warning: [::ffff:192.168.2.2] Bad TLS record (err -0xFFFFF004)
[ 3837.660977] [tempesta tls] Warning: bad TLS version 12:23
[ 3837.661152] [tempesta tls] Warning: [::ffff:192.168.2.2] Bad TLS record (err -0xFFFFF004)
[ 3837.661401] [tempesta tls] Warning: bad TLS version 12:23
[ 3837.661569] [tempesta tls] Warning: [::ffff:192.168.2.2] Bad TLS record (err -0xFFFFF004)
[ 3837.662657] [tempesta tls] Warning: bad TLS version 12:23
[ 3837.662846] [tempesta tls] Warning: [::ffff:192.168.2.2] Bad TLS record (err -0xFFFFF004)
[ 3837.663054] [tempesta tls] Warning: bad TLS version 12:23
[ 3837.663241] [tempesta tls] Warning: [::ffff:192.168.2.2] Bad TLS record (err -0xFFFFF004)

kingluo avatar Jun 25 '24 10:06 kingluo