[Home]

Summary:ASTERISK-27346: res_xmpp: Crash if OAuth 2.0 is used before curl is loaded
Reporter:Ronald Raikes (reraikes)Labels:patch
Date Opened:2017-10-15 16:29:32Date Closed:2017-10-24 15:00:40
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_xmpp
Versions:15.1.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) ASTERISK-27346.diff
( 1) backtrace.zip
Description:Google Voice operation is normal when OAuth 2.0 is not used:

{code}
[*********gmailcom]
type=client
serverhost=talk.google.com
username=********@gmail.com
secret=**********
# refresh_token=*********************************************
# oauth_clientid=*********************************************.apps.googleusercontent.com
# oauth_secret=************************
port=5222
usetls=yes
usesasl=yes
status=available
statusmessage="I am Available"
timeout=5
priority=1
{code}

Asterisk crashes when OAuth 2.0 is used:

{code}
[*********gmailcom]
type=client
serverhost=talk.google.com
username=********@gmail.com
# secret=**********
refresh_token=*********************************************
oauth_clientid=*********************************************.apps.googleusercontent.com
oauth_secret=************************
port=5222
usetls=yes
usesasl=yes
status=available
statusmessage="I am Available"
timeout=5
priority=1
{code}

Backtraces are available.
Comments:By: Asterisk Team (asteriskteam) 2017-10-15 16:29:33.173-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].

By: Joshua C. Colp (jcolp) 2017-10-15 16:46:34.614-0500

Thank you for the crash report. However, we need more information to investigate the crash. Please provide:

1. A backtrace generated from a core dump using the instructions provided on the Asterisk wiki [1].
2. Specific steps taken that lead to the crash.
3. All configuration information necesary to reproduce the crash.

Thanks!

[1]: https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace



By: Ronald Raikes (reraikes) 2017-10-15 17:06:36.373-0500

1. I have backtraces, but they contain Google Voice credentials, so I don't want to attach them publicly (there doesn't appear to be a private option).  Please provide instructions as to how to provide the backtraces privately.

2. Simply start Asterisk and it immediately crashes.

3. Configuration information already provided (this is a fresh install and only one Google Voice account is configured).


By: Joshua C. Colp (jcolp) 2017-10-15 17:32:20.742-0500

Can you not sanitize and remove the credentials from it?

By: Michael Kuron (mkuron) 2017-10-16 15:38:31.873-0500

I think I have seen the same issue a while ago and fixed it by adding the following to modules.conf:
{code}
preload => res_curl.so
preload => func_curl.so
{code}

I never got around to investigating that, but it seems like a module dependency issue (assuming this is even the same bug you’re seeing).

By: Ronald Raikes (reraikes) 2017-10-16 16:21:28.755-0500

Adding:
{code}
preload => res_curl.so
preload => func_curl.so
{code}
to modules.conf does appear to eliminate the crashes.

Now the question is whether this will be fixed in Asterisk so that these additions are not required or whether Sangoma needs to incorporate these additions intto their default Preloaded Modules list in FreePBX.

By: Joshua C. Colp (jcolp) 2017-10-20 11:58:30.032-0500

Please try this patch. It moves some of the logic which allows things to be initialized as chan_motif expects. Later on once CURL is loaded it should connect as expected.

By: Ronald Raikes (reraikes) 2017-10-20 13:59:10.579-0500

The ASTERISK-27346.diff patch appears to correct the problem.  Following application of the patch, preloading of res_curl.so and func_curl.so is no longer required.


By: Friendly Automation (friendly-automation) 2017-10-24 15:00:41.216-0500

Change 6864 merged by Jenkins2:
res_xmpp: Ensure the connection filter is available.

[https://gerrit.asterisk.org/6864|https://gerrit.asterisk.org/6864]

By: Friendly Automation (friendly-automation) 2017-10-24 15:36:08.994-0500

Change 6865 merged by Joshua Colp:
res_xmpp: Ensure the connection filter is available.

[https://gerrit.asterisk.org/6865|https://gerrit.asterisk.org/6865]

By: Friendly Automation (friendly-automation) 2017-10-24 15:41:38.833-0500

Change 6866 merged by Joshua Colp:
res_xmpp: Ensure the connection filter is available.

[https://gerrit.asterisk.org/6866|https://gerrit.asterisk.org/6866]

By: Friendly Automation (friendly-automation) 2017-10-25 11:50:13.729-0500

Change 6914 merged by George Joseph:
res_xmpp: Ensure the connection filter is available.

[https://gerrit.asterisk.org/6914|https://gerrit.asterisk.org/6914]

By: Friendly Automation (friendly-automation) 2017-10-25 11:50:23.458-0500

Change 6917 merged by George Joseph:
res_xmpp: Ensure the connection filter is available.

[https://gerrit.asterisk.org/6917|https://gerrit.asterisk.org/6917]

By: Friendly Automation (friendly-automation) 2017-10-25 11:50:31.700-0500

Change 6915 merged by George Joseph:
res_xmpp: Ensure the connection filter is available.

[https://gerrit.asterisk.org/6915|https://gerrit.asterisk.org/6915]

By: Friendly Automation (friendly-automation) 2017-10-25 11:50:39.950-0500

Change 6916 merged by George Joseph:
res_xmpp: Ensure the connection filter is available.

[https://gerrit.asterisk.org/6916|https://gerrit.asterisk.org/6916]