Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
On Tue, May 6, 2014 at 1:01 PM, Richard Kenner ken...@gnat.com wrote: That is definitely a leak and the fix looks good. Thanks. That leak is most likely the one biting you. It definitely is. Committed the fix for this leak on Asterisk v12 branch in -r413454. There is another leak in handle_cli_confbridge_kick() if the participant to kick is not in the conference. Confirmed. I missed that one in my code reading. I just fixed it the same way. Committed the fix for this leak on Asterisk v12 branch in -r413452. This leak also applied to Asterisk v11. Richard -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
Committed the fix for this leak on Asterisk v12 branch in -r413452. This leak also applied to Asterisk v11. Thanks. Is this for both the one in the talking callback or the one in handle_cli_confbridge_kick or both (the fix is similar in both)? -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
On Wed, May 7, 2014 at 4:43 PM, Richard Kenner ken...@gnat.com wrote: Committed the fix for this leak on Asterisk v12 branch in -r413452. This leak also applied to Asterisk v11. Thanks. Is this for both the one in the talking callback or the one in handle_cli_confbridge_kick or both (the fix is similar in both)? The one in handle_cli_confbridge_kick() applies to v11+. The other one applies to v12+. Richard -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
Really, I think we're pretty positive there's a ref leak (since otherwise, the CBAnn channel would be long gone). If you can get a ref debug log and the standard Asterisk DEBUG log showing the problem, that would help a lot in finding out what is going on. I think the bug is in conf_handle_talker_cb. It calls ao2_find but has no mechanism to decremement the refcount. It appears that the following is the best fix. I looked at all remaining calls to ao2_find in app_confbridge.c and they look OK. Do you agree with the below fix? *** app_confbridge.c.bug2014-05-06 06:42:21.0 -0400 --- app_confbridge.c2014-05-06 06:42:05.0 -0400 *** static int conf_handle_talker_cb(struct *** 1461,1467 struct pvt_talker_cb *pvt = hook_pvt; const char *conf_name = pvt-conf_name; ! struct confbridge_conference *conference = ao2_find(conference_bridges, conf_name, OBJ_KEY); struct ast_json *talking_extras; if (!conference) { /* Remove the hook since the conference does not exist. */ --- 1461,1468 struct pvt_talker_cb *pvt = hook_pvt; const char *conf_name = pvt-conf_name; ! RAII_VAR(struct confbridge_conference *, conference, NULL, ao2_cleanup); struct ast_json *talking_extras; + conference = ao2_find(conference_bridges, conf_name, OBJ_KEY); if (!conference) { /* Remove the hook since the conference does not exist. */ -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
On Tue, May 6, 2014 at 5:45 AM, Richard Kenner ken...@gnat.com wrote: Really, I think we're pretty positive there's a ref leak (since otherwise, the CBAnn channel would be long gone). If you can get a ref debug log and the standard Asterisk DEBUG log showing the problem, that would help a lot in finding out what is going on. I think the bug is in conf_handle_talker_cb. It calls ao2_find but has no mechanism to decremement the refcount. It appears that the following is the best fix. I looked at all remaining calls to ao2_find in app_confbridge.c and they look OK. Do you agree with the below fix? *** app_confbridge.c.bug2014-05-06 06:42:21.0 -0400 --- app_confbridge.c2014-05-06 06:42:05.0 -0400 *** static int conf_handle_talker_cb(struct *** 1461,1467 struct pvt_talker_cb *pvt = hook_pvt; const char *conf_name = pvt-conf_name; ! struct confbridge_conference *conference = ao2_find(conference_bridges, conf_name, OBJ_KEY); struct ast_json *talking_extras; if (!conference) { /* Remove the hook since the conference does not exist. */ --- 1461,1468 struct pvt_talker_cb *pvt = hook_pvt; const char *conf_name = pvt-conf_name; ! RAII_VAR(struct confbridge_conference *, conference, NULL, ao2_cleanup); struct ast_json *talking_extras; + conference = ao2_find(conference_bridges, conf_name, OBJ_KEY); if (!conference) { /* Remove the hook since the conference does not exist. */ -- That is definitely a leak and the fix looks good. That leak is most likely the one biting you. There is another leak in handle_cli_confbridge_kick() if the participant to kick is not in the conference. Please go ahead and open an issue so proper credit can be given for the patch. Richard -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
That is definitely a leak and the fix looks good. Thanks. That leak is most likely the one biting you. It definitely is. There is another leak in handle_cli_confbridge_kick() if the participant to kick is not in the conference. Confirmed. I missed that one in my code reading. I just fixed it the same way. Please go ahead and open an issue so proper credit can be given for the patch. I'm not concerned about credit, but would like to get it fixed. I need to figure out what has to happen for me to be able to submit patches, but then I'll have some others to submit too. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
It may show up in 'bridge show all' - but I'd actually expect it not to show up there either. Actually, it does. I have a screen full of bridges with 0 channels. I just tried an experiment where all I have is exten = 329,1,Answer(1000) same = n,Confbridge(1234) with absolutely nothing else going on and those leak too. I need to understand why I'm seeing this and nobody else is. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
On Thu, May 1, 2014 at 7:18 AM, Richard Kenner ken...@gnat.com wrote: It may show up in 'bridge show all' - but I'd actually expect it not to show up there either. Actually, it does. I have a screen full of bridges with 0 channels. I just tried an experiment where all I have is exten = 329,1,Answer(1000) same = n,Confbridge(1234) with absolutely nothing else going on and those leak too. I need to understand why I'm seeing this and nobody else is. Please go ahead and open an issue and attach the refs log and the full DEBUG log. That will allow us to understand what's occurring here. Thanks - Matt -- Matthew Jordan Digium, Inc. | Engineering Manager 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: http://digium.com http://asterisk.org -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
Please go ahead and open an issue and attach the refs log and the full DEBUG log. That will allow us to understand what's occurring here. I need to wait until I'm sure this isn't something I caused somehow, so I need to first understand why I'm seeing this and nobody else is. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
On 5/1/2014 10:38 AM, Richard Kenner wrote: Please go ahead and open an issue and attach the refs log and the full DEBUG log. That will allow us to understand what's occurring here. I need to wait until I'm sure this isn't something I caused somehow, so I need to first understand why I'm seeing this and nobody else is. I had seen it as well but just chalked it up to not grokking how the CBAnn channels worked. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
On Tue, Apr 29, 2014 at 6:03 PM, Richard Kenner ken...@gnat.com wrote: If the channel still hangs around after the conference is destroyed then there is a problem. Am I missing something obvious: I'm looking in the confbridge_exec function. I see a conference = NULL line, but no attempt to free that structure, which is what I understand will destroy the playback channel. So where it is freed? Conferences are reference counted objects. When the reference count reaches 0 on the conference object, its destructor is automatically called. The destructor, in this case, is destroy_conference_bridge. That is where the CBAnn channel should be hung up. /* Try to allocate memory for a new conference bridge, if we fail... this won't end well. */ if (!(conference = ao2_alloc(sizeof(*conference), destroy_conference_bridge))) { ao2_unlock(conference_bridges); ast_log(LOG_ERROR, Conference '%s' could not be created.\n, conference_name); return NULL; } If the reference count on the bridge is off, you should see the conference bridge 'hanging around' after the last participant has left. If so, please file a bug report. We'll need a REF_DEBUG log to figure out who the guilty party is in holding onto a reference. The easiest way to get that is to reproduce the problem using the latest from the 12 branch (as we made reference count debugging easier just recently). Enable REF_DEBUG in menuselect under Compiler Flags, make/make install, and re-run the scenario that reproduces the result. A refs file will be created in your Asterisk log directory - attach that to the issue along with DEBUG log. Thanks! -- Matthew Jordan Digium, Inc. | Engineering Manager 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: http://digium.com http://asterisk.org -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
If the reference count on the bridge is off, you should see the conference bridge 'hanging around' after the last participant has left. And how would I be sure this is the case? I did core set debug 1 and didn't see the debug line about destroying the conference, but it doesn't show up in confbridge list. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
On Wed, Apr 30, 2014 at 8:20 AM, Richard Kenner ken...@gnat.com wrote: If the reference count on the bridge is off, you should see the conference bridge 'hanging around' after the last participant has left. And how would I be sure this is the case? I did core set debug 1 and didn't see the debug line about destroying the conference, but it doesn't show up in confbridge list. That's not terribly surprising, as the bridge is typically removed from the list of active conferences prior to the destructor being called (the destructor being the thing that releases memory, not the thing that notifies everyone that this thing *should* be destroyed). It may show up in 'bridge show all' - but I'd actually expect it not to show up there either. Really, I think we're pretty positive there's a ref leak (since otherwise, the CBAnn channel would be long gone). If you can get a ref debug log and the standard Asterisk DEBUG log showing the problem, that would help a lot in finding out what is going on. -- Matthew Jordan Digium, Inc. | Engineering Manager 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: http://digium.com http://asterisk.org -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
Really, I think we're pretty positive there's a ref leak (since otherwise, the CBAnn channel would be long gone). If you can get a ref debug log and the standard Asterisk DEBUG log showing the problem, that would help a lot in finding out what is going on. That can't be done in the 12.2.0 release, just the current SVN, right? Clearly this occurs for me and not in the simple case. So I think what I'll do is see exactly what I have that's causing it and hopefully code inspection of that piece will show the missing ref decrement. I'm away for a few days and so may not be able to get to this until I get back. Thanks for the pointers. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] CBAnn channel not going away in Asterisk 12
After an upgrade to Asterisk 12, I'm collecting channels. When I enter and then exit a conference room, I see: -- CBAnn/207-067f;1 Playing 'confbridge-leave.slin' (language 'en') -- Channel CBAnn/207-067f;2 joined 'softmix' base-bridge 5edb1920-3774-4ba3-8c4d-23e8fd04519c -- Channel CBAnn/207-067f;2 left 'softmix' base-bridge 5edb1920-3774-4ba3-8c4d-23e8fd04519c I'd expect those channel to immediately go away, but they just stay around: asterisk*CLI core show channel CBAnn/207-067f;1 -- General -- Name: CBAnn/207-067f;1 Type: CBAnn UniqueID: 1398809161.20186 LinkedID: 1398809161.20186 Caller ID: (N/A) Caller ID Name: (N/A) Connected Line ID: (N/A) Connected Line ID Name: (N/A) Eff. Connected Line ID: (N/A) Eff. Connected Line ID Name: (N/A) DNID Digits: (N/A) Language: en State: Up (6) NativeFormats: (nothing) WriteFormat: unknown ReadFormat: unknown WriteTranscode: No ReadTranscode: No Time to Hangup: 0 Elapsed Time: 0h1m3s Bridge ID: (Not bridged) -- PBX -- Context: default Extension: s Priority: 1 Call Group: 0 Pickup Group: 0 Application: (N/A) Data: (Empty) Call Identifer: (None) Variables: [Apr 29 18:07:04] ERROR[21102]: cdr.c:3106 ast_cdr_serialize_variables: Unable to find CDR for channel CBAnn/207-067f;1 asterisk*CLI core show channel CBAnn/207-067f;2 -- General -- Name: CBAnn/207-067f;2 Type: CBAnn UniqueID: 1398809161.20187 LinkedID: 1398809161.20186 Caller ID: (N/A) Caller ID Name: (N/A) Connected Line ID: (N/A) Connected Line ID Name: (N/A) Eff. Connected Line ID: (N/A) Eff. Connected Line ID Name: (N/A) DNID Digits: (N/A) Language: en State: Up (6) NativeFormats: (slin) WriteFormat: slin ReadFormat: slin WriteTranscode: No ReadTranscode: No Time to Hangup: 0 Elapsed Time: 0h3m30s Bridge ID: (Not bridged) -- PBX -- Context: default Extension: s Priority: 1 Call Group: 0 Pickup Group: 0 Application: (N/A) Data: (Empty) Call Identifer: (None) Variables: [Apr 29 18:09:31] ERROR[21102]: cdr.c:3106 ast_cdr_serialize_variables: Unable to find CDR for channel CBAnn/207-067f;2 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
On Tue, Apr 29, 2014 at 5:10 PM, Richard Kenner ken...@gnat.com wrote: After an upgrade to Asterisk 12, I'm collecting channels. When I enter and then exit a conference room, I see: -- CBAnn/207-067f;1 Playing 'confbridge-leave.slin' (language 'en') -- Channel CBAnn/207-067f;2 joined 'softmix' base-bridge 5edb1920-3774-4ba3-8c4d-23e8fd04519c -- Channel CBAnn/207-067f;2 left 'softmix' base-bridge 5edb1920-3774-4ba3-8c4d-23e8fd04519c I'd expect those channel to immediately go away, but they just stay around: asterisk*CLI core show channel CBAnn/207-067f;1 -- General -- Name: CBAnn/207-067f;1 Type: CBAnn UniqueID: 1398809161.20186 LinkedID: 1398809161.20186 Caller ID: (N/A) Caller ID Name: (N/A) Connected Line ID: (N/A) Connected Line ID Name: (N/A) Eff. Connected Line ID: (N/A) Eff. Connected Line ID Name: (N/A) DNID Digits: (N/A) Language: en State: Up (6) NativeFormats: (nothing) WriteFormat: unknown ReadFormat: unknown WriteTranscode: No ReadTranscode: No Time to Hangup: 0 Elapsed Time: 0h1m3s Bridge ID: (Not bridged) -- PBX -- Context: default Extension: s Priority: 1 Call Group: 0 Pickup Group: 0 Application: (N/A) Data: (Empty) Call Identifer: (None) Variables: [Apr 29 18:07:04] ERROR[21102]: cdr.c:3106 ast_cdr_serialize_variables: Unable to find CDR for channel CBAnn/207-067f;1 asterisk*CLI core show channel CBAnn/207-067f;2 -- General -- Name: CBAnn/207-067f;2 Type: CBAnn UniqueID: 1398809161.20187 LinkedID: 1398809161.20186 Caller ID: (N/A) Caller ID Name: (N/A) Connected Line ID: (N/A) Connected Line ID Name: (N/A) Eff. Connected Line ID: (N/A) Eff. Connected Line ID Name: (N/A) DNID Digits: (N/A) Language: en State: Up (6) NativeFormats: (slin) WriteFormat: slin ReadFormat: slin WriteTranscode: No ReadTranscode: No Time to Hangup: 0 Elapsed Time: 0h3m30s Bridge ID: (Not bridged) -- PBX -- Context: default Extension: s Priority: 1 Call Group: 0 Pickup Group: 0 Application: (N/A) Data: (Empty) Call Identifer: (None) Variables: [Apr 29 18:09:31] ERROR[21102]: cdr.c:3106 ast_cdr_serialize_variables: Unable to find CDR for channel CBAnn/207-067f;2 The announcer channel is not supposed to go away while the conference exists so it can be reused for the next sound to play into the conference. The announcer channel joins/leaves the conference as it has sounds to play. If the channel still hangs around after the conference is destroyed then there is a problem. Richard -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
The announcer channel joins/leaves the conference as it has sounds to play. If the channel still hangs around after the conference is destroyed then there is a problem. There's a problem. ;-) But thanks for pointing to how that's supposed to be handled. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CBAnn channel not going away in Asterisk 12
If the channel still hangs around after the conference is destroyed then there is a problem. Am I missing something obvious: I'm looking in the confbridge_exec function. I see a conference = NULL line, but no attempt to free that structure, which is what I understand will destroy the playback channel. So where it is freed? -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users