Module: kamailio
Branch: 5.2
Commit: fcf6fd61e38da76e775fea6d38df3704a28f545c
URL: https://github.com/kamailio/kamailio/commit/fcf6fd61e38da76e775fea6d38df370…
Author: szcom <sergey(a)wgtwo.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-16T21:09:28+02:00
ims_qos: use msg_ctx_id_t to detect same msg/transaction processing
- relies on msg id and pid, not only msg id (which is incremeted by
each process and has potential conflicts with failure routing)
- msg id and pid are enough to indentify the transaction thus
dropping checks for the pointers
(cherry picked from commit b951d88eea52e9fbbec62d2069b6169fc182ba91)
---
Modified: src/modules/ims_qos/ims_qos_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/fcf6fd61e38da76e775fea6d38df370…
Patch: https://github.com/kamailio/kamailio/commit/fcf6fd61e38da76e775fea6d38df370…
---
diff --git a/src/modules/ims_qos/ims_qos_mod.c b/src/modules/ims_qos/ims_qos_mod.c
index 5715a05275..6f68b39be1 100644
--- a/src/modules/ims_qos/ims_qos_mod.c
+++ b/src/modules/ims_qos/ims_qos_mod.c
@@ -153,9 +153,9 @@ struct _pv_req_data {
struct cell *T;
struct sip_msg msg;
struct sip_msg *tmsgp;
- unsigned int id;
char *buf;
int buf_size;
+ msg_ctx_id_t msg_ctx;
};
static struct _pv_req_data _pv_treq;
@@ -736,8 +736,7 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int
(which we cannot assume) then we would pollute the shm_msg t->uas.request if we did any parsing on it. Instead, we need to
make a private copy of the message and free it when we are done
*/
- if ((_pv_treq.T != t || t->uas.request != _pv_treq.tmsgp)
- && t->uas.request->id != _pv_treq.id) {
+ if (msg_ctx_id_match(t->uas.request, &_pv_treq.msg_ctx) != 1) {
/* make a copy */
if (_pv_treq.buf == NULL || _pv_treq.buf_size < t->uas.request->len + 1) {
@@ -746,7 +745,8 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int
if (_pv_treq.tmsgp)
free_sip_msg(&_pv_treq.msg);
_pv_treq.tmsgp = NULL;
- _pv_treq.id = 0;
+ _pv_treq.msg_ctx.msgid=0;
+ _pv_treq.msg_ctx.pid=0;
_pv_treq.T = NULL;
_pv_treq.buf_size = t->uas.request->len + 1;
_pv_treq.buf = (char*) pkg_malloc(_pv_treq.buf_size * sizeof(char));
@@ -764,7 +764,7 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int
_pv_treq.msg.len = t->uas.request->len;
_pv_treq.msg.buf = _pv_treq.buf;
_pv_treq.tmsgp = t->uas.request;
- _pv_treq.id = t->uas.request->id;
+ msg_ctx_id_set(t->uas.request, &_pv_treq.msg_ctx);
_pv_treq.T = t;
Module: kamailio
Branch: 5.2
Commit: 1f4262b3f7db30e917eec36132c193c4be6c04c1
URL: https://github.com/kamailio/kamailio/commit/1f4262b3f7db30e917eec36132c193c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-16T21:08:25+02:00
rtpengine: allocate space for one more rtp relay control socket
- keep it as safety end place holder
- should make it work again for the case when starting with no rtp
engine in the database - GH #1940
(cherry picked from commit c836f8ba2f4d3a32b8a4fecba332355df01daca6)
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff: https://github.com/kamailio/kamailio/commit/1f4262b3f7db30e917eec36132c193c…
Patch: https://github.com/kamailio/kamailio/commit/1f4262b3f7db30e917eec36132c193c…
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 484ce05f35..650ee9424b 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -1717,12 +1717,13 @@ static int build_rtpp_socks(int lmode, int rtest) {
}
rtpp_socks_size = current_rtpp_no;
- rtpp_socks = (int*)pkg_reallocxf(rtpp_socks, sizeof(int)*(rtpp_socks_size));
+ /* allocate one more to have a safety end place holder */
+ rtpp_socks = (int*)pkg_reallocxf(rtpp_socks, sizeof(int)*(rtpp_socks_size+1));
if (!rtpp_socks) {
LM_ERR("no more pkg memory for rtpp_socks\n");
return -1;
}
- memset(rtpp_socks, -1, sizeof(int)*(rtpp_socks_size));
+ memset(rtpp_socks, -1, sizeof(int)*(rtpp_socks_size+1));
rtpe_reload_lock_get(rtpp_set_list->rset_head_lock);
_rtpe_list_vernum_local = _rtpe_list_version->vernum;
### Description
We are experiencing sticky OOM state after an extended period (several days). `kamcmd` inspection of mem use shows memory consumed (leaked) via `pv_cache_add(347)` calls.
Inspection of that function suggests nothing can ever be dropped from the cache -- rendering it leaky. `_pv_cache_counter` is tested twice but after initialization (to zero) never appears to be assigned (incremented or otherwise) and so the conditions needed to call `pv_cache_drop` are never met.
### Troubleshooting
#### Debugging Data
```
May 5 23:55:40 eng-X X[1107]: 1(105) INFO: qm_sums: count= 1 size= 2048 bytes from core: core/counters.c: cnt_hash_add(383)
May 5 23:55:40 eng-X X[1107]: 1(105) INFO: qm_sums: count= 18473 size= 5571880 bytes from core: core/pvapi.c: pv_cache_add(347)
May 5 23:55:40 eng-X X[1107]: 1(105) INFO: qm_sums: count= 162 size= 9344 bytes from core: core/pvapi.c: pv_parse_format(1150)
```
### Additional Information
```
kamcmd> ver
kamailio 5.2.2 (x86_64/linux)
kamcmd>
```
* **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`)
-->
```
Linux soak 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 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/1948