**Description**
I have installed kamailio 5.6.3(from debian repo) on Debian 12. Try testing with openvas and some case, I saw kamailio crashes.
Mar 19 12:55:45 hostname kamailio[1789359]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f0429907ea0), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_free(323) - ignoring Mar 19 12:55:45 hostname kamailio[1789361]: CRITICAL: <core> [core/mem/q_malloc.c:123]: qm_debug_check_frag(): BUG: qm: fragm. 0x7f0429907ee8 (address 0x7f0429907f20) beginning overwritten (80)! Memory allocator was called from tls: tls_init.c:323. Fragment marked by tls: tls_init.c:293. Exec from core/mem/q_malloc.c:511. Mar 19 12:55:45 hostname kamailio[1789367]: CRITICAL: <core> [core/pass_fd.c:277]: receive_fd(): EOF on 620 Mar 19 12:55:45 hostname kamailio[1788962]: ALERT: <core> [main.c:774]: handle_sigs(): child process 1789361 exited by a signal 6.
Next step, I added option --atexit=no to args - result same.
Next step, I tried to build kamailio 5.7.4 from source and re-run testing, the result was the same - kamailio was crash.
After that, I tried use `tlsa` module instead of `tlsa`, but it not resolve problem.
Backtrace: [kamailio_5.6.3_backtrace_full.txt](https://github.com/kamailio/kamailio/files/14669895/kamailio_5.6.3_backtrace...) [kamailio_5.6.3_backtrace.txt](https://github.com/kamailio/kamailio/files/14669896/kamailio_5.6.3_backtrace...)
**Additional Information**
openssl version
OpenSSL 3.0.11 19 Sep 2023 (Library: OpenSSL 3.0.11 19 Sep 2023)
**Kamailio**:
kamailio -v
version: kamailio 5.6.3 (x86_64/linux) flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: unknown compiled with gcc 12.2.0
kamailio -v
version: kamailio 5.7.4 (x86_64/linux) c717c0 flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: c717c0 compiled on 13:23:19 Mar 20 2024 with gcc 12.2.0
**OS**:
lsb_release -a
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm
uname -a
Linux hostname 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
Thanks for the report. This is could be a known issue with OpenSSL 3.0 e.g. on bookworm. Please try with Kamailio 5.8.0, or even better, the soon to be released 5.8.1. If it still crashes, its probably something that still needs to be fixed in the tls module.
In 5.8 you need to set in global config
tls_threads_mode = 1 #or 2
On Thu, 21 Mar 2024, 03:59 Henning Westerholt via sr-dev, < sr-dev@lists.kamailio.org> wrote:
Thanks for the report. This is could be a known issue with OpenSSL 3.0 e.g. on bookworm. Please try with Kamailio 5.8.0, or even better, the soon to be released 5.8.1. If it still crashes, its probably something that still needs to be fixed in the tls module.
— Reply to this email directly, view it on GitHub https://github.com/kamailio/kamailio/issues/3791#issuecomment-2010488832, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO7UZPZKG6Z6TT7SZECY6TYZHRRVAVCNFSM6AAAAABE73DK6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJQGQ4DQOBTGI . You are receiving this because you are subscribed to this thread.Message ID: kamailio/kamailio/issues/3791/2010488832@github.com _______________________________________________ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-leave@lists.kamailio.org
Closed #3791 as completed.
I've checked with kamailio 5.8.0 and `tls_threads_mode = 1 `, everything work fine! Thank you for help!