[bug]: core: SIGSEGV on DTMF when no timing modules loaded
Severity
Minor
Versions
20.6.0, 18.21.0
Components/Modules
core
Operating Environment
Debian Bookworm based Docker container
Frequency of Occurrence
Constant
Issue Description
This is a re-open of https://issues-archive.asterisk.org/ASTERISK-28800.
Without res_timing modules loaded, Asterisk will segfault when it receives DTMF on a call, such as in a dialplan menu. The segfault happens with no error and no log, just call the system, press a button, and boom you’re back at the OS command prompt. There appears to be a missing error handler to cause the missing module to be detected and the system config to be gracefully rejected.
Running without res_timing is user error, and I explained how I got to this point in https://community.asterisk.org/t/asterisk-28800-still-open/. However, the process to identify the error could be improved. From a user perspective, I don’t expect Asterisk to work without the timing modules, but I do expect Asterisk to not segfault silently when a module is missing. Thanks.
Relevant log output
*CLI> Segmentation fault (core dumped)
$
Asterisk Issue Guidelines
- [X] Yes, I have read the Asterisk Issue Guidelines
core-asterisk-2024-01-31T13-49-42Z-brief.txt core-asterisk-2024-01-31T13-49-42Z-full.txt core-asterisk-2024-01-31T13-49-42Z-info.txt core-asterisk-2024-01-31T13-49-42Z-locks.txt core-asterisk-2024-01-31T13-49-42Z-thread1.txt
FYI, this still applies also in Asterisk 20.8.2 in case no timing module is loaded.
Thread 207 "asterisk" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 30220]
ast_timer_set_rate (handle=0x0, rate=50) at timing.c:168
(gdb) bt
#0 ast_timer_set_rate (handle=0x0, rate=50) at timing.c:168
#1 0x000000000049074f in __ast_read (chan=0x7ffff377b380, dropaudio=dropaudio@entry=0, dropnondefault=dropnondefault@entry=0) at channel.c:3995
#2 0x0000000000491a39 in ast_read_stream (chan=<optimized out>) at channel.c:4306
#3 0x000000000047585d in bridge_handle_trip (bridge_channel=0x7ffff0534070) at bridge_channel.c:2558
#4 bridge_channel_wait (bridge_channel=0x7ffff0534070) at bridge_channel.c:2771
#5 bridge_channel_internal_join (bridge_channel=bridge_channel@entry=0x7ffff0534070) at bridge_channel.c:2947
#6 0x0000000000464fed in ast_bridge_join (bridge=bridge@entry=0x7ffff74019c0, chan=chan@entry=0x7ffff377b380, swap=swap@entry=0x0, features=features@entry=0x7ffff71f9a98, tech_args=tech_args@entry=0x0,
flags=flags@entry=(AST_BRIDGE_JOIN_PASS_REFERENCE | AST_BRIDGE_JOIN_INHIBIT_JOIN_COLP)) at bridge.c:1679
#7 0x0000000000564c00 in ast_bridge_call_with_flags (chan=0x7ffff377b380, peer=0x7ffff37799d0, config=0x7ffff71f9d30, flags=0) at features.c:686
#8 0x00007ffff6b4961c in ?? ()
#9 0x7473616d40343332 in ?? ()
#10 0x00006e616c707265 in ?? ()
#11 0x0000000000000000 in ?? ()