[sr-dev] core dump on AWS with ~4000 TCP sockets

2024-05-30 Thread David Villasmil via sr-dev
Hello all,
I'm seeing core dumps (can't find them!) on AWS with lots of TCP sockets
open (not related to load), kamailio dies randomly with:

*May 30 14:31:03 sip-proxy /usr/sbin/kamailio[743739]: CRITICAL: 
[core/pass_fd.c:277]: receive_fd(): EOF on 142 May 30 14:31:03 sip-proxy
/usr/sbin/kamailio[743542]: ALERT:  [main.c:788]: handle_sigs():
child process 743672 exited by a signal 11 May 30 14:31:03 sip-proxy
/usr/sbin/kamailio[743542]: ALERT:  [main.c:791]: handle_sigs(): core
was generated May 30 14:32:03 sip-proxy /usr/sbin/kamailio[743542]:
CRITICAL:  [main.c:698]: sig_alarm_abort(): shutdown timeout
triggered, dying...*

before this happens, there's a ton of

May 26 00:32:01 sip-proxy /usr/sbin/kamailio[74966]: ERROR: 
[core/tcp_main.c:4591]: tcpconn_main_timeout(): connect 172.56.51.197:34846
failed (timeout)
May 26 00:32:01 sip-proxy /usr/sbin/kamailio[74966]: ERROR: 
[core/tcp_main.c:4591]: tcpconn_main_timeout(): connect 98.196.165.187:38593
failed (timeout)
May 26 00:32:01 sip-proxy /usr/sbin/kamailio[74966]: ERROR: 
[core/tcp_main.c:4591]: tcpconn_main_timeout(): connect 10.241.49.185:49372
failed (timeout)
May 26 00:32:01 sip-proxy /usr/sbin/kamailio[74966]: ERROR: 
[core/tcp_main.c:4591]: tcpconn_main_timeout(): connect 97.101.162.40:45248
failed (timeout)
May 26 00:32:01 sip-proxy /usr/sbin/kamailio[74966]: ERROR: 
[core/tcp_main.c:4591]: tcpconn_main_timeout(): connect 172.59.213.36:57074
failed (timeout)
May 26 00:32:01 sip-proxy /usr/sbin/kamailio[74966]: ERROR: 
[core/tcp_main.c:4591]: tcpconn_main_timeout(): connect 207.195.63.14:2521
failed (timeout)
May 26 00:32:01 sip-proxy /usr/sbin/kamailio[74966]: ERROR: 
[core/tcp_main.c:4591]: tcpconn_main_timeout(): connect 10.241.49.185:22155
failed (timeout)
May 26 00:32:01 sip-proxy /usr/sbin/kamailio[74966]: ERROR: 
[core/tcp_main.c:4591]: tcpconn_main_timeout(): connect 10.241.49.185:10339
failed (timeout)

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: RPM Build Toolchain

2024-05-30 Thread Sergey Safarov via sr-dev
Please try this commands

cd pkg/kamailio
make src.rpm
cd ../..
rpm -i kamailio-xx.src.rpm
cd ~/rpmbuild-SPEC
rpmbuild -ba kamailio.spec



On Wed, May 29, 2024 at 9:16 PM tyler moore  wrote:

> Sergey,
>
> Tested this out today and centos9 is working great now.
> Appreciate all your work on the RPM maintenance!
>
> As a side note, I was wondering what commands you are using for the binary
> RPMs?
> I looked through pkg/kamailio
>  and only
> found the build commands for the source RPMs.
>
> On 5/29/24 08:03, Sergey Safarov wrote:
>
> Hi Tyler.
> I have rebuilt RPM packages. Please clean repo cache and reinstall
> packages.
>
> dnf reinstall kamailio*
>
> On Tue, May 28, 2024 at 6:39 PM tyler moore via sr-dev <
> sr-dev@lists.kamailio.org> wrote:
>
>> Sergey,
>>
>> Any chance we could generate a new build of the RPM including the updated
>> version of openssl?
>>
>> Regards,
>>
>> Tyler Moore
>> Full Stack Software Engineer
>> dOpenSource
>> Office: 888-907-2085, ext: 34
>> Cell: 248-909-2769
>> Email: tmo...@dopensource.com
>>
>> ___
>> Kamailio (SER) - Development Mailing List
>> To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
>>
> Regards,
>
> Tyler Moore
> Full Stack Software Engineer
> dOpenSource
> Office: 888-907-2085, ext: 34
> Cell: 248-909-2769
> Email: tmo...@dopensource.com
>
> ​
>
___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Kamailio 5.8 core dumps with regex module (Issue #3812)

2024-05-30 Thread Victor Seva via sr-dev
@dkovik can you please confirm that the fix works for you?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3812#issuecomment-2139750253
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Kamailio 5.8 core dumps with regex module (Issue #3812)

2024-05-30 Thread Victor Seva via sr-dev
Closed #3812 as completed via d89333748662c0e7c72e3579d41fd14ef05c0fee.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3812#event-12987174905
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:d8933374: regex: fix pcre2 migration

2024-05-30 Thread Victor Seva via sr-dev
Module: kamailio
Branch: master
Commit: d89333748662c0e7c72e3579d41fd14ef05c0fee
URL: 
https://github.com/kamailio/kamailio/commit/d89333748662c0e7c72e3579d41fd14ef05c0fee

Author: Victor Seva 
Committer: Victor Seva 
Date: 2024-05-30T16:36:30+02:00

regex: fix pcre2 migration

instead of reserving an array in pkg_mem and later
copy the pointers to shm_mem just use shm_mem in
the first place.

fixes #3812

---

Modified: src/modules/regex/regex_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/d89333748662c0e7c72e3579d41fd14ef05c0fee.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d89333748662c0e7c72e3579d41fd14ef05c0fee.patch

---

diff --git a/src/modules/regex/regex_mod.c b/src/modules/regex/regex_mod.c
index 292af692136..52ed60b295c 100644
--- a/src/modules/regex/regex_mod.c
+++ b/src/modules/regex/regex_mod.c
@@ -427,7 +427,7 @@ static int load_pcres(int action)
}
 
/* Temporal pointer of pcres */
-   if((pcres_tmp = pkg_malloc(sizeof(pcre2_code *) * num_pcres_tmp)) == 0) 
{
+   if((pcres_tmp = shm_malloc(sizeof(pcre2_code *) * num_pcres_tmp)) == 0) 
{
LM_ERR("no more memory for pcres_tmp\n");
goto err;
}
@@ -469,19 +469,10 @@ static int load_pcres(int action)
shm_free(pcres);
}
 
-   if(pcres == NULL) {
-   if((pcres = shm_malloc(sizeof(pcre2_code *) * num_pcres_tmp)) 
== 0) {
-   LM_ERR("no more memory for pcres\n");
-   goto err;
-   }
-   memset(pcres, 0, sizeof(pcre2_code *) * num_pcres_tmp);
-   }
-
*num_pcres = num_pcres_tmp;
-   *pcres = *pcres_tmp;
+   pcres = pcres_tmp;
*pcres_addr = pcres;
 
-   pkg_free(pcres_tmp);
/* Free allocated slots for unused patterns */
for(i = num_pcres_tmp; i < max_groups; i++) {
pkg_free(patterns[i]);

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Kamailio 5.8 core dumps with regex module (Issue #3812)

2024-05-30 Thread Victor Seva via sr-dev
> On the other hand, I am not sure if it is enough, I guess the compiled regex 
> has to be stored in shared memory and I cannot say it is done. Maybe 
> @linuxmaniac can have more insights on it.

Sorry for the delay. Yes, I think that coping the pointers to shm was not 
properly done in the migration

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3812#issuecomment-2139701519
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Warnings emitted when calling functions from dialplan module (Issue #3851)

2024-05-30 Thread Victor Seva via sr-dev
Closed #3851 as completed via 630a6f2c11c10c4f3be3570553d86486942d60fe.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3851#event-12986375549
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:5.8:c8e4fe87: dialplan: don't call free on empty pcre pointer

2024-05-30 Thread Victor Seva via sr-dev
Module: kamailio
Branch: 5.8
Commit: c8e4fe87985a413dfe6871463c31375750d3a6f2
URL: 
https://github.com/kamailio/kamailio/commit/c8e4fe87985a413dfe6871463c31375750d3a6f2

Author: Victor Seva 
Committer: Victor Seva 
Date: 2024-05-30T15:42:01+02:00

dialplan: don't call free on empty pcre pointer

fixes #3851

(cherry picked from commit 630a6f2c11c10c4f3be3570553d86486942d60fe)

---

Modified: src/modules/dialplan/dp_repl.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/c8e4fe87985a413dfe6871463c31375750d3a6f2.diff
Patch: 
https://github.com/kamailio/kamailio/commit/c8e4fe87985a413dfe6871463c31375750d3a6f2.patch

---

diff --git a/src/modules/dialplan/dp_repl.c b/src/modules/dialplan/dp_repl.c
index 42ba3b4abe6..51cab404710 100644
--- a/src/modules/dialplan/dp_repl.c
+++ b/src/modules/dialplan/dp_repl.c
@@ -648,7 +648,8 @@ int dp_translate_helper(
LM_DBG("match check 
skipped: [%.*s] %d\n",

re_list->expr.len, re_list->expr.s, rez);
rt = re_list->next;
-   pcre2_match_data_free(pcre_md);
+   if(pcre_md)
+   
pcre2_match_data_free(pcre_md);
pcre2_code_free(re_list->re);
pkg_free(re_list);
re_list = rt;

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:630a6f2c: dialplan: don't call free on empty pcre pointer

2024-05-30 Thread Victor Seva via sr-dev
Module: kamailio
Branch: master
Commit: 630a6f2c11c10c4f3be3570553d86486942d60fe
URL: 
https://github.com/kamailio/kamailio/commit/630a6f2c11c10c4f3be3570553d86486942d60fe

Author: Victor Seva 
Committer: Victor Seva 
Date: 2024-05-30T14:59:05+02:00

dialplan: don't call free on empty pcre pointer

fixes #3851

---

Modified: src/modules/dialplan/dp_repl.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/630a6f2c11c10c4f3be3570553d86486942d60fe.diff
Patch: 
https://github.com/kamailio/kamailio/commit/630a6f2c11c10c4f3be3570553d86486942d60fe.patch

---

diff --git a/src/modules/dialplan/dp_repl.c b/src/modules/dialplan/dp_repl.c
index 42ba3b4abe6..51cab404710 100644
--- a/src/modules/dialplan/dp_repl.c
+++ b/src/modules/dialplan/dp_repl.c
@@ -648,7 +648,8 @@ int dp_translate_helper(
LM_DBG("match check 
skipped: [%.*s] %d\n",

re_list->expr.len, re_list->expr.s, rez);
rt = re_list->next;
-   pcre2_match_data_free(pcre_md);
+   if(pcre_md)
+   
pcre2_match_data_free(pcre_md);
pcre2_code_free(re_list->re);
pkg_free(re_list);
re_list = rt;

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Crash in dns_cache.c with dns_cache_init=off (Issue #3350)

2024-05-30 Thread Xenofon Karamanos via sr-dev
I pushed a new update on the PR, can you maybe try it again and report back? 

With your config and without the patch, indeed kamailio crashes at some point.

With the new patch, it doesn't crash at all but want to verify that I 
replicated it correctly.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3350#issuecomment-2139476084
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)

2024-05-30 Thread Xenofon Karamanos via sr-dev
@xkaraman pushed 1 commit.

1babeb1941b8b068144b4ef988c0ad31e813e68f  core/resolve: Check dns_cache_init 
and choose appropriate functions

-- 
View it on GitHub:
https://github.com/kamailio/kamailio/pull/3858/files/df02022cb9f02b809be4069b596c26485b2f23cb..1babeb1941b8b068144b4ef988c0ad31e813e68f
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org