Hi, We are currently in the process of updating our docker containers to using Ubuntu 22.04 as their base image. After updating kamailio has started randomly crashing, with the following error:
17(28) CRITICAL: <core> [core/pass_fd.c:281]: receive_fd(): EOF on 18 0(8) ALERT: <core> [main.c:805]: handle_sigs(): child process 16 exited by a signal 11 0(8) ALERT: <core> [main.c:809]: handle_sigs(): core was generated 0(8) INFO: <core> [main.c:832]: handle_sigs(): terminating due to SIGCHLD 4(15) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 3(14) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 1(12) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 8(19) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 6(17) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 9(20) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 10(21) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 15(26) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 16(27) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 13(24) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 14(25) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 12(23) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 7(18) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 11(22) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 2(13) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 17(28) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 0(8) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized INFO:Supervisor:Kamailio exited with code: 1
Any pointers as to what could be causing this issue would be appreciated. One suspicion is that it may be related to ubuntu 22.04 upgrading OpenSSL to V3. I have played around with the new modparam("tls", "init_mode", 1), though this hasn't seemed to help. Let me know if looking at our kamailio.cfg/tls.cfg files would be of use. Thanks, Oisin
Hello,
for libssl/openssl v3.x, you have to use latest kamailio 5.8.x for proper compatibility (5.7.x has some limited support, therefore 5.8.x is highly recommended). Be also sure you set tls_threads_mode=2 and --atexit=no. See:
- https://www.kamailio.org/docs/modules/devel/modules/tls.html#tls.notes
Cheers, Daniel
On 15.01.25 04:23, oisin.roberts--- via sr-dev wrote:
Hi, We are currently in the process of updating our docker containers to using Ubuntu 22.04 as their base image. After updating kamailio has started randomly crashing, with the following error:
17(28) CRITICAL: <core> [core/pass_fd.c:281]: receive_fd(): EOF on 18 0(8) ALERT: <core> [main.c:805]: handle_sigs(): child process 16 exited by a signal 11 0(8) ALERT: <core> [main.c:809]: handle_sigs(): core was generated 0(8) INFO: <core> [main.c:832]: handle_sigs(): terminating due to SIGCHLD 4(15) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 3(14) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 1(12) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 8(19) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 6(17) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 9(20) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 10(21) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 15(26) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 16(27) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 13(24) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 14(25) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 12(23) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 7(18) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 11(22) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 2(13) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 17(28) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 0(8) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized INFO:Supervisor:Kamailio exited with code: 1
Any pointers as to what could be causing this issue would be appreciated. One suspicion is that it may be related to ubuntu 22.04 upgrading OpenSSL to V3. I have played around with the new modparam("tls", "init_mode", 1), though this hasn't seemed to help. Let me know if looking at our kamailio.cfg/tls.cfg files would be of use. Thanks, Oisin _______________________________________________ Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org To unsubscribe send an email to sr-dev-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
Hi Daniel, Thanks for your reply. We were already using version 5.8.4, and running with "--no-exit". After setting tls_threads_mode=2 we are still getting a crash. Apologies, I had left part of the error log out in my initial comment, but it seems the error is python related: as you can see in the full error log, a Fatal Python error is thrown.
Fatal Python error: PyEval_SaveThread: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL) Python runtime state: initialized
Current thread 0x00007039248eb740 (most recent call first):
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 1431 in _load_key File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 1218 in load_pem_private_key File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/serialization/base.py", line 20 in load_pem_private_key File "/usr/local/lib/python3.10/dist-packages/jwt/algorithms.py", line 343 in prepare_key File "/usr/local/lib/python3.10/dist-packages/jwt/api_jws.py", line 325 in _verify_signature File "/usr/local/lib/python3.10/dist-packages/jwt/api_jws.py", line 220 in decode_complete File "/usr/local/lib/python3.10/dist-packages/jwt/api_jwt.py", line 156 in decode_complete File "/usr/local/lib/python3.10/dist-packages/jwt/api_jwt.py", line 222 in decode File "/etc/kamailio/python/handler.py", line 475 in check_auth_tokens File "/etc/kamailio/python/handler.py", line 381 in authenticate_registration
Extension modules: Router, KSR, Router.Core, Router.Logger, Router.Ranks, KSR.pv, KSR.x, _cffi_backend (total: 8) 17(26) CRITICAL: <core> [core/pass_fd.c:281]: receive_fd(): EOF on 22 0(8) ALERT: <core> [main.c:805]: handle_sigs(): child process 19 exited by a signal 6 0(8) ALERT: <core> [main.c:809]: handle_sigs(): core was generated 0(8) INFO: <core> [main.c:832]: handle_sigs(): terminating due to SIGCHLD 2(11) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 5(14) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 4(13) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 3(12) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 8(17) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 12(21) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 15(24) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 16(25) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 17(26) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 9(18) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 13(22) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 11(20) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 14(23) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 1(10) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 6(15) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 7(16) INFO: <core> [main.c:888]: sig_usr(): signal 15 received 0(8) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized INFO:Supervisor:Kamailio exited with code: 1