Module: kamailio
Branch: master
Commit: 629a518991ab204a45f625d82fbe8a0ccd247cd6
URL: https://github.com/kamailio/kamailio/commit/629a518991ab204a45f625d82fbe8a0…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2024-07-31T07:46:11+02:00
modules: readme files regenerated - corex ... [skip ci]
---
Modified: src/modules/corex/README
---
Diff: https://github.com/kamailio/kamailio/commit/629a518991ab204a45f625d82fbe8a0…
Patch: https://github.com/kamailio/kamailio/commit/629a518991ab204a45f625d82fbe8a0…
---
diff --git a/src/modules/corex/README b/src/modules/corex/README
index 6a5e0663bdf..8986ee4df23 100644
--- a/src/modules/corex/README
+++ b/src/modules/corex/README
@@ -503,12 +503,14 @@ event_route[network:msg] {
4.7. msg_iflag_set(flagname)
Set internal SIP message flag. The parameter flagname can be:
- USE_UAC_FROM, USE_UAC_TO or UAC_AUTH.
+ USE_UAC_FROM, USE_UAC_TO, UAC_AUTH or a number from 0 to 64 (the
+ meaning of each value can be found in source code).
This functions should not be used in configuration file for (re)setting
the internal flags, those are done by various functions internally,
however, in very particular cases they might be useful (e.g., changing
- From/To via textops functions).
+ From/To via textops functions, or during testing of C code
+ development).
This function can be used from ANY_ROUTE.
Module: kamailio
Branch: master
Commit: 37e971f72c1783266ee29c02434361aaf2c819ed
URL: https://github.com/kamailio/kamailio/commit/37e971f72c1783266ee29c02434361a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-31T07:41:43+02:00
corex: docs updated for msg_iflag_set()
---
Modified: src/modules/corex/doc/corex_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/37e971f72c1783266ee29c02434361a…
Patch: https://github.com/kamailio/kamailio/commit/37e971f72c1783266ee29c02434361a…
---
diff --git a/src/modules/corex/doc/corex_admin.xml b/src/modules/corex/doc/corex_admin.xml
index 3cdad0aa2a5..3d6ff893808 100644
--- a/src/modules/corex/doc/corex_admin.xml
+++ b/src/modules/corex/doc/corex_admin.xml
@@ -469,13 +469,15 @@ event_route[network:msg] {
</title>
<para>
Set internal SIP message flag. The parameter flagname can be:
- USE_UAC_FROM, USE_UAC_TO or UAC_AUTH.
+ USE_UAC_FROM, USE_UAC_TO, UAC_AUTH or a number from 0 to 64
+ (the meaning of each value can be found in source code).
</para>
<para>
This functions should not be used in configuration file for
(re)setting the internal flags, those are done by various
functions internally, however, in very particular cases they
- might be useful (e.g., changing From/To via textops functions).
+ might be useful (e.g., changing From/To via textops functions,
+ or during testing of C code development).
</para>
<para>
This function can be used from ANY_ROUTE.
Hi! it seems the pua module in send_subscribe ( ) is leaking some memory because the hentity is not released.
According to memory allocations the shmem allocated for hentity is not cleaned.
```
1454582 file = 0x70e59fd30209 "usrloc: ../../core/ut.h", func = 0x70e59fd326c8 <__func__.16> "shm_str_dup", mname = 0x70e59fd2fdf0 "usrloc", line = 722
698090 file = 0x604218f2fcd5 "core: core/xavp.c", func = 0x604218f31988 <__func__.9> "xavp_new_value", mname = 0x604218f2fcd0 "core", line = 100
360187 file = 0x70e59fd30663 "usrloc: ucontact.c", func = 0x70e59fd326b8 <__func__.17> "new_ucontact", mname = 0x70e59fd2fdf0 "usrloc", line = 94
34208 file = 0x70e59fc91ae9 "pua: send_subscribe.c", func = 0x70e59fc94c80 <__func__.2> "subscribe_cbparam", mname = 0x70e59fc917e0 "pua", line = 773
5569 file = 0x70e59fc91ae9 "pua: send_subscribe.c", func = 0x70e59fc94ca0 <__func__.1> "subs_cbparam_indlg", mname = 0x70e59fc917e0 "pua", line = 861
64 file = 0x70e5a231f424 "tmx: tmx_pretran.c", func = 0x70e5a2320230 <__func__.0> "tmx_check_pretran", mname = 0x70e5a231f420 "tmx", line = 271
64 file = 0x70e5a231f424 "tmx: tmx_pretran.c", func = 0x70e5a2320230 <__func__.0> "tmx_check_pretran", mname = 0x70e5a231f420 "tmx", line = 250
7 file = 0x70e59fc86854 "pua: event_list.c", func = 0x70e59fc86ad0 <__func__.1> "add_pua_event", mname = 0x70e59fc86850 "pua", line = 72
3 file = 0x70e5a297c249 "license: ../../core/ut.h", func = 0x70e5a297d4f8 <__func__.3> "shm_str_dup", mname = 0x70e5a297c000 "license", line = 722
3 file = 0x70e59fd329d4 "usrloc: udomain.c", func = 0x70e59fd35660 <__func__.22> "build_stat_name", mname = 0x70e59fd328a0 "usrloc", line = 56
```
According to mod_stats for shmem over RPC the pua module was taking double as much memory as usrloc on the busy system.
I have tried to address the issue shown on lines 773 and 861 and added clearing of hentity at the end of send_subscribe () :
but it had caused the subscribe_200 outside of dialog to crash kamailio because of running the tm callback that accesses the hentity which is already free'd
So I thought perhaps another approach is required and the tm callback should clean it, while I must say i do not 100% clear understand why this needs to be so complicated compared to other modules. Perhaps i have missed another bug and overcomplicated things because the uac_r seems to be cleaned just fine.
The issue around the hentity does not seem to be solved in the latest releases while this is 5.3-something custom build.
Anyway my last resort that could help is convert to use tm to clear memory once it is done, in tm/uac.c : t_uac_prepare() is registering a callback with release function
```
if(uac_r->cb && insert_tmcb(&(new_cell->tmcb_hl), uac_r->cb_flags,
*(uac_r->cb), uac_r->cbp, NULL)!=1){
ret=E_OUT_OF_MEM;
LM_ERR("short of tmcb shmem\n");
goto error1;
}
int insert_tmcb(struct tmcb_head_list *cb_list, int types,
transaction_cb f, void *param,
release_tmcb_param rel_func)
{
```
is there any example of using such a relfunc in the other modules? Or anyone else has see the pua causing a mem leak when it is subscribed to reginfo from the config? I would appreciate some ideas what could be the issue and the solution.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3928
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3928(a)github.com>