[Home]

Summary:ASTERISK-30383: Asterisk crashes on snoop channel handle
Reporter:sungtae kim (pchero)Labels:
Date Opened:2023-01-04 05:06:07.000-0600Date Closed:2023-01-04 05:48:56.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_stasis_snoop
Versions:18.11.3 Frequency of
Occurrence
Occasional
Related
Issues:
duplicatesASTERISK-29604 ari: Segfault with lots of calls
Environment:Attachments:
Description:The asterisk crashed when it hangs up the snoop channel.

{noformat}
Core was generated by `/usr/sbin/asterisk -nfpgvvvvvv'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  ast_str_case_hash (str=0x15c <error: Cannot access memory at address 0x15c>) at /tmp/asterisk-18.11.3/include/asterisk/strings.h:1283
1283 /tmp/asterisk-18.11.3/include/asterisk/strings.h: No such file or directory.
[Current thread is 1 (Thread 0x7f3b8c251700 (LWP 90934))]
(gdb) bt
#0  ast_str_case_hash (str=0x15c <error: Cannot access memory at address 0x15c>) at /tmp/asterisk-18.11.3/include/asterisk/strings.h:1283
#1  channel_snapshot_uniqueid_hash_cb (obj=0x15c, flags=<optimized out>) at stasis_channels.c:211
#2  0x000055865fb65280 in hash_ao2_find_first (self=0x5586612ed878, flags=OBJ_SEARCH_KEY, arg=0x15c, state=0x7f3b8c24e860) at astobj2_hash.c:363
#3  0x000055865fb62e3f in internal_ao2_traverse (self=0x5586612ed878, flags=flags@entry=OBJ_SEARCH_KEY, cb_fn=<optimized out>, arg=0x15c, tag=tag@entry=0x0,
   file=file@entry=0x55865fd6dd35 "stasis_channels.c", line=907, func=0x55865fd6e6a0 <__PRETTY_FUNCTION__.20> "ast_channel_snapshot_get_latest", type=AO2_CALLBACK_DEFAULT, data=0x0)
   at astobj2_container.c:318
#4  0x000055865fb63406 in __ao2_callback (func=0x55865fd6e6a0 <__PRETTY_FUNCTION__.20> "ast_channel_snapshot_get_latest", line=907, file=0x55865fd6dd35 "stasis_channels.c", tag=0x0, arg=<optimized out>,
   cb_fn=<optimized out>, flags=OBJ_SEARCH_KEY, c=<optimized out>) at astobj2_container.c:414
#5  __ao2_find (c=<optimized out>, arg=<optimized out>, flags=flags@entry=OBJ_SEARCH_KEY, tag=tag@entry=0x0, file=file@entry=0x55865fd6dd35 "stasis_channels.c", line=line@entry=907,
   func=0x55865fd6e6a0 <__PRETTY_FUNCTION__.20> "ast_channel_snapshot_get_latest") at astobj2_container.c:437
#6  0x000055865fc8623f in ast_channel_snapshot_get_latest (uniqueid=<optimized out>) at stasis_channels.c:907
#7  0x00007f3c16795905 in publish_chanspy_message (snoop=0x7f3bf402ef18, start=<optimized out>) at res_stasis_snoop.c:138
#8  0x00007f3c16795a7c in snoop_hangup (chan=0x7f3bf417ed90) at res_stasis_snoop.c:228
#9  0x000055865fb9edaa in ast_hangup (chan=0x7f3bf417ed90) at channel.c:2612
#10 0x00007f3c1679631c in stasis_app_control_snoop (chan=chan@entry=0x7f3c102e9b50, spy=spy@entry=STASIS_SNOOP_DIRECTION_OUT, whisper=whisper@entry=STASIS_SNOOP_DIRECTION_NONE,
   app=app@entry=0x7f3bf411a2a0 "sdp", app_args=app_args@entry=0x7f3bf40e15e0 "context=record-out,organization_id=9f597df4-fb37-11e9-9992-d6e2ab7d83d2",
   snoop_id=snoop_id@entry=0x7f3bf417be38 "a1e135cc-a5d2-4589-9e56-a4da680deffb") at res_stasis_snoop.c:423
#11 0x00007f3c149edb97 in ari_channels_handle_snoop_channel (args_channel_id=<optimized out>, args_spy=<optimized out>, args_whisper=<optimized out>, args_app=0x7f3bf411a2a0 "sdp",
   args_app_args=0x7f3bf40e15e0 "context=record-out,organization_id=9f597df4-fb37-11e9-9992-d6e2ab7d83d2", args_snoop_id=0x7f3bf417be38 "a1e135cc-a5d2-4589-9e56-a4da680deffb", response=0x7f3b8c24ecf0)
   at ari/resource_channels.c:1638
#12 0x00007f3c149f0ef8 in ast_ari_channels_snoop_channel_with_id (headers=headers@entry=0x7f3bf4065a20, args=args@entry=0x7f3b8c24eb30, response=response@entry=0x7f3b8c24ecf0)
   at ari/resource_channels.c:1669
#13 0x00007f3c149ecfe2 in ast_ari_channels_snoop_channel_with_id_cb (ser=<optimized out>, get_params=<optimized out>, path_vars=<optimized out>, headers=0x7f3bf4065a20, body=<optimized out>,
   response=0x7f3b8c24ecf0) at res_ari_channels.c:2689
#14 0x00007f3c1673bdb0 in ast_ari_invoke (ser=ser@entry=0x7f3bb0225840, uri=uri@entry=0x7f3b8c24edaa "channels/1671057152.157492/snoop/a1e135cc-a5d2-4589-9e56-a4da680deffb",
   method=method@entry=AST_HTTP_POST, get_params=get_params@entry=0x0, headers=headers@entry=0x7f3bf4065a20, body=body@entry=0x7f3bf40ad510, response=0x7f3b8c24ecf0) at res_ari.c:587
#15 0x00007f3c1673d3c5 in ast_ari_callback (ser=0x7f3bb0225840, urih=0x7f3c16746460 <http_uri>, uri=0x7f3b8c24edaa "channels/1671057152.157492/snoop/a1e135cc-a5d2-4589-9e56-a4da680deffb",
   method=AST_HTTP_POST, get_params=0x0, headers=0x7f3bf4065a20) at res_ari.c:1058
#16 0x000055865fcf23b1 in handle_uri (headers=0x7f3bf4065a20, method=AST_HTTP_POST, uri=0x7f3b8c24edaa "channels/1671057152.157492/snoop/a1e135cc-a5d2-4589-9e56-a4da680deffb", ser=0x7f3bb0225840)
   at http.c:1490
#17 httpd_process_request (ser=ser@entry=0x7f3bb0225840) at http.c:1931
#18 0x000055865fcf296e in httpd_helper_thread (data=0x7f3bb0225840) at http.c:1994
#19 0x000055865fcab89d in dummy_start (data=<optimized out>) at utils.c:1574
#20 0x00007f3c195b7ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#21 0x00007f3c1933ea2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
{noformat}
Comments:By: Asterisk Team (asteriskteam) 2023-01-04 05:06:08.873-0600

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. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

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.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].