[Home]

Summary:ASTERISK-27229: bridge: Old channel video source not set to NULL after unref
Reporter:Richard Kenner (kenner)Labels:
Date Opened:2017-08-29 15:04:32Date Closed:2017-12-21 05:48:22.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Bridging
Versions:14.6.0 Frequency of
Occurrence
Occasional
Related
Issues:
Environment:CentOS 7Attachments:
Description:I've had two Asterisk crashes today that seem to be caused by errors
where chan->tech_pvt is pointing to something that can't be deallocated
and I think I see a reference count bug in the above function.

It contains:

{noformat}
               if (data->chan_old_vsrc) {
                       ast_channel_unref(data->chan_old_vsrc);
               }
{noformat}

Shouldn't this also have:

{noformat}
                       data->chan_old_vsrc = NULL;
{noformat}

It seems to me that if it doesn't and the next condition also isn't
true, then the next time this same code is executed, it'll decrement
the reference count of the old channel again, which is wrong since it
hasn't been decremented.
Comments:By: Asterisk Team (asteriskteam) 2017-08-29 15:04:33.234-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: Kevin Harwell (kharwell) 2017-09-06 17:35:31.905-0500

Asterisk should not be crashing that is for sure. When it does it is always helpful to have a backtrace(s) on the issue (See [Getting a Backtrace|https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace] for more info).

I haven't looked closely, but your thoughts about where it is crashing sound like that possibly could be the case.

Also, since you have already looked at the code and have an idea on a fix, here is more info ([Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]) on how to do that if you are interested :-)

By: Richard Kenner (kenner) 2017-09-06 17:55:32.520-0500

Sorry, I didn't include the backtrace because it didn't look particularly useful and I can no longer get it from the dump files since I've recompiled with changes.  At some point, I should look into the patch contribution process, but these are very small, so I can just say what they are without getting into IP issues.

By: Corey Farrell (coreyfarrell) 2017-12-19 19:11:53.532-0600

I'll patch the code you are referring to tomorrow.  No way to know if it'll fix your issues without debugging information, but the code you pointed to looks suspicious.

By: Friendly Automation (friendly-automation) 2017-12-21 05:48:23.283-0600

Change 7678 merged by Jenkins2:
bridge: Old channel video source not set to NULL after unref.

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

By: Friendly Automation (friendly-automation) 2017-12-21 06:09:41.937-0600

Change 7677 merged by Joshua Colp:
bridge: Old channel video source not set to NULL after unref.

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

By: Friendly Automation (friendly-automation) 2017-12-21 06:16:49.043-0600

Change 7676 merged by Joshua Colp:
bridge: Old channel video source not set to NULL after unref.

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