Bug #4464
Segmentation fault at Tvheadend start-up IPTV scan
100%
Description
Tvheadend crashed a few seconds after its start, more specifically during the IPTV scan that is done when the service starts up.
I filtered out the original .m3u list, making several tests until I eliminated non-issued entries. Final tests indicated that the crash occurs only when the list contains a set of URLs - notice they were the only URLs for mp4 files in the original list. Although the list with all of those issued URLs makes Tvheadend to crash, the same does not occur when the list is narrowed down to one or two of them.
Because the crash dump mentions pthread_create.c and http.c, I wonder that, possibly, multithreaded http requests targeting .mp4 files can cause this fault.
Original M3U list
see attached file "original_list.m3u"
Filtered list with issued URLs
see attached file "filtered_list_with_issued_URLs.m3u"
Last lines of Tvheadend debug log
2017-06-30 22:31:38.209 [ DEBUG] mpegts: tvfoco.m3u - DanceTV in TV Foco Local - stopping mux 2017-06-30 22:31:38.209 [ DEBUG] mpegts: removing mux tvfoco.m3u - DanceTV in TV Foco Local from scan queue 2017-06-30 22:31:38.209 [ DEBUG] service: tvfoco.m3u - Anime TV - Espanhol in TV Foco Local: Status changed to [CA check] [Graceperiod expired] [Data timeout] 2017-06-30 22:31:38.209 [ INFO] mpegts: tvfoco.m3u - Anime TV - Espanhol in TV Foco Local - scan no data, failed 2017-06-30 22:31:38.209 [ INFO] subscription: 0008: "scan" unsubscribing 2017-06-30 22:31:38.209 [ DEBUG] mpegts: tvfoco.m3u - Anime TV - Espanhol in TV Foco Local - close PID tables subscription [0042/0x73d68578] 2017-06-30 22:31:38.209 [ DEBUG] mpegts: tvfoco.m3u - Anime TV - Espanhol in TV Foco Local - stopping mux 2017-06-30 22:31:38.209 [ DEBUG] mpegts: removing mux tvfoco.m3u - Anime TV - Espanhol in TV Foco Local from scan queue 2017-06-30 22:31:38.209 [ DEBUG] service: tvfoco.m3u - TV Pantanal in TV Foco Local: Status changed to [CA check] [Graceperiod expired] [Data timeout] 2017-06-30 22:31:38.209 [ INFO] mpegts: tvfoco.m3u - TV Pantanal in TV Foco Local - scan no data, failed 2017-06-30 22:31:38.209 [ INFO] subscription: 0007: "scan" unsubscribing 2017-06-30 22:31:38.209 [ DEBUG] mpegts: tvfoco.m3u - TV Pantanal in TV Foco Local - close PID tables subscription [0042/0x73d59aa8] 2017-06-30 22:31:38.209 [ DEBUG] mpegts: tvfoco.m3u - TV Pantanal in TV Foco Local - stopping mux 2017-06-30 22:31:38.210 [ DEBUG] mpegts: removing mux tvfoco.m3u - TV Pantanal in TV Foco Local from scan queue 2017-06-30 22:31:38.210 [ DEBUG] service: tvfoco.m3u - Rede Meio Norte in TV Foco Local: Status changed to [CA check] [Graceperiod expired] [Data timeout] 2017-06-30 22:31:38.210 [ INFO] mpegts: tvfoco.m3u - Rede Meio Norte in TV Foco Local - scan no data, failed 2017-06-30 22:31:38.210 [ INFO] subscription: 0006: "scan" unsubscribing 2017-06-30 22:31:38.210 [ DEBUG] mpegts: tvfoco.m3u - Rede Meio Norte in TV Foco Local - close PID tables subscription [0042/0x73d4b040] 2017-06-30 22:31:38.210 [ DEBUG] mpegts: tvfoco.m3u - Rede Meio Norte in TV Foco Local - stopping mux Segmentation fault
Core Dump results & Full Backtrace
pi@RaspberryPi2:~/tvheadend $ gdb ./build.linux/tvheadend core GNU gdb (Raspbian 7.7.1+dfsg-5+rpi1) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "arm-linux-gnueabihf". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./build.linux/tvheadend...done. [New LWP 16406] [New LWP 16410] [New LWP 16413] [New LWP 16397] [New LWP 16400] [New LWP 16412] [New LWP 16399] [New LWP 16426] [New LWP 16432] [New LWP 16401] [New LWP 16434] [New LWP 16428] [New LWP 16425] [New LWP 16404] [New LWP 16427] [New LWP 16435] [New LWP 16403] [New LWP 16398] [New LWP 16407] [New LWP 16405] [New LWP 16409] [New LWP 16408] [New LWP 16431] [New LWP 16414] [New LWP 16411] [New LWP 16433] [New LWP 16436] [New LWP 16430] [New LWP 16402] [New LWP 16429] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". Core was generated by `./build.linux/tvheadend -c ./build.linux/test-conf -d'. Program terminated with signal SIGSEGV, Segmentation fault. #0 http_client_thread (p=<optimized out>) at src/httpc.c:1426 1426 TAILQ_FOREACH(hc, &http_clients, hc_link) (gdb) set logging on Copying output to gdb.txt. (gdb) set pagination off (gdb) bt full #0 http_client_thread (p=<optimized out>) at src/httpc.c:1426 n = <optimized out> ev = {fd = 0, events = 1, data = {ptr = 0x706f5178, u64 = 1886343544, u32 = 1886343544, fd = 1886343544}} hc = 0x66206c61 c = 0 '\000' #1 0x54ba65cc in thread_wrapper (p=0x572c30e0) at src/wrappers.c:161 ts = 0x572c30e0 set = {__val = {16388, 0 <repeats 31 times>}} r = <optimized out> #2 0x76b85e90 in start_thread (arg=0x74eff170) at pthread_create.c:311 pd = 0x74eff170 unwind_buf = {cancel_jmp_buf = {{jmp_buf = {1961882072, 0, 2126147068, 338, 1431129272, 1989842112, 0, 1961880748, 1079413048, 1107377192, 0 <repeats 54 times>}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}} not_first_call = 0 pagesize_m1 = <optimized out> sp = <optimized out> freesize = <optimized out> __PRETTY_FUNCTION__ = "start_thread" #3 0x76a7c598 in ?? () at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:92 from /lib/arm-linux-gnueabihf/libc.so.6 No locals. Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb)
Files
History
Updated by Raphael Lacerda over 7 years ago
Just a reinforcement: Final tests indicated that the crash occurs only when the list contains a SPECIFIC subset of URLs. They are all inside the attached file "filtered_list_with_issued_URLs.m3u".
Updated by Andreas Fornberg over 7 years ago
TVheadend doesn't support videofiles just livetv but should just ignore it and not crash ofcourse.
Updated by Jaroslav Kysela over 7 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset commit:tvheadend|0f77e0661bcdefdf2e8f7abef1ba0e6e0b1233d2.
Updated by Raphael Lacerda over 7 years ago
I compiled a later version (4.3-285~g09a52c3) and it worked. Thank you!