[Asterisk-code-review] Core/Stasis: Fix "FRACK!, Failed assertion bad magic number" happens ... (asterisk[16])

Evgenios Muratidis asteriskteam at digium.com
Mon May 24 09:02:42 CDT 2021


Evgenios Muratidis has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15762 )

Change subject: Core/Stasis: Fix "FRACK!, Failed assertion bad magic number" happens when unsubscribe an application from an event source
......................................................................


Patch Set 2:

> Patch Set 2:
> 
> > Patch Set 2:
> > 
> > > Patch Set 2:
> > > 
> > > > Patch Set 2:
> > > > 
> > > > > Patch Set 2:
> > > > > 
> > > > > > Patch Set 2:
> > > > > > 
> > > > > > No, I'm not trying to make apps have subscription links too. They are not actually. It is only abstractly possible to assume that the application is referring to a subscription. In fact, the subscription object doesn't care who links to it. The only important thing is that if we want to subscribe several applications to one subscription, then we must increase the reference counter of the object of this subscription. Otherwise, there will be either a memory leak or an exception. Look at the example described above with three applications and one subscription again, please
> > > > > 
> > > > > With the current code yes, things are incorrect.
> > > > > 
> > > > > I disagree however that we must increase the reference count. The unsubscribe code knows when no applications are present any longer as it does removal of itself at that point. Right now that reference counting for that situation is incorrect because of a double unref, my proposed change would rectify it. I've gone over my proposed change and don't see where the reference count would be incorrect.
> > > > 
> > > > I'm also working on testing to verify it.
> > > 
> > > Ok, try this example with asterisk built without my changes:
> > > 1. Subscribe with three different applications (app_1, app_2, app_3), for one technology subscription (SIP)
> > > 
> > > 2. Unsubscribe in turn those applications (app_1, app_2, app_3) from the subscription (SIP)
> > 
> > With no changes it causes errors, as I expected.
> > With moving the "ao2_ref(sub, -1);" no errors are encountered, the reference counting is correct, and the subscription is destroyed.
> 
> I also tested the endpoint specific subscription scenario with your ast_endpoint_get_id change and moving the "ao2_ref(sub, -1);" and it also works as expected - no errors, reference counting is correct, subscription is destroyed.

Could you show your changes, please, I don't understand, what you mean


-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15762
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ia91b15f8e5ea68f850c66889a6325d9575901729
Gerrit-Change-Number: 15762
Gerrit-PatchSet: 2
Gerrit-Owner: Evgenios Muratidis <jone1984 at hotmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Mon, 24 May 2021 14:02:42 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210524/d1cfadab/attachment.html>


More information about the asterisk-code-review mailing list