[Home]

Summary:ASTERISK-28377: ARI: Crash when unanswered channel rejoins dial bridge automatically
Reporter:David Dhuyvetter (ddhuyvetter)Labels:
Date Opened:2019-04-09 10:16:06Date Closed:2019-05-07 04:38:29
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_ari
Versions:16.2.1 16.3.0 Frequency of
Occurrence
Frequent
Related
Issues:
is duplicated byASTERISK-27756 bridge: Failure to impart a channel results in bad data causing crash
is related toASTERISK-26718 ARI: Bridge destroying doesn't work as expected
Environment:x86_64 x86_64 x86_64 GNU/Linux (Centos 7.6.1810) running in a docker container on same OSAttachments:( 0) bridge.py
( 1) console_28377.txt
( 2) core.517.tar.gz
( 3) debug_log_28377.txt
( 4) extensions.conf
Description:Using ARI
1) accept inbound channel
2) create outbound channel
3) bridge inbound channel to outbound
4) dial outbound and let dial timeout expire
5) hangup outbound channel and destroy bridge
5) hangup inbound channel

This results in either messages like:

[2019-04-09 14:58:14.291878] WARNING[401][C-00000001]: bridge.c:1851 bridge_impart_internal: Channel SIP/199.68.168.27-00000000 has a PBX thread and cannot be imparted into bridge 65da81c3-613f-4ad4-a094-98f6e4e6e2c9
FRACK!, Failed assertion user_data is NULL (0) at line 942 in dial_bridge_after_cb of stasis/control.c
[2019-04-09 14:58:14.307946] ERROR[401][C-00000001]: stasis/control.c:942 dial_bridge_after_cb: FRACK!, Failed assertion user_data is NULL (0)
[2019-04-09 14:58:14.308661] ERROR[401][C-00000001]:   Got 11 backtrace records
# 0: /usr/sbin/asterisk(__ao2_lock+0x1ed) [0x45d59d]
# 1: /usr/lib64/asterisk/modules/res_stasis.so(+0x151f0) [0x7f8e86f0d1f0]
# 2: /usr/sbin/asterisk() [0x477251]
# 3: /usr/sbin/asterisk(ast_datastore_free+0x1c) [0x4ca98c]
# 4: /usr/sbin/asterisk() [0x499e39]
# 5: /usr/sbin/asterisk(__ao2_ref+0x25c) [0x45de5c]
# 6: /usr/sbin/asterisk() [0x52046e]
# 7: /usr/sbin/asterisk() [0x5210db]
# 8: /usr/sbin/asterisk() [0x59a149]
# 9: /lib64/libpthread.so.0(+0x7dd5) [0x7f8eaf191dd5]
#10: /lib64/libc.so.6(clone+0x6d) [0x7f8eae533ead]

or Segmentation Fault, or both
Comments:By: Asterisk Team (asteriskteam) 2019-04-09 10:16:06.811-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: David Dhuyvetter (ddhuyvetter) 2019-04-09 10:26:37.899-0500

bridge.py - ARI program.  Call and let dial timeout to trigger core dump

By: Joshua C. Colp (jcolp) 2019-04-09 10:27:14.675-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. Please read over the Asterisk Issue Guidelines [1] which discusses the information necessary for your issue to be resolved and the format that information needs to be in. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. The specific steps or actions you took that caused you to encounter the problem.
2. The behavior you expected and the location of documentation that led you to that expectation.
3. The behavior you actually encountered.

To demonstrate the issue in detail, please include Asterisk log files generated per the instructions on the wiki [2]. If applicable, please ensure that protocol-level trace debugging is enabled, e.g., 'sip set debug on' if the issue involves chan_sip, and configuration information such as dialplan and channel configuration.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

[2] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

We ideally need an ARI application which reproduces this issue - and not just a short description of what you're doing. Arguments and such can play a big part. We also need the console log showing what is going on.

A backtrace from the core dump would also be useful.

By: Joshua C. Colp (jcolp) 2019-04-09 10:46:45.374-0500

What happens if you remove both channels from the bridge, hang them up, and then destroy the bridge?

By: David Dhuyvetter (ddhuyvetter) 2019-04-09 11:34:11.030-0500

console output and debug log

By: David Dhuyvetter (ddhuyvetter) 2019-04-09 11:50:07.765-0500

Modified teardown_bridge to be:

def teardown_bridge(channel, outgoing, bridge):
   """Tear down bridge"""
   bridge.removeChannel(channel=channel.id)
   bridge.removeChannel(channel=outgoing.id)
   safe_hangup(outgoing)
   safe_hangup(channel)
   safe_bridge_destroy(bridge)

Same result:

[2019-04-09 16:44:11.662283]     -- Channel SIP/199.180.210.71-00000007 left 'simple_bridge' stasis-bridge <41a77cc6-88fa-42ee-b49e-fabdfe49b4b4>
[2019-04-09 16:44:11.785439]     -- Channel SIP/199.68.168.27-00000006 left 'simple_bridge' stasis-bridge <41a77cc6-88fa-42ee-b49e-fabdfe49b4b4>
[2019-04-09 16:44:11.785595] WARNING[390][C-00000004]: bridge.c:1853 bridge_impart_internal: Channel SIP/199.68.168.27-00000006 has a PBX thread and cannot be imparted into bridge eee9859b-892e-492d-a272-cf213669e9b4
FRACK!, Failed assertion bad magic number 0x0 for object 0x8fbe1a (0) at line 1029 in dial_bridge_after_cb of stasis/control.c
[2019-04-09 16:44:16.330194] ERROR[390][C-00000004]: stasis/control.c:1029 dial_bridge_after_cb: FRACK!, Failed assertion bad magic number 0x0 for object 0x8fbe1a (0)
[2019-04-09 16:44:16.331352] ERROR[390][C-00000004]:   Got 17 backtrace records
# 0: /usr/sbin/asterisk(__ast_assert_failed+0x84) [0x5bc26c]
# 1: /usr/sbin/asterisk() [0x45ebb8]
# 2: /usr/sbin/asterisk(__ao2_lock+0x64) [0x45ec1e]
# 3: /usr/lib64/asterisk/modules/res_stasis.so(+0x17868) [0x7fd938019868]
# 4: /usr/lib64/asterisk/modules/res_stasis.so(+0x17a36) [0x7fd938019a36]
# 5: /usr/sbin/asterisk() [0x47abe0]
# 6: /usr/sbin/asterisk() [0x47acbc]
# 7: /usr/sbin/asterisk() [0x47ad03]
# 8: /usr/sbin/asterisk(ast_datastore_free+0x4a) [0x4d374c]
# 9: /usr/sbin/asterisk() [0x49b670]
#10: /usr/sbin/asterisk(__ao2_ref+0x5da) [0x45fa02]
#11: /usr/sbin/asterisk(ast_hangup+0x47b) [0x49cccd]
#12: /usr/sbin/asterisk() [0x52c6d4]
#13: /usr/sbin/asterisk() [0x52ca3f]
#14: /usr/sbin/asterisk() [0x5b9632]
#15: /lib64/libpthread.so.0(+0x7dd5) [0x7fd95c3eedd5]
#16: /lib64/libc.so.6(clone+0x6d) [0x7fd95b790ead]

Segmentation fault



By: David Dhuyvetter (ddhuyvetter) 2019-04-09 12:07:32.402-0500

If I answer the inbound channel before dialing the outbound channel, there is no error when the inbound channel is hung up.

By: Holger Hans Peter Freyther (zecke) 2019-04-22 02:53:27.294-0500

Can you try my patches from:

https://gerrit.asterisk.org/c/asterisk/+/11254 and https://gerrit.asterisk.org/c/asterisk/+/11255?

By: Abhay Gupta (agupta) 2019-04-23 03:28:32.128-0500

I was trying with asterisk 15.6.1 and following the same sequence of inbound call which is not answered and then put that in bridge , create a channel , put that in same bridge , dial the channel which times out and then hangup all channels and delete bridge but i am not able to generate the issue .

By: David Dhuyvetter (ddhuyvetter) 2019-04-23 18:16:52.199-0500

I am unable to reproduce the problems when I build asterisk with https://gerrit.asterisk.org/c/asterisk/+/11254 and https://gerrit.asterisk.org/c/asterisk/+/11255

By: Marin Odrljin (modrljin) 2019-05-07 03:17:55.405-0500

Is issue ASTERISK-26868 related to this one?

By: Joshua C. Colp (jcolp) 2019-05-07 04:38:29.320-0500

The fix that was merged for ASTERISK-27756 would resolve this.