<!-- Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio....
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.or...
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months if there is no interest from developers or community users on pursuing it, being considered expired. In such case, it can be reopened by writing a comment that includes the token `/notexpired`. About two weeks before considered expired, the issue is marked with the label `stale`, trying to notify the submitter and everyone else that might be interested in it. To remove the label `stale`, write a comment that includes the token `/notstale`. Also, any comment postpone the `expire` timeline, being considered that there is interest in pursuing the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment). -->
### Description Kamailio chrashes on startup when set init_mode to 1. Seems to be introduced with 4b068f49b618dca5fa85a1687bd9054c1d98ae6a
<!-- Explain what you did, what you expected to happen, and what actually happened. -->
### Troubleshooting
#### Reproduction
modparam("tls", "init_mode", 1)
<!-- If the issue can be reproduced, describe how it can be done. -->
#### Debugging Data
<!-- If you got a core dump, use gdb to extract troubleshooting data - full backtrace, local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile bt full info locals list
If you are familiar with gdb, feel free to attach more of what you consider to be relevant. -->
``` #0 ___pthread_mutex_lock (mutex=0x0) at ./nptl/pthread_mutex_lock.c:80 #1 0x00007f9e93510614 in ser_malloc (size=56, fname=<optimized out>, fline=<optimized out>) at ./src/modules/tls/tls_init.c:388 #2 0x00007f9e93031b59 in CRYPTO_zalloc (num=num@entry=56, file=file@entry=0x7f9e9317563d "../crypto/threads_pthread.c", line=line@entry=50) at ../crypto/mem.c:197 #3 0x00007f9e9303dedf in CRYPTO_THREAD_lock_new () at ../crypto/threads_pthread.c:50 #4 0x00007f9e93030ad9 in ossl_init_base () at ../crypto/init.c:64 #5 ossl_init_base_ossl_ () at ../crypto/init.c:55 #6 0x00007f9e97affea7 in __pthread_once_slow (once_control=0x7f9e9327edcc <base>, init_routine=0x7f9e93030ad0 <ossl_init_base_ossl_>) at ./nptl/pthread_once.c:116 #7 0x00007f9e97afff85 in ___pthread_once (once_control=<optimized out>, init_routine=<optimized out>) at ./nptl/pthread_once.c:143 #8 0x00007f9e9303dfc9 in CRYPTO_THREAD_run_once (once=once@entry=0x7f9e9327edcc <base>, init=init@entry=0x7f9e93030ad0 <ossl_init_base_ossl_>) at ../crypto/threads_pthread.c:154 #9 0x00007f9e93030d48 in OPENSSL_init_crypto (opts=opts@entry=131148, settings=settings@entry=0x0) at ../crypto/init.c:507 #10 0x00007f9e93473a21 in OPENSSL_init_ssl (opts=131148, opts@entry=131072, settings=settings@entry=0x0) at ../ssl/ssl_init.c:115 #11 0x00007f9e93511f44 in tls_h_mod_pre_init_f () at ./src/modules/tls/tls_init.c:779 #12 0x000055c792122571 in main (argc=<optimized out>, argv=0x7ffd43d1a338) at ./src/main.c:3174 ```
#### Log Messages
<!-- Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site). -->
``` [ 1803.304680] kamailio[7700]: segfault at 10 ip 00007fe7b62c91c0 sp 00007ffd499a0db8 error 4 in libc.so.6[7fe7b6263000+155000] likely on CPU 1 (core 0, socket 1) [ 1803.304698] Code: 30 11 00 ba c2 01 00 00 48 8d 35 47 ad 10 00 48 8d 3d 55 ad 10 00 e8 3f 8c fa ff e8 4a bd 08 00 66 2e 0f 1f 84 00 00 00 00 00 <8b> 47 10 89 c2 81 e2 7f 01 00 00 83 e0 7c 0f 85 ac 00 00 00 53 48 ``` ### Additional Information
* **Kamailio Version** - output of `kamailio -v` ``` version: kamailio 5.7.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, 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: unknown compiled with gcc 12.2.0 ```
``` version: kamailio 5.8.0-dev2 (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, 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_SEND_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 ```
* **Operating System**:
<!-- Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...; Kernel details (output of `lsb_release -a` and `uname -a`) -->
``` % cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" ```