Comments (5)
from kamailio.
Hi Henning,
Thank you for guidance and suggestion. I did change the PKG size to 32MB and increased SHM to 1GB. But the same issue observed with a lesser time duration.
While looking at the below error, found that something changes in the smsops module which was causing the leak
Apr 29 13:28:53 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5520]: ERROR: {1 1 MESSAGE [email protected]} smsops [smsops_impl.c:815]: decode_3gpp_sms(): Error allocating 192 bytes!
Below is my analysis:
The initial code was
if (!rp_data) {
rp_data = (sms_rp_data_t*)pkg_malloc(sizeof(struct _sms_rp_data));
if (!rp_data) {
LM_ERR("Error allocating %lu bytes!\n", sizeof(struct _sms_rp_data));
return -1;
}
} else {
freeRP_DATA(rp_data);
}
But it got changed in "smsops: Fix conversion from UCS-2 to UTF-8 and viceversa (#3546)" tag 8 months ago
if(rp_data) {
freeRP_DATA(rp_data);
}
rp_data = (sms_rp_data_t *)pkg_malloc(sizeof(struct _sms_rp_data));
if(!rp_data) {
LM_ERR("Error allocating %lu bytes!\n",
(unsigned long)sizeof(struct _sms_rp_data));
return -1;
}
Now in the recent code it is not reusing the rp_data pointer, rather it allocates every time a new message reaches.
I will try to clone the tag and fix the code and keep you posted
if(_smsops_rp_data) {
freeRP_DATA(_smsops_rp_data);
} else { //Added by Paresh Panda
_smsops_rp_data =
(sms_rp_data_t *)pkg_malloc(sizeof(struct _sms_rp_data));
}
Is there any plan for new tag ? , I am planning to take the latest kamailio tag to production.
I will update you after testing the fix as above.
Thank you!
Regards
Paresh
from kamailio.
Hello, thanks for the feedback. Your description sounds indeed like a memory leak. The code logic got changed, so its freeing the rp_data when its allocated now. Its a bit longer function, so it should be properly analyzed that its freed in all error conditions (which does not look like that right now).
from kamailio.
Hi Henning,
Thank you for the quick response!
I cloned the code and just changed back the block (which was problematic). Now I see error again as below :
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5885]: INFO: <script>: {1 1 MESSAGE [email protected]} Message Outbound MESSAGE sip:[email protected]:5060 (sip:[email protected]:5061 (192.168.136.152:5062) to sip:[email protected]:5060, [email protected])
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: INFO: {2 1 MESSAGE [email protected]} <script>: reply route
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: ERROR: {2 1 MESSAGE [email protected]} [core/mem/q_malloc.c:324]: qm_find_free(): qm_find_free(0x7f3af4736010, 384); Free fragment not found!
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: ERROR: {2 1 MESSAGE [email protected]} [core/mem/q_malloc.c:463]: qm_malloc(): qm_malloc(0x7f3af4736010, 384) called from core: core/msg_translator.c: generate_res_buf_from_sip_res(2435), module: core; Free fragment not found!
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: ERROR: {2 1 MESSAGE [email protected]} [core/msg_translator.c:2438]: generate_res_buf_from_sip_res(): could not allocate private memory from pkg pool
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: ERROR: {2 1 MESSAGE [email protected]} tm [t_reply.c:2067]: relay_reply(): no mem for outbound reply buffer
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: ERROR: {2 1 MESSAGE [email protected]} [core/mem/q_malloc.c:324]: qm_find_free(): qm_find_free(0x7f3af4736010, 416); Free fragment not found!
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: ERROR: {2 1 MESSAGE [email protected]} [core/mem/q_malloc.c:463]: qm_malloc(): qm_malloc(0x7f3af4736010, 416) called from core: core/msg_translator.c: build_res_buf_from_sip_req(2608), module: core; Free fragment not found!
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: ERROR: {2 1 MESSAGE [email protected]} [core/msg_translator.c:2610]: build_res_buf_from_sip_req(): could not allocate private memory from pkg pool
May 1 16:54:43 stgn-haud-vm-ub-kamailio01 /usr/sbin/kamailio[5875]: ERROR: {2 1 MESSAGE [email protected]} tm [t_reply.c:465]: _reply_light(): response building failed
Does it also look like memory leak this error log appeared and kamailio stopped processing traffic after 35 minutes or so.
When check the pkg memory for the pid as in log
{
entry: 6
pid: 5875
rank: 6
used: 5701888
free: 5728
real_used: 33548704
total_size: 33554432
total_frags: 28
desc: udp receiver child=5 sock=192.168.136.151:5060
}
It shows the udp receiver process PKG Mem is full , I have 8 childrens configured and all started showing the same issue.
Config : PKG 32 MB , SHM 1GB load 1000 msg/sec
Can you please quickly through some lights on this please? Shall I look at it as mem leak or config issue ( may be increase in PKG mem ?
Thank you!
from kamailio.
Related Issues (20)
- possible memory corruption in sipcapture module HOT 11
- pua_dialoginfo fails to publish the caller when not using avps HOT 3
- phonenum: fails to build on sid HOT 1
- kamailio re-INVITE HOT 1
- Possible Mem leak in Core HOT 2
- Kamailio incoming call error HOT 1
- sql_query fails from tcp:closed event_route HOT 10
- Usrloc keepalive: Not sending OPTIONS to UDP endpoints- 5.8.0 and 5.8.1 HOT 3
- ims_registrar_pcscf: support for handling contact * value HOT 4
- Warnings emitted when calling functions from dialplan module HOT 5
- bad BYE message from endpoint when using topoh in kamailio 5.5.1 HOT 2
- rtpengine: multipart content dropped when used read_sdp_pv HOT 1
- ims_registrar_scscf: cannot build on Fedora 40 HOT 1
- Possible memory leak in siputils module HOT 1
- Kamailio core dump v5.6 with cncxx module HOT 9
- Problem loadmodule secsipid on kamailio 5.6.5 HOT 2
- Crash on shutdown after geoip2.reload HOT 3
- dispatcher not proxy sip on websocket HOT 1
- ims/pcscf: 200OK for de-registration (REGISTER with Expire:0) is not reaching to UE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kamailio.