Bug #6163
iptv CRASH (using ffmpeg pipe)
0%
Description
I have received this crash using the ffmpeg pipe
Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: Signal: 11 in PRG: /usr/bin/tvheadend (4.3-2018~g58df4bf51) [f912b8f2d14d7ea35430c1204c0ace385ca6de66] CWD: / Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: Fault address 0x170 (Address not mapped) Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: Loaded libraries: linux-vdso.so.1 /usr/lib/x86_64-linux-gnu/libdvbcsa.so.1 /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/x> Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: Register dump [23]: 000000000000000000005619f8c3524800000000ffffffff000000000000000000007ffd56d4a94e00007ffd56d4a94f00007ffd56d4aa1000007f9bfebf4d4000005619f6f7c26000005619f8c1675000007f9bfebf4b900000> Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: STACKTRACE Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: /home/tr/tvheadend/src/trap.c:176 0x5619f6bf43c6 0x5619f6a35000 Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: ??:0 0x7f9c05ded3c0 0x7f9c05dd9000 Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: /home/tr/tvheadend/src/input/mpegts/iptv/iptv.c:566 0x5619f6d215e2 0x5619f6a35000 Apr 24 20:24:02 TR tvheadend[1876477]: CRASH: /home/tr/tvheadend/src/tvh_thread.c:91 0x5619f6b9ca59 0x5619f6a35000 Apr 24 20:24:02 TR kernel: [1546921.469881] show_signal_msg: 20 callbacks suppressed Apr 24 20:24:02 TR kernel: [1546921.469884] tvh:iptv[1876497]: segfault at 170 ip 00005619f6d215e2 sp 00007f9bfebf4b30 error 4 in tvheadend[5619f6b7f000+1e6000] Apr 24 20:24:02 TR kernel: [1546921.469893] Code: 8d 3d a2 ac 25 00 e8 22 bb e7 ff 48 8b 45 c8 48 8b 80 98 01 00 00 48 85 c0 0f 84 dd 00 00 00 48 8b 45 c8 48 8b 80 98 01 00 00 <48> 8b 80 70 01 00 00 48 89 45 d0 48 8b 45 c8 48 8b 80 c8 04 00 00 Apr 24 20:24:02 TR tvheadend[1876477]: CRASH: ??:0 0x7f9c05de1609 0x7f9c05dd9000 Apr 24 20:24:02 TR tvheadend[1876477]: CRASH: clone+0x43 (/lib/x86_64-linux-gnu/libc.so.6)
History
Updated by Flole Systems over 2 years ago
Do you have a coredump of that crash? I need to know what "im->mm_active" was at the time of the crash in that Thread.
Updated by Pablo R. over 2 years ago
(gdb) bt full #0 iptv_input_thread (aux=0x5619f8c32f10) at src/input/mpegts/iptv/iptv.c:566 pool = 0x5619f8c32f10 nfds = 1 r = 0 n = 9588 im = 0x5619f8c47b10 mi = 0x5619f8c35050 ev = {fd = -1, events = 1, ptr = 0x5619f8c47b10} #1 0x00005619f6b9ca59 in thread_wrapper (p=0x5619f8c0f850) at src/tvh_thread.c:91 ts = 0x5619f8c0f850 set = {__val = {16388, 0 <repeats 15 times>}} r = 0x0 #2 0x00007f9c05de1609 in start_thread (arg=<optimized out>) at pthread_create.c:477 ret = <optimized out> pd = <optimized out> unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140307970610944, 3889303656921157008, 140726060230990, 140726060230991, 140726060231184, 140307970608448, -3833011405428503152, -3836610937833665136}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}} not_first_call = 0 #3 0x00007f9c05bb5163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
#0 iptv_input_thread (aux=0x5619f8c32f10) at src/input/mpegts/iptv/iptv.c:566 pool = 0x5619f8c32f10 nfds = 1 r = 0 n = 9588 im = 0x5619f8c47b10 mi = 0x5619f8c35050 ev = {fd = -1, events = 1, ptr = 0x5619f8c47b10}
(gdb) print im $2 = (iptv_mux_t *) 0x5619f8c47b10 (gdb) print im->mm_active There is no member named mm_active.
I think I'm doing something wrong, can you guide me?
Updated by Flole Systems over 2 years ago
It's been a while since I last used gdb, I'd try something like "print *im->mm_active", if that doesn't work "print *im".
Updated by Pablo R. over 2 years ago
Flole Systems wrote:
It's been a while since I last used gdb, I'd try something like "print *im->mm_active", if that doesn't work "print *im".
(gdb) bt #0 iptv_input_thread (aux=0x5619f8c32f10) at src/input/mpegts/iptv/iptv.c:566 #1 0x00005619f6b9ca59 in thread_wrapper (p=0x5619f8c0f850) at src/tvh_thread.c:91 #2 0x00007f9c05de1609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #3 0x00007f9c05bb5163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 (gdb) frame 0 #0 iptv_input_thread (aux=0x5619f8c32f10) at src/input/mpegts/iptv/iptv.c:566 566 mi = (iptv_input_t *)im->mm_active->mmi_input; (gdb) print *im->mm_active There is no member named mm_active. (gdb) print *im $1 = {{mm_id = {in_uuid = {bin = "\352\034*\241O2\365d\364\341\235̑\376\201\215"}, in_link = {left = 0x5619f8c66580, right = 0x7f9be419a050, parent = 0x5619f8c44250, color = 1}, in_domain_link = {left = 0x5619f8c66580, right = 0x5619f8c572e0, parent = 0x5619f8c510f0, color = 1}, in_domain = 0x5619f8c0f4e8, in_class = 0x5619f6efaac0 <iptv_mux_class>, in_access = 0x0, in_save = 0x0}, mm_refcount = 1, mm_network_link = {le_next = 0x0, le_prev = 0x5619f8c51168}, mm_network = 0x5619f8c10c00, mm_nicename = 0x7f9be414c130 "Channel SD in INPUT TR", mm_provider_network_name = 0x0, mm_onid = 65281, mm_tsid = 1, mm_tsid_checks = -100, mm_tsid_accept_zero_value = 0, mm_tsid_loglimit = {last = 0, count = 0}, mm_start_monoclock = 1546923776923, mm_created = 1642971212, mm_update_pids_flag = 1, mm_update_pids_timer = {mti_link = {le_next = 0x5619f8c347c0, le_prev = 0x5619f6f6c4c0 <mtimers>}, mti_magic1 = 224569822, mti_callback = 0x0, mti_opaque = 0x5619f8c47b10, mti_expire = 1546929937101}, mm_services = {lh_first = 0x5619f8c29100}, mm_scan_first = 1642971237, mm_scan_last_seen = 1642971581, mm_scan_result = MM_SCAN_OK, mm_scan_weight = 0, mm_scan_flags = 0, mm_scan_init = 0, mm_scan_timeout = {mti_link = {le_next = 0x0, le_prev = 0x0}, mti_magic1 = 0, mti_callback = 0x0, mti_opaque = 0x0, mti_expire = 0}, mm_scan_link = {tqe_next = 0x0, tqe_prev = 0x0}, mm_scan_state = MM_SCAN_STATE_IDLE, mm_dmc_origin = 0x0, mm_dmc_origin_expire = 0, mm_fastscan_muxes = 0x0, mm_instances = {lh_first = 0x7f9be4135dc0}, mm_active = 0x0, mm_transports = {lh_first = 0x0}, mm_raw_subs = {lh_first = 0x0}, mm_input_pos = 1029676, mm_pids = { first = 0x7f9be4168630, last = 0x7f9be419f320, root = 0x7f9be414c080, entries = 4}, mm_all_subs = {lh_first = 0x0}, mm_last_pid = -1, mm_last_mp = 0x0, mm_num_tables = 6, mm_tables = {lh_first = 0x7f9b64002330}, mm_defer_tables = { tqh_first = 0x0, tqh_last = 0x5619f8c47d10}, mm_tables_lock = {mutex = pthread_mutex_t = {Type = Normal, Status = Not acquired, Robust = No, Shared = No, Protocol = None}, magic1 = 3614061450, tid = 0, filename = 0x0, lineno = 0, tstamp = 0, waiters = {lh_first = 0x0}, link = {tqe_next = 0x0, tqe_prev = 0x0}, magic2 = 4181353505}, mm_table_queue = {tqh_first = 0x0, tqh_last = 0x5619f8c47d90}, mm_descrambler_caids = {lh_first = 0x0}, mm_descrambler_tables = {tqh_first = 0x0, tqh_last = 0x5619f8c47da8}, mm_descrambler_emms = {tqh_first = 0x0, tqh_last = 0x5619f8c47db8}, mm_descrambler_lock = {mutex = pthread_mutex_t = {Type = Normal, Status = Not acquired, Robust = No, Shared = No, Protocol = None}, magic1 = 3614061450, tid = 0, filename = 0x0, lineno = 0, tstamp = 0, waiters = {lh_first = 0x0}, link = {tqe_next = 0x0, tqe_prev = 0x0}, magic2 = 4181353505}, mm_descrambler_flush = 1, mm_delete = 0x5619f6d23604 <iptv_mux_delete>, mm_free = 0x5619f6d234ad <iptv_mux_free>, mm_config_save = 0x5619f6d233a8 <iptv_mux_config_save>, mm_display_name = 0x5619f6d236a4 <iptv_mux_display_name>, mm_is_enabled = 0x5619f6cbceb2 <mpegts_mux_is_enabled>, mm_stop = 0x5619f6cbd039 <mpegts_mux_stop>, mm_open_table = 0x5619f6cbf36a <mpegts_mux_open_table>, mm_unsubscribe_table = 0x5619f6cbf6fb <mpegts_mux_unsubscribe_table>, mm_close_table = 0x5619f6cbf8df <mpegts_mux_close_table>, mm_create_instances = 0x5619f6cbcf08 <mpegts_mux_create_instances>, mm_is_epg = 0x5619f6cbcef0 <mpegts_mux_is_epg>, mm_crid_authority = 0x0, mm_enabled = 1, mm_epg = 0, mm_epg_module_id = 0x0, mm_charset = 0x0, mm_pmt_ac3 = 0, mm_eit_tsid_nocheck = 0, mm_sid_filter = 0}, mm_iptv_priority = 0, mm_iptv_streaming_priority = 0, mm_iptv_fd = 11952, mm_iptv_connection = 0x0, mm_iptv_url = 0x5619f8c18130 "pipe:///usr/bin/ffmpeg -loglevel fatal -i http://192.168.10.55:9981/stream/channelid/927883541?profile=pass -map 0:v -map 0:a -c:v libx264 -x264-params keyint=25 -s pal -b:v 3M -ma"..., mm_iptv_url_sane = 0x5619f8c28f60 "pipe:///usr/bin/ffmpeg -loglevel fatal -i http://192.168.10.55:9981/stream/channelid/927883541?profile=pass -map 0:v -map 0:a -c:v libx264 -x264-params keyint=25 -s pal -b:v 3M -ma"..., mm_iptv_url_raw = 0x5619f8c7a0e0 "pipe:///usr/bin/ffmpeg -loglevel fatal -i http://192.168.10.55:9981/stream/channelid/927883541?profile=pass -map 0:v -map 0:a -c:v libx264 -x264-params keyint=25 -s pal -b:v 3M -ma"..., mm_iptv_url_cmpid = 0x0, mm_iptv_ret_url = 0x0, mm_iptv_ret_url_sane = 0x0, mm_iptv_ret_url_raw = 0x0, mm_iptv_ret_url_cmpid = 0x0, mm_iptv_interface = 0x0, mm_iptv_send_reports = 0, mm_iptv_substitute = 0, mm_iptv_libav = 0, mm_iptv_atsc = 0, mm_iptv_muxname = 0x5619f8c12150 "Channel SD", mm_iptv_svcname = 0x5619f8c0ff70 "Channel SD", mm_iptv_chnum = 0, mm_iptv_icon = 0x0, mm_iptv_epgid = 0x0, mm_iptv_respawn = 0, mm_iptv_respawn_last = 1546923776923, mm_iptv_kill = 0, mm_iptv_kill_timeout = 5, mm_iptv_env = 0x0, mm_iptv_hdr = 0x0, mm_iptv_tags = 0x0, mm_iptv_satip_dvbt_freq = 0, mm_iptv_satip_dvbc_freq = 0, mm_iptv_satip_dvbs_freq = 0, mm_iptv_rtp_seq = 0, mm_iptv_buffer = { sb_data = 0x7f9be41a0380 "GA\004\060\001@", sb_ptr = 9588, sb_size = 376000, sb_err = 0, sb_bswap = 0 '\000'}, im_temp_buffer = {sb_data = 0x0, sb_ptr = 0, sb_size = 0, sb_err = 0, sb_bswap = 0 '\000'}, mm_iptv_buffer_limit = 0, im_handler = 0x5619f6f5ff80 <ih>, im_pause_timer = {mti_link = {le_next = 0x5619f8c2a200, le_prev = 0x5619f6f6c4c0 <mtimers>}, mti_magic1 = 224569822, mti_callback = 0x0, mti_opaque = 0x5619f8c47b10, mti_expire = 815763436966}, im_pcr = 264960, im_pcr_start = 1546929963772, im_pcr_end = 1546930919777, im_pcr_pid = 256, im_data = 0x29e75a, im_delete_flag = 0, im_opaque = 0x0, im_um = {um_psize = 0, um_packets = 0, um_data = 0x0, um_iovec = 0x0, um_riovec = 0x0, um_msg = 0x0}, im_use_retransmission = 0 '\000', im_is_ce_detected = 0 '\000', im_rtcp_info = {last_ts = 0, next_ts = 0, average_packet_size = 0, members = 0, senders = 0, last_received_sequence = 0, ce_cnt = 0, sequence_cycle = 0, nak_req_limit = 0, connection = 0x0, connection_fd = 0, um = {um_psize = 0, um_packets = 0, um_data = 0x0, um_iovec = 0x0, um_riovec = 0x0, um_msg = 0x0}, source_ssrc = 0, my_ssrc = 0}}
mm_active = 0x0
Updated by Flole Systems over 2 years ago
That's very interesting and as I suspected... It should have never reached that line then due to the check in the line before. Looks a little like a missing lock somewhere so it was possible that mm_active got updated somewhere....
Updated by Flole Systems over 2 years ago
Could you please check if there are any log messages before that which could indicate what happened? Was there a subscription that just started, a subscription that ended or something like that?
Updated by Pablo R. over 2 years ago
Flole Systems wrote:
Could you please check if there are any log messages before that which could indicate what happened? Was there a subscription that just started, a subscription that ended or something like that?
Yes, unsuscribing from the channel who crashes
Apr 24 20:24:01 TR tvheadend[1876477]: subscription: 41C1: "HTTP" unsubscribing from "Channel SD", hostname="::ffff:127.0.0.1", username="out", client="VLC/2.1.3 LibVLC/2.1.3" Apr 24 20:24:01 TR tvheadend[1876477]: CRASH: Signal: 11 in PRG: /usr/bin/tvheadend (4.3-2018~g58df4bf51-dirty) [f912b8f2d14d7ea35430c1204c0ace385ca6de66] CWD: /
Previous movement was 6 seconds before.
Apr 24 20:23:55 TR tvheadend[1876477]: subscription: 41C1: "HTTP" subscribing on channel "Channel SD", weight: 100, adapter: "IPTV #6", network: "INPUT TR"... Apr 24 20:23:55 TR tvheadend[1876477]: spawn: Executing "/usr/bin/ffmpeg"