Re: [OpenSIPS-Users] opensips segfault
Further to my previous email I also see a lot of failed request just before the crash like Oct 9 21:43:03 myopensips /usr/local/sbin/opensips[1449]: CRITICAL:db_mysql:wrapper_single_mysql_real_query: driver error (1213): Deadlock found when tryi ng to get lock; try restarting transaction Oct 9 21:43:03 myopensips /usr/local/sbin/opensips[1449]: ERROR:core:db_do_update: error while submitting query Oct 9 21:43:03 myopensips /usr/local/sbin/opensips[1449]: ERROR:presence:update_presentity: updating published info in database Oct 9 21:43:03 myopensips /usr/local/sbin/opensips[1449]: ERROR:presence:handle_publish: when updating presentity Oct 9 21:43:03 myopensips /usr/local/sbin/opensips[1457]: CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute: driver error (1213): Deadlock found when tr ying to get lock; try restarting transaction Oct 9 21:43:03 myopensips /usr/local/sbin/opensips[1457]: ERROR:presence:delete_db_subs: sql delete failed Oct 9 21:43:03 myopensips /usr/local/sbin/opensips[1457]: ERROR:presence:update_subscription: deleting subscription record from database Oct 9 21:43:03 myopensips /usr/local/sbin/opensips[1457]: ERROR:presence:handle_subscribe: in update_subscription could this a cause of the crash? I have tried to read the core dump but cant find anything there. it is like msg = 0x7efd794cf2a0 t = 0x0 _c = reply_c = 0x0 request_c = 0x0 st = 9106161 ret = requested_exp = 0 enforced_exp = 0 val = {n = 4, s = {s = 0x4 , len = 0}} l = p = forced_binding_buf = "\000\000\000\000\000\000\000\000\066b69c11f2cbb12551371135d\000\000\000\000\000\000\000\000\240\362Ly\375~\000\000\020\220\025. forced_binding = {s = 0x0, len = 0} binding_uri = __FUNCTION__ = "save" #12 0x0042da49 in do_action (a=a@entry=0x7efd794afdd8, msg=msg@entry=0x7efd794cf2a0) at action.c:1862 increment = decrement = val_number = j = val_s = {s = 0x7efd0069 , len = 3440} cdb_reply = 0x7efd0004 aux = {s = 0x20 , len = 0} i = key_number = 0 it = avp_val = avp_name = {n = 105, s = {s = 0x7efd0069 , len = 3440}} avp_type = 38183 ret = -5 I cant paste the whole dump here but let me know if any of the dev want to have a look please. Thank you On Wed, Oct 10, 2018 at 11:57 AM J E H A N Z A I B < jehanzaib.ki...@gmail.com> wrote: > Hi team, > > Opensips (2.3.1) crashed a few times now and I can not figure out the > reason of it. > Can someone help me here please? > Here is what I see in the logs before it crashes. > > Oct 9 21:43:10 myopensips kernel: opensips[1454]: segfault at 0 ip > 005319a2 sp 7fffed157c70 error 6 in opensips[40+27c000] > Oct 9 21:43:10 myopensips /usr/local/sbin/opensips[1471]: > CRITICAL:core:receive_fd: EOF on 32 > Oct 9 21:43:10 myopensips /usr/local/sbin/opensips[1313]: > INFO:core:handle_sigs: child process 1454 exited by a signal 11 > Oct 9 21:43:10 myopensips /usr/local/sbin/opensips[1313]: > INFO:core:handle_sigs: core was generated > Oct 9 21:43:10 myopensips /usr/local/sbin/opensips[1313]: > INFO:core:handle_sigs: terminating due to SIGCHLD > > Thank you > > -- Regards, Jehanzaib ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] OpenSIPS Not Rewriting SDP Connection IP (c=)
Hi Steven, looking at your config it doesn't seems you are testing for nat in your main route. only on reply route your have nat_uac_test function called.you need to do the same in main route and set the NAT flag otherwise your condition "if ( isflagset(NAT) ) {rtpproxy_offer("of", "OPENSIPS IP");}" to use rtpproxy won't work. you can verfiy it by adding an xlog statement inside that condition. As per the given config it shouldn't print anything in log. On Tuesday, 9 October 2018, 10:55:02 PM GMT+5:30, Steven Platt wrote: Good morning, I have an installation of OpenSIPS 2.3.5, with RTPProxy running on a single server. RTP Proxy is running as normal, and logs show support for it enabled during initial connection leg. My error is that Opensips does not update the connection IP (c=) of the SDP to force media to be proxied with RTPProxy. Instead, it keep the endpoint IP, which is behind a NAT, because of this - I have no audio. Is there something I miss in the configuration to enforce the update of the connection IP in the SDP? (so that media goes through opensips/rtpproxy) My flow: desktop client (zoiper) <--> corporate NAT <--> OPENSIPS <--> carrier NAT <--> android (zoiper) Invite SDP Sent from Desktop Zoiper Client: Via: SIP/2.0/TCP [CORPORATE NAT]:59401;branch=z9hG4bK-524287-1---fecce2d50d9d5c20;rportMax-Forwards: 70Contact: To: From: ;tag=b27a0843Call-ID: QMoyxf6JGTFYvxS5X8NsnA..CSeq: 2 INVITEAllow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBEContent-Type: application/sdpProxy-Authorization: Digest username="1000",realm="[OPENSIPS IP]",nonce="5bbcdde100172b9f0086711cd36194c50f208fa420de",uri="sip:1001@[OPENSIPS IP]:5060;transport=TCP",response="a609cb9d82930d2d32668d8d51d64cb4",algorithm=MD5User-Agent: Z 5.2.19 rv2.8.99Allow-Events: presence, kpml, talkContent-Length: 161 v=0o=Z 0 0 IN IP4 [DESKTOP IP]s=Zc=IN IP4 [DESKTOP IP]t=0 0m=audio 8000 RTP/AVP 0 101 8a=rtpmap:101 telephone-event/8000a=fmtp:101 0-16a=sendrecv The 200OK sent by Opensips to the calling device: Via: SIP/2.0/TCP [CORPORATE NAT] :59401;received=[CARRIER IP];branch=z9hG4bK-524287-1---fecce2d50d9d5c20;rport=59401Record-Route: Contact: To: ;tag=07be6967From: ;tag=b27a0843Call-ID: QMoyxf6JGTFYvxS5X8NsnA..CSeq: 2 INVITEAllow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBEContent-Type: application/sdpUser-Agent: Zoiper rv2.8.105Allow-Events: presence, kpml, talkContent-Length: 245 v=0o=Zoiper 0 1 IN IP4 [ANDROID IP]s=Zoiperc=IN IP4 [ANDROID IP]t=0 0m=audio 42032 RTP/AVP 0 3 8 101a=rtpmap:0 PCMU/8000a=rtpmap:3 GSM/8000a=rtpmap:8 PCMA/8000a=rtpmap:101 telephone-event/8000a=fmtp:101 0-16a=sendrecv --- OpenSIPS Config route[relay] { if (is_method("INVITE")) { if ( isflagset(NAT) ) { rtpproxy_offer("of", "OPENSIPS IP"); } t_on_branch("per_branch_ops"); t_on_reply("handle_nat"); t_on_failure("missed_call"); } if (isflagset(NAT)) { add_rr_param(";nat=yes"); } if (!t_relay()) { send_reply("500","Internal Error"); }; exit;} onreply_route[handle_nat] { if (nat_uac_test("1")) fix_nated_contact(); if ( isflagset(NAT) ) rtpproxy_answer("of", "OPENSIPS IP"); xlog("incoming reply\n");} -- I also do not see the (";nat=yes") being added in the SDP. Do I understand correct that the script is not catching this call and flagging it correct as NAT? At this time, all signaling works as normal - only media is not being pinned to the opensips IP in the 200 OK response. Thanks in advance for any guidance on this one. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] opensips segfault
Hi team, Opensips (2.3.1) crashed a few times now and I can not figure out the reason of it. Can someone help me here please? Here is what I see in the logs before it crashes. Oct 9 21:43:10 myopensips kernel: opensips[1454]: segfault at 0 ip 005319a2 sp 7fffed157c70 error 6 in opensips[40+27c000] Oct 9 21:43:10 myopensips /usr/local/sbin/opensips[1471]: CRITICAL:core:receive_fd: EOF on 32 Oct 9 21:43:10 myopensips /usr/local/sbin/opensips[1313]: INFO:core:handle_sigs: child process 1454 exited by a signal 11 Oct 9 21:43:10 myopensips /usr/local/sbin/opensips[1313]: INFO:core:handle_sigs: core was generated Oct 9 21:43:10 myopensips /usr/local/sbin/opensips[1313]: INFO:core:handle_sigs: terminating due to SIGCHLD Thank you ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] event routing and rtpengine
Bogdan, Re awakening this question I have tried the following route[fork_call] { xlog("user $avp(aor) registered the a new contact $avp(uri), " "injecting it in transaction with transport $avp(transport)\n"); xlog("destination protocol $var(transport) upstream ts $var(upstreamtransport) "); # take the contact described by the E_UL_CONTACT_INSERT # event and inject it as a new branch into the original transaction t_on_reply("handle_nat"); if($avp(uri)=~"sip:(.+)@(.+);transport=tls"){ xlog("destination tls\n"); $var(rtpengine_flags) = "RTP/AVPF replace-session-connection replace-origin ICE=remove rtcp-mux-demux via-branch=1"; rtpengine_offer("$var(rtpengine_flags)"); } t_inject_branches("event"); The issue I have is grabbing the value of the remote request transport flag along with sending the offer to rtpengine which fails to acquire the call-id ERROR:rtpengine:rtpe_function_call: can't get Call-Id field On Thu, Jun 14, 2018 at 12:59 AM Bogdan-Andrei Iancu wrote: > Hi Tito, > > The resume route has no context of the transaction, nor message -> so the > bflags are not available. Still, the event carries all the information > about the new branch to be injected, so you can reach to the flags via the > $avp(bflags) variables - this will keep the bitmask with all the bflags. > Unfortunately it will be more or less useless as you do not know the index > of the "DST_WS" flag :(... > > Nevertheless, the consistent approach on the matter will be to have the > all the needed bflags already saved in the user location. > > Regards, > > Bogdan-Andrei Iancu > > OpenSIPS Founder and Developer > http://www.opensips-solutions.com > OpenSIPS Summit 2018 > http://www.opensips.org/events/Summit-2018Amsterdam > > On 05/02/2018 01:08 AM, Tito Cumpen wrote: > > Any idea why the branch flags wouldn't be passed on to the branch route? > > Thanks, > Tito > > On Thu, Apr 19, 2018 at 2:02 PM, Tito Cumpen wrote: > >> Bogdan, >> >> >> Once I declared the branch route it looks like it is going through the >> branch route logic. The issue I have is parsing the exported $avp(uri) for >> transport=ws and then setting a branch flag that is kept from the event >> route >> >> route[fork_call] { >> xlog("user $avp(aor) registered the a new contact $avp(uri), " >> "injecting it in transaction \n"); >> >> $var(uri) = $avp(uri); >>#if transport is ws then ; >> setbflag(DST_WS); #this branch flag is not kept nor considered when >> branch route is executed >> >> t_inject_branches("event"); >> >> } >> >> Thanks, >> Tito >> >> On Thu, Apr 19, 2018 at 3:23 AM, Bogdan-Andrei Iancu > > wrote: >> >>> Tito, >>> >>> Arming the branch route once, in the request route, before the initial >>> t_relay() should be fine. Now, if you use any xlog() to check , is the >>> branch route triggered for the injected branch ? >>> >>> Regards, >>> >>> Bogdan-Andrei Iancu >>> >>> OpenSIPS Founder and Developer >>> http://www.opensips-solutions.com >>> OpenSIPS Summit 2018 >>> http://www.opensips.org/events/Summit-2018Amsterdam >>> >>> On 04/18/2018 08:35 PM, Tito Cumpen wrote: >>> >>> Bogdan, >>> >>> The branch route is defined in my my relay route. >>> https://pastebin.com/MFcLxcDv Should it be defined in the event route I >>> figured since the original transaction used the relay route it would use >>> the route defined there ? >>> >>> Thanks, >>> Tito >>> >>> >>> >>> >>> >>> On Wed, Apr 18, 2018 at 9:32 AM, Bogdan-Andrei Iancu < >>> bog...@opensips.org> wrote: >>> Hi Tito, I see no branch route in your script sample. Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com OpenSIPS Summit 2018 http://www.opensips.org/events/Summit-2018Amsterdam On 04/16/2018 09:37 PM, Tito Cumpen wrote: Group, I am having issues when injecting a new branch with rtpengine flags to a call request using the event routing module. It seems like when the branch is injected it either does not use any of the flags to aid with rtpengine media translation or does not run through the branch route block defined in my relay route at all. https://pastebin.com/u1EYzDe0 above is the route that prepares injection and transport priorities along with the route that gets called upon a new registration. Thanks, Tito ___ Users mailing listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users >>> >>> >> > > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] mid registrar g lookup
Hello Everyone, Current setup is full federated cluster with mongo and pgsql. I see in trace $ru IVITE sip:13is is INVITE sip:130%40domain.com@10.100.104.8:5060 SIP/2.0 Right now we returning 404 same as m flag lookup. What should happens if user found or not found, because I think $rU part is not encoded correctly. volga629 @10.100.104.8:5060 SIP/2.0 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Clustered User Location Full Sharing persistency and Cassandra
Thank you for answering both questions :) Much appreciated; - Jock On Tue, Oct 9, 2018 at 12:08 PM, Vlad Patrascu wrote: > Hi Jock, > > The Cassandra module hasn't been well maintained for quite some time up > until relatively recently (the code wasn't even compiling anymore) so there > is actually no RPM for it (yet). > > Although the issues have been fixed and the module is now up to date with > the latest Cassandra drivers, the features required for the usrloc > clustering have only been implemented on the devel branch for Opensips 3.0. > > Regards, > > Vlad Patrascu > OpenSIPS Developer > http://www.opensips-solutions.com > > > On 10/09/2018 06:40 PM, Jock McKechnie wrote: >> >> Good morning; >> >> We are attempting to implement a Full Sharing topology User Location >> cluster and I'm trying to make sense of whether this can work with >> Cassandra or not. >> >> At present we have a four-node cluster (across two datacentres) >> working in an in-memory state, with the nodes seeding from each other >> (by setting the clusterer node definition flags field to 'NULL' for >> all nodes). We'd like to consider having the data set stored to a >> Cassandra cluster should we require a complete OpenSIPS cluster >> restart, however the following line in the USRLOC documentation has me >> wondering: >> >> "Currently, registrations may optionally be fully managed inside NoSQL >> databases which support key/multi-value column-like associations. >> Example known backends to support these abstractions at the time of >> writing are MongoDB and Cassandra. Of these two, only the MongoDB >> OpenSIPS driver has been so far extended to implement the required >> NoSQL API endpoints." >> >> I read this to say that while both MongoDB and Cassandra can do what >> is required, only the MongoDB OpenSIPS modules are currently in a >> state to support it. Is this correct? >> >> I can't even work out what RPM the Cassandra module is in, which >> doesn't help with me attempting to test. :) >> >> My thanks for the clarification; >> >> - Jock >> >> ___ >> Users mailing list >> Users@lists.opensips.org >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] OpenSIPS Not Rewriting SDP Connection IP (c=)
Good morning, I have an installation of OpenSIPS 2.3.5, with RTPProxy running on a single server. RTP Proxy is running as normal, and logs show support for it enabled during initial connection leg. My error is that Opensips does not update the connection IP (c=) of the SDP to force media to be proxied with RTPProxy. Instead, it keep the endpoint IP, which is behind a NAT, because of this - I have no audio. Is there something I miss in the configuration to enforce the update of the connection IP in the SDP? (so that media goes through opensips/rtpproxy) My flow: desktop client (zoiper) <--> corporate NAT <--> OPENSIPS <--> carrier NAT <--> android (zoiper) *Invite SDP Sent from Desktop Zoiper Client: * Via: SIP/2.0/TCP [CORPORATE NAT]:59401;branch=z9hG4bK-524287-1---fecce2d50d9d5c20;rport Max-Forwards: 70 Contact: To: From: ;tag=b27a0843 Call-ID: QMoyxf6JGTFYvxS5X8NsnA.. CSeq: 2 INVITE Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE Content-Type: application/sdp Proxy-Authorization: Digest username="1000",realm="[OPENSIPS IP]",nonce="5bbcdde100172b9f0086711cd36194c50f208fa420de",uri="sip:1001@[OPENSIPS IP]:5060;transport=TCP",response="a609cb9d82930d2d32668d8d51d64cb4",algorithm=MD5 User-Agent: Z 5.2.19 rv2.8.99 Allow-Events: presence, kpml, talk Content-Length: 161 v=0 o=Z 0 0 IN IP4 [DESKTOP IP] s=Z c=IN IP4 [DESKTOP IP] t=0 0 m=audio 8000 RTP/AVP 0 101 8 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=sendrecv *The 200OK sent by Opensips to the calling device: * Via: SIP/2.0/TCP [CORPORATE NAT] :59401;received=[CARRIER IP];branch=z9hG4bK-524287-1---fecce2d50d9d5c20;rport=59401 Record-Route: Contact: To: ;tag=07be6967 From: ;tag=b27a0843 Call-ID: QMoyxf6JGTFYvxS5X8NsnA.. CSeq: 2 INVITE Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE Content-Type: application/sdp User-Agent: Zoiper rv2.8.105 Allow-Events: presence, kpml, talk Content-Length: 245 v=0 o=Zoiper 0 1 IN IP4 [ANDROID IP] s=Zoiper c=IN IP4 [ANDROID IP] t=0 0 m=audio 42032 RTP/AVP 0 3 8 101 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=sendrecv --- *OpenSIPS Config* *route[relay]* { if (is_method("INVITE")) { if ( isflagset(NAT) ) { rtpproxy_offer("of", "OPENSIPS IP"); } t_on_branch("per_branch_ops"); t_on_reply("handle_nat"); t_on_failure("missed_call"); } if (isflagset(NAT)) { add_rr_param(";nat=yes"); } if (!t_relay()) { send_reply("500","Internal Error"); }; exit; } *onreply_route[handle_nat]* { if (nat_uac_test("1")) fix_nated_contact(); if ( isflagset(NAT) ) rtpproxy_answer("of", "OPENSIPS IP"); xlog("incoming reply\n"); } -- I also do not see the (";nat=yes") being added in the SDP. Do I understand correct that the script is not catching this call and flagging it correct as NAT? At this time, all signaling works as normal - only media is not being pinned to the opensips IP in the 200 OK response. Thanks in advance for any guidance on this one. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Clustered User Location Full Sharing persistency and Cassandra
Hi Jock, The Cassandra module hasn't been well maintained for quite some time up until relatively recently (the code wasn't even compiling anymore) so there is actually no RPM for it (yet). Although the issues have been fixed and the module is now up to date with the latest Cassandra drivers, the features required for the usrloc clustering have only been implemented on the devel branch for Opensips 3.0. Regards, Vlad Patrascu OpenSIPS Developer http://www.opensips-solutions.com On 10/09/2018 06:40 PM, Jock McKechnie wrote: Good morning; We are attempting to implement a Full Sharing topology User Location cluster and I'm trying to make sense of whether this can work with Cassandra or not. At present we have a four-node cluster (across two datacentres) working in an in-memory state, with the nodes seeding from each other (by setting the clusterer node definition flags field to 'NULL' for all nodes). We'd like to consider having the data set stored to a Cassandra cluster should we require a complete OpenSIPS cluster restart, however the following line in the USRLOC documentation has me wondering: "Currently, registrations may optionally be fully managed inside NoSQL databases which support key/multi-value column-like associations. Example known backends to support these abstractions at the time of writing are MongoDB and Cassandra. Of these two, only the MongoDB OpenSIPS driver has been so far extended to implement the required NoSQL API endpoints." I read this to say that while both MongoDB and Cassandra can do what is required, only the MongoDB OpenSIPS modules are currently in a state to support it. Is this correct? I can't even work out what RPM the Cassandra module is in, which doesn't help with me attempting to test. :) My thanks for the clarification; - Jock ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Installing rtpengine on CentOS 6
Hi, This is more an enquiry to the community than the OpenSIPS developers. Has anyone successfully installed rtpengine on CentOS 6? If so, please can you assist me. I've been able to fix most dependencies, but when I run make these two remain: Package libiptc was not found in the pkg-config search path. ../include/redis.h:14:29: error: hiredis/hiredis.h: No such file or directory Using yum with epel and nux repos, I could only find packages for libiptcdata-devel and redis, not for libiptc or hiredis. Also, when I run make it gives me this warning about argument types in function atomic64_get_set: warning: passing argument 1 of 'g_atomic_pointer_compare_and_exchange' from incompatible pointer type expected 'void * volatile*' but argument is of type 'volatile void **' Can I safely ignore this warning? Thanks in advance for any help you can offer. John Quick Smartvox Limited ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Clustered User Location Full Sharing persistency and Cassandra
Good morning; We are attempting to implement a Full Sharing topology User Location cluster and I'm trying to make sense of whether this can work with Cassandra or not. At present we have a four-node cluster (across two datacentres) working in an in-memory state, with the nodes seeding from each other (by setting the clusterer node definition flags field to 'NULL' for all nodes). We'd like to consider having the data set stored to a Cassandra cluster should we require a complete OpenSIPS cluster restart, however the following line in the USRLOC documentation has me wondering: "Currently, registrations may optionally be fully managed inside NoSQL databases which support key/multi-value column-like associations. Example known backends to support these abstractions at the time of writing are MongoDB and Cassandra. Of these two, only the MongoDB OpenSIPS driver has been so far extended to implement the required NoSQL API endpoints." I read this to say that while both MongoDB and Cassandra can do what is required, only the MongoDB OpenSIPS modules are currently in a state to support it. Is this correct? I can't even work out what RPM the Cassandra module is in, which doesn't help with me attempting to test. :) My thanks for the clarification; - Jock ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Chasing down unreleased memory
Good morning Răzvan, During a standard test, not from OpenSIPS itself - the perl application that controls the calls makes an API request and in a small percentage of cases it will relay an ERROR back if the API failed, but we're talking well below 1% of calls. The only time OpenSIPS will start throwing ERRORs is if I've let it run past its ability to clear memory (the reserve of SHM has been used up) and it gets very upset about not being able to free memory fragments up for itself until eventually the Linux kernel will OOM kill the process. There's no trick to using mc_compact() I'm missing is there? Something foolish I'm doing that's causing it? In the main body of the routing script I have a if (is_method("INVITE") && !has_totag()) { record_route(); set_flag(22); # SIP tracing sip_trace("tid", "d", "sip"); route(1); } And inside route(1) {} amongst the perl API calls, some AVP manipulation and R-URI rewrites (as mentioned, $rU/$rd overwriting) and setting up the callbacks (t_on_failure, t_on_reply, t_on_branch) and some $acc_extra() setup I have: mc_compact("P-Asserted-Identity|Remote-Party-ID|X-UCID"); And... that's it. One call in the route() block per call. Is there any kind of additional debugging I could do? I could throw OpenSIPS into full debug mode and write its log to a RAMdisk or something, but I fear that might cause other problems due to the extra load of writing logs - not to mention the insane amount of logging it would make :) But I'm willing to try anything to help out and solve this. As always, I appreciate your time; - Jock On Mon, Oct 8, 2018 at 3:01 AM, Răzvan Crainea wrote: > Hi, Jock! > > Regarding the SHM issue, are you seeing any ERROR messages in your logs? > > Best regards, > Razvan > > On 10/2/18 6:07 PM, Jock McKechnie wrote: >> >> Here's the package dump from the test I ran - I'm not able to identify >> anything "Better" in this output, but I'll leave it up to a trained >> eye. >> >> I git pulled opensips-2.4 and built that with all of the memory >> debugging included and then ran the same tests I ran yesterday. >> Hopefully this is the right release, if not, let me know. >> >> - Jock >> >> Memory status (pkg): >> qm_status (0x7f4cf82d7010): >>heap size= 134217728 >>used= 11682552, used+overhead=12043128, free=122174600 >>max used (+overhead)= 12067040 >> INFO:core:sig_usr: signal 15 received >> Memory status (pkg): >> qm_status (0x7f4cf82d7010): >>heap size= 134217728 >>used= 11682552, used+overhead=12043128, free=122174600 >>max used (+overhead)= 12067040 >>dumping summary of all alloc'ed. fragments: >> >> total_bytes | num_allocations x [file: func, line] >> >> 8 : 1 x [compression.c: build_hdr_masks, line 229] >> 128 : 1 x [compression_helpers.c: parse_whitelist, line 160] >>16 : 1 x [ut.h: pkg_str_extend, line 841] >>16 : 2 x [script_var.c: add_var, line 59] >> 2097152 : 1 x [io_wait.c: init_io_wait, line 568] >> 45056 : 351 x [cfg.lex: addstr, line 890] >>64 : 2 x [rr_cb.c: register_rrcb, line 57] >> 39000 : 195 x [route_struct.c: mk_action, line 106] >> 13552 : 105 x [pvar.c: pv_parse_format, line 4119] >> 272 : 17 x [cfg.y: new_string, line 2703] >> 496 : 12 x [mod_fix.c: fixup_spve, line 948] >>16 : 1 x [siptrace.c: sip_trace_fixup, line 1279] >> 728 : 1 x [siptrace.c: parse_siptrace_id, line 525] >>24 : 1 x [compression_helpers.c: search_hdr, line 122] >> 160 : 10 x [cfg.y: yyparse, line 999] >> 864 : 18 x [evi/evi_params.c: evi_param_create, line 42] >> 248 : 10 x [mem/shm_mem.c: init_shm_post_yyparse, line 516] >> 6291456 : 1 x [io_wait.c: init_io_wait, line 559] >> 128 : 1 x [compression.c: set_wh_param, line 420] >>96 : 2 x [script_var.c: add_var, line 52] >>48 : 2 x [sl_cb.c: register_slcb, line 61] >> 368 : 9 x [sipmsgops.c: fixup_method, line 886] >> 8 : 1 x [acc_logic.c: do_acc_fixup, line 1221] >>64 : 4 x [socket_info.c: fix_socket_list, line 641] >>48 : 1 x [sr_module_deps.c: alloc_module_dep, line 54] >> 8 : 1 x [compression_helpers.c: parse_whitelist, line 167] >> 704 : 6 x [route.c: fix_expr, line 189] >>48 : 1 x [ipc.c: ipc_register_handler, line 120] >>80 : 1 x [mi/mi_trace.c: try_load_trace_api, line 55] >>32 : 1 x [transformations.c: tr_parse_nparam, line 2490] >> 1600 : 20 x [pvar.c: pv_add_extra, line 4690] >> 8 : 1 x [compression.c: build_hdr_masks, line 242] >> 1832 : 15 x [route.c: fix_actions, line 750] >> 144 : 16 x [map.c: map_get, line 150] >>32 : 1 x [map.c: map_create, line 79] >>