Project

General

Profile

Issue #3274

Memory leak in charon process

Added by Fabrice BARCONNIERE 9 months ago. Updated 9 months ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Category:
-
Affected version:
5.6.2
Resolution:

Description

Used memory rises until server swaps.
Context :
  • Distribution : EOLE 2.7.1 (Ubuntu server 18.04 - Linux sphynx 4.15.0-69-generic #78-Ubuntu)
  • strongswan 5.6.2-1ubuntu
  • charon.conf - log level 2 for daemon and auth (default and ike) with syslog configuration
  • Servers
    • aca.sphynx (strongswan 5.6.2)
    • etb1.amon (strongswan 5.6.2)
    • etb2.amon (strongswan 5.6.2)
    • etb3.amonecole (strongswan 5.3.5 - EOLE 2.6.2 on Ubuntu 16.04)
  • Site to site configurations : ipsec.conf example on aca.sphynx
    • I have set lower values to rekey parameters to accelerate memory rise up
          ikelifetime = 15m
          lifetime = 5m
          margintime = 1m
      

Here is the memory informations from ipsec statusall every 90s on aca.sphynx

nov. 19 10:13:25   malloc: sbrk 5406720, mmap 532480, used 2261408, free 3145312
nov. 19 10:14:55   malloc: sbrk 5406720, mmap 532480, used 2267424, free 3139296
nov. 19 10:16:25   malloc: sbrk 5406720, mmap 532480, used 2403232, free 3003488
nov. 19 10:17:55   malloc: sbrk 5533696, mmap 532480, used 2417360, free 3116336
nov. 19 10:19:25   malloc: sbrk 5533696, mmap 532480, used 2456768, free 3076928
nov. 19 10:20:55   malloc: sbrk 5533696, mmap 532480, used 2496800, free 3036896
nov. 19 10:22:26   malloc: sbrk 5533696, mmap 532480, used 2506288, free 3027408
nov. 19 10:23:56   malloc: sbrk 5533696, mmap 532480, used 2531472, free 3002224
nov. 19 10:25:26   malloc: sbrk 5537792, mmap 532480, used 2535072, free 3002720
nov. 19 10:26:56   malloc: sbrk 5545984, mmap 532480, used 2601888, free 2944096
nov. 19 10:28:26   malloc: sbrk 5545984, mmap 532480, used 2600048, free 2945936
nov. 19 10:29:56   malloc: sbrk 5554176, mmap 532480, used 2623392, free 2930784
nov. 19 10:31:26   malloc: sbrk 5554176, mmap 532480, used 2625008, free 2929168
nov. 19 10:32:56   malloc: sbrk 5562368, mmap 532480, used 2639296, free 2923072
nov. 19 10:34:26   malloc: sbrk 5562368, mmap 532480, used 2646704, free 2915664
nov. 19 10:35:56   malloc: sbrk 5570560, mmap 532480, used 2648768, free 2921792
nov. 19 10:37:26   malloc: sbrk 5570560, mmap 532480, used 2652576, free 2917984
nov. 19 10:38:56   malloc: sbrk 5574656, mmap 532480, used 2674192, free 2900464
nov. 19 10:40:26   malloc: sbrk 5578752, mmap 532480, used 2679040, free 2899712

We can see the memory used rising.

Here is the memory informations from ipsec statusall every 90s on etb3.amonecole

nov. 19 10:12:35   malloc: sbrk 5259264, mmap 532480, used 1100576, free 4158688
nov. 19 10:14:05   malloc: sbrk 5259264, mmap 532480, used 1100624, free 4158640
nov. 19 10:15:36   malloc: sbrk 5259264, mmap 532480, used 1100624, free 4158640
nov. 19 10:17:06   malloc: sbrk 5259264, mmap 532480, used 1100464, free 4158800
nov. 19 10:18:37   malloc: sbrk 5259264, mmap 532480, used 1100464, free 4158800
nov. 19 10:20:07   malloc: sbrk 5259264, mmap 532480, used 1100448, free 4158816
nov. 19 10:21:37   malloc: sbrk 5259264, mmap 532480, used 1100448, free 4158816
nov. 19 10:23:08   malloc: sbrk 5259264, mmap 532480, used 1100528, free 4158736
nov. 19 10:24:39   malloc: sbrk 5259264, mmap 532480, used 1100592, free 4158672
nov. 19 10:26:09   malloc: sbrk 5259264, mmap 532480, used 1100640, free 4158624
nov. 19 10:27:39   malloc: sbrk 5259264, mmap 532480, used 1100880, free 4158384
nov. 19 10:29:10   malloc: sbrk 5259264, mmap 532480, used 1100768, free 4158496
nov. 19 10:30:40   malloc: sbrk 5259264, mmap 532480, used 1100592, free 4158672
nov. 19 10:32:10   malloc: sbrk 5259264, mmap 532480, used 1100592, free 4158672
nov. 19 10:33:40   malloc: sbrk 5259264, mmap 532480, used 1100624, free 4158640
nov. 19 10:35:11   malloc: sbrk 5259264, mmap 532480, used 1100592, free 4158672
nov. 19 10:36:42   malloc: sbrk 5259264, mmap 532480, used 1100624, free 4158640
nov. 19 10:38:13   malloc: sbrk 5259264, mmap 532480, used 1100592, free 4158672
nov. 19 10:39:43   malloc: sbrk 5259264, mmap 532480, used 1100576, free 4158688
nov. 19 10:41:14   malloc: sbrk 5259264, mmap 532480, used 1100576, free 4158688

The memory used remains constant.

Even if i set reauth and rekey to no for all connections on all servers, the memory used keep rises but slowly.

Here is charon log file extract on aca.sphynx : charon.info.log

charon.conf (1.17 KB) charon.conf Fabrice BARCONNIERE, 19.11.2019 10:11
ipsec.conf (16.5 KB) ipsec.conf Fabrice BARCONNIERE, 19.11.2019 10:11
charon.info.log (4.98 MB) charon.info.log Fabrice BARCONNIERE, 19.11.2019 10:53

History

#1 Updated by Tobias Brunner 9 months ago

  • Status changed from New to Feedback

Sorry, can't really help you with that. You need to debug that further (e.g. with our own leak detective, i.e. --enable-leak-detective, which doesn't show any leaks in our testing environment, by the way, or e.g. with valgrind).

By the way, your log levels are way too verbose (and multiple, redudant loggers seem to be active).

Also available in: Atom PDF