[Home]

Summary:ASTERISK-30215: Inbound SIP INVITE with Geo Location causing a Segmentation Fault
Reporter:Dan Cropp (daninmadison)Labels:
Date Opened:2022-09-08 14:11:24Date Closed:2022-09-15 05:53:45
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_geolocation
Versions:18.14.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Ubuntu 20 running in a HyperV VMAttachments:( 0) core-asterisk-2022-09-08T18-29-49Z-brief.txt
( 1) core-asterisk-2022-09-08T18-29-49Z-full.txt
( 2) core-asterisk-2022-09-08T18-29-49Z-info.txt
( 3) core-asterisk-2022-09-08T18-29-49Z-locks.txt
( 4) core-asterisk-2022-09-08T18-29-49Z-thread1.txt
Description:I have two VMs running Asterisk.

On one Asterisk VM, I have an AMI connection and send an Action: Originate.  Passing in a Variable:
{code}
GEOLOC_PROFILE(usage_rules)="retransmission-allowed=true",GEOLOC_PROFILE(allow_routing_use)="yes",GEOLOC_PROFILE(pidf_element)="tuple",GEOLOC_PROFILE(confidence)="pdf=Normal,value=80",GEOLOC_PROFILE(location_info)="country=CA,A1=QC,A2=,A3=COOKSHIRE EATON,HNO=160,RD=POPE,PC=J0B 1M0,NAM=CENTRE DE SANTE COOKSHIRE",GEOLOC_PROFILE(method)="Manual",GEOLOC_PROFILE(format)="civicAddress"
{code}

It appears to process the received SIP INVITE

{code}
INVITE sip:3333@192.168.33.33 SIP/2.0^M
Via: SIP/2.0/UDP 192.168.33.31:5060;rport;branch=z9hG4bKPj4e566f4f-6e6a-450a-a1d6-6c57d5700770^M
From: "John Doe" <sip:1234@192.168.33.31>;tag=80dfd6f0-2515-4d26-bb2d-d4119e538d3c^M
To: <sip:3333@192.168.33.33>^M
Contact: <sip:asterisk@192.168.33.31:5060>^M
Call-ID: 9d26436d-aeba-4f01-b272-2afe9f61b1c0^M
CSeq: 16531 INVITE^M
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER^M
Supported: 100rel, timer, replaces, norefersub, histinfo^M
Session-Expires: 1800^M
Min-SE: 90^M
Geolocation: <cid:acxpf@192.168.33.31>^M
Geolocation-Routing: yes^M
Max-Forwards: 70^M
User-Agent: Asterisk PBX 18.14.0^M
Content-Type: multipart/mixed;boundary=77249240-1983-4c2c-8b14-f5982cd3823b^M
Content-Length:  1481^M
^M
^M
--77249240-1983-4c2c-8b14-f5982cd3823b^M
Content-Type: application/sdp^M
Content-Length:   183^M
^M
v=0^M
o=- 1937398081 1937398081 IN IP4 192.168.33.31^M
s=Asterisk^M
c=IN IP4 192.168.33.31^M
t=0 0^M
m=audio 11354 RTP/AVP 0^M
a=rtpmap:0 PCMU/8000^M
a=ptime:20^M
a=maxptime:150^M
a=sendrecv^M
^M
--77249240-1983-4c2c-8b14-f5982cd3823b^M
Content-ID: <acxpf@192.168.33.31>^M
Content-Type: application/pidf+xml^M
Content-Length:  1018^M
^M
<?xml version="1.0"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:ca="urn:ietf:params:xml:ns:pidf:geopriv10:civicAddr" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:gbp="urn:ietf:params:xml:\
ns:pidf:geopriv10:basicPolicy" xmlns:gml="http://www.opengis.net/gml" xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10" xmlns:gs="http://www.opengis.net/pidflo/1.0" xmlns:con="urn:ietf:params:xml:ns:geopriv:conf" xmlns:date="http://exslt\
.org/dates-and-times" entity="PJSIP/192.168.33.33-00000006">
 <tuple>
   <status>
     <gp:geopriv>
       <gp:location-info>
         <ca:civicAddress xml:lang="en"/>
         <con:confidence pdf="Normal">80</con:confidence>
       </gp:location-info>
       <gp:usage-rules>
         <gp:retransmission-allowed>true</gp:retransmission-allowed>
       </gp:usage-rules>
       <gp:method>Manual</gp:method>
     </gp:geopriv>
   </status>
   <timestamp>2022-09-08T18:29:46Z</timestamp>
 </tuple>
</presence>
^M
--77249240-1983-4c2c-8b14-f5982cd3823b--^M
{code}

Sends a Trying response.
At this point, I hear my disk thrashing from the CPU/memory for the two VMs.  After a second or so, Asterisk outputs a Segmentation Fault
Comments:By: Asterisk Team (asteriskteam) 2022-09-08 14:11:28.773-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Dan Cropp (daninmadison) 2022-09-08 14:12:41.081-0500

Attaching a core dump

By: George Joseph (gjoseph) 2022-09-13 08:26:33.200-0500

There's a review up on Gerrit that should fix the issue if you want to give it a try.


By: Friendly Automation (friendly-automation) 2022-09-13 22:02:28.305-0500

Change 19210 merged by Friendly Automation:
res_geolocation: Fix segfault when there's an empty element

[https://gerrit.asterisk.org/c/asterisk/+/19210|https://gerrit.asterisk.org/c/asterisk/+/19210]

By: Friendly Automation (friendly-automation) 2022-09-13 22:54:00.916-0500

Change 19239 merged by Friendly Automation:
res_geolocation: Fix segfault when there's an empty element

[https://gerrit.asterisk.org/c/asterisk/+/19239|https://gerrit.asterisk.org/c/asterisk/+/19239]

By: Friendly Automation (friendly-automation) 2022-09-13 22:56:23.923-0500

Change 19238 merged by Friendly Automation:
res_geolocation: Fix segfault when there's an empty element

[https://gerrit.asterisk.org/c/asterisk/+/19238|https://gerrit.asterisk.org/c/asterisk/+/19238]

By: Friendly Automation (friendly-automation) 2022-09-13 22:58:32.447-0500

Change 19242 merged by Friendly Automation:
res_geolocation: Fix segfault when there's an empty element

[https://gerrit.asterisk.org/c/asterisk/+/19242|https://gerrit.asterisk.org/c/asterisk/+/19242]

By: Friendly Automation (friendly-automation) 2022-09-14 04:05:15.554-0500

Change 19241 merged by Joshua Colp:
res_geolocation: Fix segfault when there's an empty element

[https://gerrit.asterisk.org/c/asterisk/+/19241|https://gerrit.asterisk.org/c/asterisk/+/19241]

By: Friendly Automation (friendly-automation) 2022-09-14 04:05:45.209-0500

Change 19240 merged by Joshua Colp:
res_geolocation: Fix segfault when there's an empty element

[https://gerrit.asterisk.org/c/asterisk/+/19240|https://gerrit.asterisk.org/c/asterisk/+/19240]