[Home]

Summary:ASTERISK-28815: res_pjsip.so segfaulting on 17.3.0
Reporter:Adam B (adamb)Labels:
Date Opened:2020-04-07 12:17:19Date Closed:2020-04-16 04:34:28
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/Sorcery Resources/res_config_odbc
Versions:17.3.0 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:OS: Ubuntu 18.04.4 LTS x86_64 VMWare VM 1GB Ram / 1 ProcessorAttachments:( 0) core.tar.gz
( 1) core.tar.gz
( 2) core.tar.gz
( 3) ps_endpoints.sql
Description:When using res_pjsip in real time with ODBC to MySQL 5.7 I am getting a segfault if I have 6 endpoints or more.

This is a random segfault either on startup or doing a pjsip show endpoints on CLI; however is quite frequent (give or take about 85% of the time) and reproducible in my environment.

If I remove any endpoint, the crash goes away; if I remove realtime for just endpoints in sorcery, the issue goes away.

I have unoptimized core dumps available.
Comments:By: Asterisk Team (asteriskteam) 2020-04-07 12:17:20.377-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.

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.

By: Adam B (adamb) 2020-04-07 12:18:27.010-0500

Core Dump for this issue

By: George Joseph (gjoseph) 2020-04-07 16:00:30.369-0500

Thanks for the backtraces.  Did this issue happen in 17.2?

By: Adam B (adamb) 2020-04-07 16:23:07.226-0500

George,

I have not tried in 17.2 (I'm upgrading from 10.X) I did try in 16.9.0 and had the same behavior.

In playing with things, I changed from ODBC to res_config_mysql and it loads perfectly so far.

This is not a production unit, so if you need me to try on 17.2 or any other version I certainly can.

By: George Joseph (gjoseph) 2020-04-08 08:00:24.675-0500

If you could try 17.2 that'd help a great deal.  I think your issue is related to a possible regression introduced in the latest round of releases (17.3, 16.9, 13.32) and trying the previous release would confirm it.


By: Adam B (adamb) 2020-04-08 10:09:43.190-0500

Same crashes are happening on 17.2.0

However I have observed if I use res_config_mysql and change extconfig to mysql instead of ODBC it works flawlessly against all tested versions.

Core dump attached

By: George Joseph (gjoseph) 2020-04-08 10:32:40.701-0500

Hmmm.  Can you try other thing?  We reverted an ODBC change the other day but it hasn't been released yet.  Can you checkout the latest version of the 17 branch directly from git and try it?

git clone https://gerrit.asterisk.org/asterisk ./asterisk-test
cd asterisk-test
git checkout 17
<etc>


By: Adam B (adamb) 2020-04-08 13:30:30.394-0500

Crashed on Asterisk GIT-17-c971769db5

Core attached.

By: Sean Bright (seanbright) 2020-04-08 14:41:26.403-0500

[~adamb], can I see the DDL for your endpoint table?

By: Adam B (adamb) 2020-04-08 15:11:30.707-0500

ps_endpoints table schema attached.

This was created with the Alembic script

By: Joshua C. Colp (jcolp) 2020-04-14 09:29:10.242-0500

What ODBC driver for MySQL is in use for this, and what version?

By: Adam B (adamb) 2020-04-14 09:50:50.957-0500

Official MySQL Connector 5.3.13 for Ubuntu x86_64

Also crashed the same with MySQL Connector 8.0.19 but I downgraded thinking that was the issue and running MySQL 5.7.29

By: Joshua C. Colp (jcolp) 2020-04-14 10:13:14.437-0500

Does trying the MariaDB connector alter things? And what is your res_odbc.conf?

By: Adam B (adamb) 2020-04-14 12:23:32.960-0500

My res_odbc is default. I configured only extconfig.conf to point to the DSN "asterisk" which points to the ODBC MySQL driver.

I switched to MariaDB 3.1.6-ga on GIT-17-c971769db5 and so far I cannot reproduce the crash. It appears we have isolated this to the MySQL ODBC Driver.

By: Joshua C. Colp (jcolp) 2020-04-14 12:29:24.026-0500

People have had crash issues in the past which were resolved by switching to the MariaDB ODBC driver, but I've never seen a crash like this exactly.

By: Joshua C. Colp (jcolp) 2020-04-16 04:34:29.063-0500

As this appears to be an issue with the MySQL ODBC connector and not in Asterisk itself I am closing this issue out. I have updated the guide on the wiki, though, to use the MariaDB connector and also added a warning to it about the MySQL connector.