Hello,

 

 

Just a follow-up concerning the crash issue when using tlsf memory manager.

I confirm it crashes with Kamailio 5.5.2, standard (without any custom module).

 

The good news is that it doesn’t crash anymore with Kamailio 5.6.3, so the issue must have been fixed since then. :)

 

 

Regards,

Nicolas.

 

De : Henning Westerholt <hw@gilawa.com>
Envoyé : mardi 24 janvier 2023 10:39
À : Chaigneau, Nicolas; sr-dev@lists.kamailio.org
Objet : RE: issues when freeing shared memory in custom module (Kamailio 5.5.2) - available shared memory (follow up), and crash with tlsf

 

This mail has been sent from an external source

Hi Nicolas,

 

thanks for the feedback. 😊 if you observe this crash with a “standard” Kamailio, just create a PR about it on our tracker.

 

Cheers,

 

Henning

 

--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com

 

From: Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com>
Sent: Tuesday, January 24, 2023 10:36 AM
To: Henning Westerholt <hw@gilawa.com>; sr-dev@lists.kamailio.org
Subject: RE: issues when freeing shared memory in custom module (Kamailio 5.5.2) - available shared memory (follow up), and crash with tlsf

 

Hello Henning,

 

 

It seems you’re right. :)

I did tests over the last four days with allocation/release cycles performed every five minutes.

 

During the first two days, the available memory fluctuates, and drops significantly three times.

But after that, it goes up again two times.

 

So it looks like there is no issue in the long term.

I just have to ensure the shared memory size is configured with this is mind.

 

Thanks again for your help !

 

 

 

 

Now about tlsf, maybe there is an issue…

I can reproduce the crash when starting Kamailio with « -x tlsf », and it does not look like the issue is with my code…

Here is the trace in debug before the segfault :

 

0(82419) INFO: <core> [main.c:2139]: main(): private (per process) memory: 8388608 bytes

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 1024) called from core: core/str_hash.h: str_hash_alloc(59)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 1024) returns address 0x7f8983b32110

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 256) called from core: core/str_hash.h: str_hash_alloc(59)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 256) returns address 0x7f8983b32518

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 512) called from core: core/counters.c: init_counters(117)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 512) returns address 0x7f8983b32620

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 128) called from core: core/counters.c: init_counters(125)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 128) returns address 0x7f8983b32828

0(82419) DEBUG: <core> [core/cfg.lex:1964]: pp_define(): defining id: KAMAILIO_5

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 11) called from core: core/cfg.lex: pp_define(1995)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 11) returns address 0x7f8983b328b0

0(82419) DEBUG: <core> [core/cfg.lex:1964]: pp_define(): defining id: KAMAILIO_5_5

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 13) called from core: core/cfg.lex: pp_define(1995)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 13) returns address 0x7f8983b328f0

0(82419) DEBUG: <core> [core/cfg.lex:1964]: pp_define(): defining id: KAMAILIO_5_5_2

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 15) called from core: core/cfg.lex: pp_define(1995)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 15) returns address 0x7f8983b32930

0(82419) INFO: <core> [main.c:2198]: main(): shared memory: 268435456 bytes

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 16) called from core: core/route.c: init_rlist(146)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 16) returns address 0x7f8983b32970

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 128) called from core: core/str_hash.h: str_hash_alloc(59)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 128) returns address 0x7f8983b329b0

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1232]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 48) called from core: core/route.c: route_add(124)

0(82419) DEBUG: <core> [core/mem/tlsf_malloc.c:1234]: tlsf_malloc(): tlsf_malloc(0x7f8983b30010, 48) returns address 0x7f8983b32a38

0(82419) DEBUG: <core> [core/route.c:129]: route_add(): mapping routing block (0x9bf900)[0] to 0

Segmentation fault

 

 

 

Regards,

Nicolas.

 

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.