### Description
Kamailio segfaults when KEMI functions are invoked from app_python script
### Troubleshooting
The same code was running ok with the 5.6 branch.
It seems that the function sr_apy_kemi_exec_func_ex has been re-written in 5.7 with the following main changes :
- The long IF/ELSE statement was replace by a FOR loop
- The call to PyArg_ParseTuple function was replaced by the call to PyList_GetItem ==> **This seems to be the cause. The value returned by this function is alway NULL**
#### Reproduction
Any call to KSR.pv.seti function from a PYTHON 2 script would cause this error.
#### Log Messages
```
sbin/kamailio[18449]: ERROR: app_python [apy_kemi.c:280]: sr_apy_kemi_exec_func_ex(): null parameter - func: seti idx: 0 argc:
2
Feb 6 11:34:16 .../sbin/kamailio[18509]: CRITICAL: <core> [core/pass_fd.c:281]: receive_fd(): EOF on 37
Feb 6 11:34:16 .../sbin/kamailio[18380]: ALERT: <core> [main.c:793]: handle_sigs(): child process 18449 exited by a signal 11
Feb 6 11:34:16 .../sbin/kamailio[18380]: ALERT: <core> [main.c:796]: handle_sigs(): core was not generated
Feb 6 11:34:16 .../sbin/kamailio[18380]: INFO: <core> [main.c:818]: handle_sigs(): terminating due to SIGCHLD
Feb 6 11:34:16 .../sbin/kamailio[18509]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received
Feb 6 11:34:16 .../sbin/kamailio[18502]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received
Feb 6 11:34:16 .../sbin/kamailio[18495]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received
Feb 6 11:34:16 .../sbin/kamailio[18482]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3746
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3746(a)github.com>
Module: kamailio
Branch: master
Commit: 9b3b8ec968c6f7bda0d10a0d4fe593a92560ee7d
URL: https://github.com/kamailio/kamailio/commit/9b3b8ec968c6f7bda0d10a0d4fe593a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-04-06T08:35:19+02:00
corex: docs for dns_file parameter
---
Modified: src/modules/corex/doc/corex_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/9b3b8ec968c6f7bda0d10a0d4fe593a…
Patch: https://github.com/kamailio/kamailio/commit/9b3b8ec968c6f7bda0d10a0d4fe593a…
---
diff --git a/src/modules/corex/doc/corex_admin.xml b/src/modules/corex/doc/corex_admin.xml
index d5cfe1db477..3cdad0aa2a5 100644
--- a/src/modules/corex/doc/corex_admin.xml
+++ b/src/modules/corex/doc/corex_admin.xml
@@ -162,6 +162,41 @@ modparam("corex", "alias_subdomains", "udp:sip-router.org:5060")
modparam("corex", "dns_cache", "type=A;name=kamailio.org;addr=193.22.119.66;ttl=3600000;flags=0")
modparam("corex", "dns_cache", "type=AAAA;name=kamailio.org;addr=2a00:d60:0:400::2;ttl=3600000;flags=0")
...
+</programlisting>
+ </example>
+ </section>
+ <section id="corex.p.dns_file">
+ <title><varname>dns_file</varname> (string)</title>
+ <para>
+ Path to the file from where to load dns_cache records. It can be set
+ many times to add more than one file.
+ </para>
+ <para>
+ Inside the file, the dns_cache record has to be in a single line, with
+ the format of the dns_cache module parameter (see above). Empty lines
+ or lines with whitespaces only are ignored. Comment lines have to start
+ with '#'. Comments are not accepted after dns_cache records, only on
+ separate lines.
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>NULL</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>dns_file</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+# content of /etc/kamailio/kamailio-cache.dns
+
+# IPv4 record
+type=A;name=kamailio.org;addr=193.22.119.66;ttl=3600000;flags=0
+# IPv6 record
+type=AAAA;name=kamailio.org;addr=2a00:d60:0:400::2;ttl=3600000;flags=0
+...
+...
+modparam("corex", "dns_file", "/etc/kamailio/kamailio-cache.dns")
+...
</programlisting>
</example>
</section>
@@ -1291,4 +1326,3 @@ sub do_uncompress() {
</example>
</section>
</chapter>
-