<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:Calibri;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">I have had 3 OpenSIPS server crashes in the last week. All were due to segmentation faults. I was not able to capture core dumps; I am configuring that now to catch the next crash.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">My logs leading up to the crash are full of errors from fix_route_dialog() complaining about invalid URIs for sequential requests:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Menlo;color:#2CA221;background:white">Jul 26 19:34:02 [220] ERROR:dialog:fix_route_dialog: Failed to parse SIP uri</span><span style="font-family:"Times New Roman""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Menlo;color:#2CA221;background:white">Jul 26 19:34:02 [220] ERROR:core:parse_uri: bad uri, state 0 parsed: <ip:1> (4) / <ip:10.18.8.18:5060;ftag=gK0448f137;lr;r2=on>> (44)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Times New Roman""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Menlo;color:#2CA221;background:white">Jul 26 19:11:19 [218] ERROR:dialog:fix_route_dialog: Failed to parse SIP uri</span><span style="font-family:"Times New Roman""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Menlo;color:#2CA221;background:white">Jul 26 19:11:19 [218] ERROR:core:parse_uri: bad uri, state 0 parsed: <b0i2> (4) / <b0i2yjor;transport=udp<sip:10.18.8.17:5060;ftag=7207ce89;lr;r2=on> (65)</span><span style="font-family:"Times New Roman""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Menlo;color:#2CA221;background:white">Jul 26 17:43:19 [220] ERROR:dialog:fix_route_dialog: Failed to parse SIP uri</span><span style="font-family:"Times New Roman""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Menlo;color:#2CA221;background:white">Jul 26 17:43:19 [220] ERROR:core:parse_uri: bad uri, state 0 parsed: <ervi> (4) / <ervice_id6fdbc70f-2438-4726-807c-0d081df4d87> (44)</span><span style="font-family:"Times New Roman""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Many times the “URI” displayed in the error message is actually internal OpenSIPS variables, as in the last error above. When they are from the SIP message, I have verified that the messages themselves are
correctly formatted. This leads me to believe there is memory corruption occurring.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">This all started when I updated my load-balancer servers to use Record-Routing, specifically the “double_rr” mechanism for when multiple interfaces exist. The Record-Routing is occurring on different servers
which have not crashed. Only the servers receiving the Record-Routed messages are experiencing the errors.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Here is a piece of the code processing sequential requests. I am using the topology_hiding() functionality of the Dialog module. Are validate_dialog() and fix_route_dialog() still valid in a topology_hiding
scenario?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">if (t_check_trans())<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> setflag(SEQ_REQUEST);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> if (has_totag())<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> loose_route();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> if (match_dialog())<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> if (!validate_dialog())<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> fix_route_dialog();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> if (is_method("BYE"))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> setflag(ACC_FLAG);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> setflag(SEQ_REQUEST);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> else if (!isflagset(SEQ_REQUEST))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> if (!is_method("ACK")) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> route(rlog, LV_ERROR, "check_sequential", "Sequential request not matched");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> route(reply_error, "481", "Call Does Not Exist");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> return(EXIT);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I will attempt to get core dumps of future crashes.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Ben Newlin<o:p></o:p></span></p>
</div>
</body>
</html>