<!--
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:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot 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
I get SIGSEGV in the start-up time with the wrong kamailio config.
To get a backtrace, I set up gdb:
```
gdb --args /home/devel/build_dir/build/sbin/kamailio -m 8 -n 1 -w . -f /tmp/kamailio.cfg
(gdb) start
(gdb) c
```
Then I see the error and the gdb output (attached below).
### Troubleshooting
#### Reproduction
Pass to `ds_select_domain` non-constant value, e.g.
```
$avp(num) = 13;
if (!ds_select_domain( 101, 4, $avp(num) )) {
return 1;
}
```
#### Debugging Data
```
Program received signal SIGSEGV, Segmentation fault.
0x00000000006a1daf in rve_destroy (rve=0x6f6c5f7265766f6c) at core/rvalue.c:147
147 if (rve->op==RVE_RVAL_OP){
Missing separate debuginfos, use: debuginfo-install audit-libs-2.8.5-4.el7.x86_64 bzip2-libs-1.0.6-13.el7.x86_64 elfutils-libelf-0.176-4.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-46.el7.x86_64 libacl-2.2.51-15.el7.x86_64 libattr-2.4.46-13.el7.x86_64 libcap-2.22-11.el7.x86_64 libcap-ng-0.7.5-4.el7.x86_64 libcom_err-1.42.9-17.el7.x86_64 libdb-5.3.21-25.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libselinux-2.5-15.el7.x86_64 libstdc++-4.8.5-39.el7.x86_64 lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64 lua-5.1.4-15.el7.x86_64 net-snmp-agent-libs-5.7.2-48.el7_8.1.x86_64 net-snmp-libs-5.7.2-48.el7_8.1.x86_64 nspr-4.21.0-1.el7.x86_64 nss-3.44.0-7.el7_7.x86_64 nss-softokn-freebl-3.44.0-8.el7_7.x86_64 nss-util-3.44.0-4.el7_7.x86_64 openssl-libs-1.0.2k-19.el7.x86_64 pcre-8.32-17.el7.x86_64 perl-libs-5.16.3-295.el7.x86_64 popt-1.13-16.el7.x86_64 rpm-libs-4.11.3-43.el7.x86_64 tcp_wrappers-libs-7.6-77.el7.x86_64 xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-18.el7.x86_64
(gdb) bt
#0 0x00000000006a1daf in rve_destroy (rve=0x6f6c5f7265766f6c) at core/rvalue.c:147
#1 0x00000000006a266e in rve_destroy (rve=0x7ffff6c77f08) at core/rvalue.c:168
#2 0x00000000007d2884 in free_mod_func_action (a=0x7ffff6c76658) at core/cfg.y:4047
#3 0x00000000007ce97f in yyparse () at core/cfg.y:3459
#4 0x000000000042f396 in main (argc=9, argv=0x7fffffffe448) at main.c:2320
(gdb) p rve
$1 = (struct rval_expr *) 0x6f6c5f7265766f6c
(gdb) p rve->op
Cannot access memory at address 0x6f6c5f7265766f6c
(gdb)
```
#### 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).
-->
```
0(425) CRITICAL: <core> [core/cfg.y:3589]: yyerror_at(): parse error in config file /tmp/kamailio.cfg, line 653, column 58-66: function ds_select_domain: parameter 3 is not constant
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.4.3 (x86_64/linux) 430602
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_BLACKLIST, HAVE_RESOLV_RES
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: 430602
compiled on 17:40:07 Jan 29 2021 with gcc 4.8.5
```
* **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 `uname -a`)
-->
```
(paste your output here)
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2630
Module: kamailio
Branch: master
Commit: 5ad3bd2f72515c532ef004adfd9cebaf4e483105
URL: https://github.com/kamailio/kamailio/commit/5ad3bd2f72515c532ef004adfd9ceba…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2021-02-11T17:46:11+01:00
modules: readme files regenerated - htable ... [skip ci]
---
Modified: src/modules/htable/README
---
Diff: https://github.com/kamailio/kamailio/commit/5ad3bd2f72515c532ef004adfd9ceba…
Patch: https://github.com/kamailio/kamailio/commit/5ad3bd2f72515c532ef004adfd9ceba…
---
diff --git a/src/modules/htable/README b/src/modules/htable/README
index ca193e2213..85f19c7102 100644
--- a/src/modules/htable/README
+++ b/src/modules/htable/README
@@ -1165,6 +1165,16 @@ kamcmd htable.stats
items in hash tables. The event route is executed only once, after core
and module initialization, but before Kamailio forks any child
processes.
+
+ Note: do not expect to use functions from all other modules here, even
+ if they are loaded before the htable module, because many of them
+ initialize their runtime structures inside child init callbacks, which
+ are executed after this moment, when forking child processes. For
+ example, sqlops cannot be used, connections to database are initialized
+ in child init. Even more, it is recommended not to use functions from
+ other modules, because it can mess up what they created in mod init
+ callback and expect in child init callback. It should be ok to use
+ functions from htable module or assignment operations.
...
event_route[htable:mod-init] {
$sht(a=>x) = 1;
### Description
I would like to use `http_async_query` and after enabling the module, I notice Kamailio's main process crashes on exit or restart. I have searched and find a number of tickets regarding http_async and crashes, but none related to exit/restart.
### Troubleshooting
```
# coredumpctl info 410246
PID: 410246 (kamailio)
UID: 985 (kamailio)
GID: 983 (kamailio)
Signal: 11 (SEGV)
Timestamp: Mon 2021-02-01 00:28:29 CST (11h ago)
Command Line: /usr/sbin/kamailio -DD --loadmodule=systemdops.so -m 128 -M 8
Executable: /usr/sbin/kamailio
Control Group: /system.slice/kamailio.service
Unit: kamailio.service
Slice: system.slice
Boot ID: 88a3838cfde647a29b3bd62f1e294ce2
Machine ID: e71248e5a94b42069b4603dde95c99b4
Storage: /var/lib/systemd/coredump/core.kamailio.985.88a3838cfde647a29b3bd62f1e294ce2.410246.1612160909000000.zst
Message: Process 410246 (kamailio) of user 985 dumped core.
Stack trace of thread 410246:
#0 0x00007fd57d84383a BN_clear_free (libcrypto.so.1.1 + 0xb183a)
#1 0x00007fd573f9d275 ssh_dh_finalize.part.0 (libssh.so.4 + 0x1e275)
#2 0x00007fd573f8ec40 libssh_destructor (libssh.so.4 + 0xfc40)
#3 0x00007fd57ead8cd3 _dl_fini (ld-linux-x86-64.so.2 + 0x10cd3)
#4 0x00007fd57e7a4237 __run_exit_handlers (libc.so.6 + 0x40237)
#5 0x00007fd57e7a43e0 exit (libc.so.6 + 0x403e0)
#6 0x000000000041f61a handle_sigs (kamailio + 0x1f61a)
#7 0x000000000042c61c main_loop (kamailio + 0x2c61c)
#8 0x0000000000434cbd main (kamailio + 0x34cbd)
#9 0x00007fd57e78c1e2 __libc_start_main (libc.so.6 + 0x281e2)
#10 0x000000000041bbde _start (kamailio + 0x1bbde)
```
#### Reproduction
This happens at every kamailio shutdown.
#### 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.
-->
[gdb.txt](https://github.com/kamailio/kamailio/files/5905920/gdb.txt)
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.4.3-5.git06bd17a838.fc33.2 (x86_64/linux) e19ae3
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_BLACKLIST, 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: e19ae3
compiled on 00:00:00 Jan 24 2021 with gcc 10.2.1
```
* **Operating System**:
```
Linux 5.10.10-200.fc33.x86_64 #1 SMP Sun Jan 24 19:58:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2616
Module: kamailio
Branch: master
Commit: 9e5cdf01683080af6e0c8054761fa4b2ba444242
URL: https://github.com/kamailio/kamailio/commit/9e5cdf01683080af6e0c8054761fa4b…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2021-02-11T16:46:25+01:00
modules: readme files regenerated - rr ... [skip ci]
---
Modified: src/modules/rr/README
---
Diff: https://github.com/kamailio/kamailio/commit/9e5cdf01683080af6e0c8054761fa4b…
Patch: https://github.com/kamailio/kamailio/commit/9e5cdf01683080af6e0c8054761fa4b…
---
diff --git a/src/modules/rr/README b/src/modules/rr/README
index 6ec187d113..4225d0dc37 100644
--- a/src/modules/rr/README
+++ b/src/modules/rr/README
@@ -593,9 +593,9 @@ record_route_advertised_address("1.2.3.4:5080");
Adds a parameter to the Record-Route URI (param must be in
“;name=value” format. The function may be called also before or after
- the record_route() or record_route_advertised_address() calls (see
- Section 5.4, “record_route([sparams])” or Section 5.7,
- “record_route_advertised_address(address)”)).
+ the record_route(), record_route_advertised_address(), and
+ record_route_preset() calls (see Section 5.4, “record_route([sparams])”
+ or Section 5.7, “record_route_advertised_address(address)”)).
Meaning of the parameters is as follows:
* param - String containing the URI parameter to be added. It must
<!--
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:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot 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 crashes on launch with TLS enabled on both Ubuntu 20.04 and Debian Buster.
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
1. cloned `https://github.com/kamailio/kamailio`
2. checked out `5.4`
3. make cfg
4. include_modules=app_python3 crypto db_mongodb
db_postgres dialplan http_async_client
http_client jansson json jsonrpcc log_systemd
outbound regex tls utils xcap_client xhttp_pi
uuid
5. make all
6. make install
7. make install-systemd-debian
8. turn on TLS (WITH_TLS), copy certs & keys.
9. sudo systemctl start kamailio
#### Log Messages
```
Nov 20 00:20:06 kamailio-stage-3 /usr/local/sbin/kamailio[12570]: INFO: tls [tls_mod.c:389]: mod_init(): With ECDH-Support!
Nov 20 00:20:06 kamailio-stage-3 /usr/local/sbin/kamailio[12570]: INFO: tls [tls_mod.c:392]: mod_init(): With Diffie Hellman
Nov 20 00:20:06 kamailio-stage-3 kamailio[12569]: DIGEST-MD5 common mech free
Nov 20 00:20:06 kamailio-stage-3 /usr/local/sbin/kamailio[12570]: INFO: auth [auth_mod.c:345]: mod_init(): qop set, but nonce-count (nonce_count) support disabled
Nov 20 00:20:06 kamailio-stage-3 /usr/local/sbin/kamailio[12570]: INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded
Nov 20 00:20:06 kamailio-stage-3 /usr/local/sbin/kamailio[12570]: INFO: rr [rr_mod.c:185]: mod_init(): outbound module not available
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: ERROR: <core> [core/daemonize.c:303]: daemonize(): Main process exited before writing to pipe
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f09fdb43de8), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_free(323) - ignoring
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f09fdb44098), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_malloc(293) - ignoring
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f09fdb94230), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_free(323) - ignoring
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f09fdb41890), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_free(323) - ignoring
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f09fdb34998), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_free(323) - ignoring
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f09fdb347b8), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_free(323) - ignoring
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f09fdb34858), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_malloc(293) - ignoring
Nov 20 00:20:06 kamailio-stage-3 kamailio[12568]: CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f09fdb348f8), called from tls: tls_init.c: ser_free(323), first free tls: tls_init.c: ser_malloc(293) - ignoring
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: kamailio.service: Control process exited, code=killed, status=11/SEGV
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: kamailio.service: Failed with result 'signal'.
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: Failed to start kamailio (OpenSER) - the Open Source SIP Server.
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: kamailio.service: Service RestartSec=100ms expired, scheduling restart.
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: kamailio.service: Scheduled restart job, restart counter is at 57.
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: Stopped kamailio (OpenSER) - the Open Source SIP Server.
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: kamailio.service: Start request repeated too quickly.
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: kamailio.service: Failed with result 'signal'.
Nov 20 00:20:06 kamailio-stage-3 systemd[1]: Failed to start kamailio (OpenSER) - the Open Source SIP Server.
```
### Possible Solutions
As a hack, we manually downgraded to https://www.openssl.org/source/openssl-1.0.2r.tar.gz and that seemed to allow the system to launch, but this is obviously not a stable, long-term solution.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.4.2 (x86_64/linux) 2d733e
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_BLACKLIST, 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: 2d733e
compiled on 23:01:51 Nov 19 2020 with gcc 8.3.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 `uname -a`)
-->
```
root@kamailio-stage-3:/home/admin# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
root@kamailio-stage-3:/home/admin# uname -a
Linux kamailio-stage-3 4.19.0-12-cloud-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux
ubuntu@kamailio-stage-2:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
ubuntu@kamailio-stage-2:~$ uname -a
Linux kamailio-stage-2 5.4.0-1029-aws #30-Ubuntu SMP Tue Oct 20 10:06:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2560
Module: kamailio
Branch: master
Commit: 857e9deb4c2455ee2ea0c05446da54f97e1f0a63
URL: https://github.com/kamailio/kamailio/commit/857e9deb4c2455ee2ea0c05446da54f…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: 2021-02-11T17:44:19+02:00
Improved README.
---
Modified: src/modules/rr/doc/rr_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/857e9deb4c2455ee2ea0c05446da54f…
Patch: https://github.com/kamailio/kamailio/commit/857e9deb4c2455ee2ea0c05446da54f…
---
diff --git a/src/modules/rr/doc/rr_admin.xml b/src/modules/rr/doc/rr_admin.xml
index 7dc08b7b5c..7916789a82 100644
--- a/src/modules/rr/doc/rr_admin.xml
+++ b/src/modules/rr/doc/rr_admin.xml
@@ -628,7 +628,8 @@ record_route_advertised_address("1.2.3.4:5080");
<para>Adds a parameter to the Record-Route URI (param must be in
<quote>;name=value</quote> format. The function may be called also
- before or after the record_route() or record_route_advertised_address()
+ before or after the record_route(),
+ record_route_advertised_address(), and record_route_preset()
calls (see <xref linkend="rr.f.record_route"/> or <xref
linkend="rr.f.record_route_adv_addr"/>)).</para>