Bug #3361
TVHeadEnd crashes if tuned to station that is off-air or has too weak signal to be received
0%
Description
I've had this problem ever since I started using TVHeadEnd but never reported it before because I was running an older version (3.9 branch). A few days ago I did a complete reinstallation using Ubuntu Server 14.04 and HTS Tvheadend 4.0.7 (most current stable version) and find this problem still persists. The problem is that if you attemt to tune a live TV channel in Kodi (using their TVHeadEnd client) and for some reason the station cannot be received, either because the signal is too weak or because the station or satellite signal just isn't there, after about 5 to 10 seconds Kodi will crash hard.
If you see nothing is coming in and you manage to hit stop quickly enough, or change to a different working channel, it will not crash. If you are watching or listening to something and the signal suddenly becomes unreceivable for more than several seconds, it MAY crash. If it is trying to record a signal that is not there (the user isn't trying to watch it live) the the vast majority of the time it will not crash. When it crashes, TVHeadEnd goes completely down (it may or may not come back up again after a few seconds), all in-progress recordings are stopped and thrown away, and all manually-set or changed PVR timers are lost (in other words, if you had it set to record a show every week but had deleted the timer for this week only because you knew the show was a rerun, after TVHeadEnd restarts that timer will be back. Conversely, if you had set a timer from Kodi's EPG grid, it will be lost and you will have to set it again).
This is not only annoying but has also caused some family friction when someone (usually me) tried to watch something live and managed to crash the system and interrupt recordings that others had planned on watching.
I've seen this behavior on both the system mentioned above (which contains TBS Satellite cards for receiving DVB-S2 signals) but also on a different TVHeadEnd backend that receives terrestrial TV only using HDHomeRuns as tuners. For me it is 100% repeatable - go into Kodi's Live TV section, tune to a channel where no signal is present, wait about ten seconds, and TVHeadEnd WILL crash, guaranteed. And it WILL lose all manually set/changed timers. The only question is whether it will restart on its own or whether I will need to reboot the backend to restart it.
History
Updated by B C almost 9 years ago
if you want somebody to look into this than you must provide logs (atleast a crashlog of a debug build)
Updated by K Shea almost 9 years ago
I am not a very technically-astute person and I am only capable of installing versions found in the repositories. In fact I put off upgrading for a very long time because I was afraid I would screw something up. I have no idea how to provide "a crashlog of a debug build", and unless the stable version is "a debug build" then it is simply not possible for me to provide that. I am simply reporting a bug that has plagued me across two versions now; if you are saying you won't even try to replicate it by tuning to a live channel with no signal present to see if it crashes for you, then I guess I am wasting my time here. Please keep in mind that not everyone who uses TVHeadEnd is a Linux guru - I'm of advanced age and half the time I feel like I barely understand this stuff, and I feel like it's a miracle if I can even get a regular version of something like this installed and configured.
Updated by Mark Clarkstone almost 9 years ago
K Shea wrote:
I am not a very technically-astute person and I am only capable of installing versions found in the repositories. In fact I put off upgrading for a very long time because I was afraid I would screw something up. I have no idea how to provide "a crashlog of a debug build", and unless the stable version is "a debug build" then it is simply not possible for me to provide that. I am simply reporting a bug that has plagued me across two versions now; if you are saying you won't even try to replicate it by tuning to a live channel with no signal present to see if it crashes for you, then I guess I am wasting my time here. Please keep in mind that not everyone who uses TVHeadEnd is a Linux guru - I'm of advanced age and half the time I feel like I barely understand this stuff, and I feel like it's a miracle if I can even get a regular version of something like this installed and configured.
I'm pretty sure the stable builds do have debugging enabled by default, if you have a Debugging tab under Configuration then yes you should be able to provide logs, if you don't install the tvheadend-dbg package (it's in the stable repository). Once you've installed the debugging package install 'corekeeper' and 'gdb' then edit /etc/default/tvheadend and change the lines TVH_DEBUG=0 to TVH_DEBUG=1 and then TVH_ARGS="" to TVH_ARGS="-D". Reboot your system. Tvheadend should now be running with the -D argument, check ps -ef. If not edit /etc/init.d/tvheadend and change TVH_ARGS there.
Once its back up try to crash Tvheadend, if you're able to it should drop its core and corekeeper should catch it and place it in /var/crash/<uid>/ (cd to /var/crash and you should be able to find it.)
In order to get a crash log run gdb like this.
sudo gdb /usr/bin/tvheadend /var/crash/<uid>/tvheadend<random info>.core
Edit <text> to match the folder location in /var/crash.
Once in gdb run
set logging on /home/hts/tvh.log # (You can change this to whatever you want). thread apply all bt full
Keep pressing enter until doesn't blurt anything else out then type quit (or exit I forget which).
Paste the log here but remember to edit any lines that begin with authbuf or password/username BEFORE you upload it here.
PS: Being of advanced age isn't an excuse, I type one handed (medical condition) but I still write long replies to people even when I'm in pain.
Updated by Bengt Madeberg almost 9 years ago
This is probably the same issue I reported
http://tvheadend.org/issues/3286
maybe it's solved in later versions but I have not tested yet.
Updated by K Shea almost 9 years ago
Mark Clarkstone wrote:
I'm pretty sure the stable builds do have debugging enabled by default, if you have a Debugging tab under Configuration then yes you should be able to provide logs, if you don't install the tvheadend-dbg package (it's in the stable repository). Once you've installed the debugging package install 'corekeeper' and 'gdb' then edit /etc/default/tvheadend and change the lines TVH_DEBUG=0 to TVH_DEBUG=1 and then TVH_ARGS="" to TVH_ARGS="-D". Reboot your system. Tvheadend should now be running with the -D argument, check ps -ef. If not edit /etc/init.d/tvheadend and change TVH_ARGS there.
Well the first thing I will say is if I were going to try to deliberately crash it, I would only do that on a weekend, so that if things went terribly wrong I'd have time to try to recover. So, I checked and there is a "Debugging" tab but it has five Debugging Options, none of which are filled in, as follows:
Debug log path: (Text field)
Debug to syslog: (Check box)
Debug trace (low-level stuff): (Check box)
Debug subsystems: (Text field)
Trace subsystems: (Text field)
I have no idea what should go in any of those, but if you told me and I filled them in correctly, would I still need to do any of that other stuff? I don't know what "corekeeper" or "gdb" are, I'm guessing they are debugging software of some kind but I don't know whether they would consume additional system resources, or write unnecessary files to my hard drive, so I'd rather not install them if it's not absolutely necessary to diagnose this issue. I'm not saying I'm not willing to do it, just that I only want to do it if it's really necessary, and if filling out one or more of those fields correctly would eliminate the need to install additional software then I'd much rather do that. Also, this is a "headless" system with no desktop, so any GUI-based program won't work (I mention that in case the "g" in gdb stands for "Gnome" or something).
Once its back up try to crash Tvheadend,
I guarantee you that won't be hard, especially on a weekend because there are a couple of channels that do not transmit on weekends. All I will have to do is try to view one and wait about ten seconds (by the way, in the stream profile the value "Timeout (sec) (0=infinite):" is set to 0, so that's not the problem).
if you're able to it should drop its core and corekeeper should catch it and place it in /var/crash/<uid>/ (cd to /var/crash and you should be able to find it.)
In order to get a crash log run gdb like this.
[...]
Edit <text> to match the folder location in /var/crash.Once in gdb run
[...]Keep pressing enter until doesn't blurt anything else out then type quit (or exit I forget which).
Paste the log here but remember to edit any lines that begin with authbuf or password/username BEFORE you upload it here.
This has always been my #1 objection to uploading log files to a public forum. I am always afraid I will miss something and post information that should not be placed online. I always wonder why that type of information is even written to such files in the first place. At least you alerted me what to watch out for, so thanks for that!
PS: Being of advanced age isn't an excuse, I type one handed (medical condition) but I still write long replies to people even when I'm in pain.
Well I use two fingers (mostly one) but I'm not trying to compare physical abilities. My bigger issue is my memory is so bad that if I figure out how to do something today, two weeks from now I'll most likely have no clue how I did it unless I have notes to refer to. So any time I have to mess with a mostly working system, it scares me to death that I am REALLY going to mess it up. I particularly feel that way about TVHeadEnd because although it has been running with few problems for the past year or so, getting it set up and working initially was extremely difficult for me, since I'd had no prior experience with it. Anyway, if you can explain what needs to be filled in on that Debugging tab, I should hopefully be able to show you what you need to see in a few days.
Updated by K Shea almost 9 years ago
Bengt Madeberg wrote:
This is probably the same issue I reported
http://tvheadend.org/issues/3286
maybe it's solved in later versions but I have not tested yet.
It may be but normally on my system if the signal isn't there for, or fails during a scheduled recording, it just will not record (I'll get a partial or blank recording) but it won't crash TVHeadEnd. It's usually only when I am attempting to watch Live TV that it crashes, with rare exceptions. One thing we do have in common is the "Continuity counter error" lines, I often see a bunch of those just prior to a crash.
Updated by Mark Clarkstone almost 9 years ago
K Shea wrote:
Mark Clarkstone wrote:
I'm pretty sure the stable builds do have debugging enabled by default, if you have a Debugging tab under Configuration then yes you should be able to provide logs, if you don't install the tvheadend-dbg package (it's in the stable repository). Once you've installed the debugging package install 'corekeeper' and 'gdb' then edit /etc/default/tvheadend and change the lines TVH_DEBUG=0 to TVH_DEBUG=1 and then TVH_ARGS="" to TVH_ARGS="-D". Reboot your system. Tvheadend should now be running with the -D argument, check ps -ef. If not edit /etc/init.d/tvheadend and change TVH_ARGS there.
Well the first thing I will say is if I were going to try to deliberately crash it, I would only do that on a weekend, so that if things went terribly wrong I'd have time to try to recover. So, I checked and there is a "Debugging" tab but it has five Debugging Options, none of which are filled in, as follows:
If it crashes you can just restart it without worry most of the time but make a config backup anyway. Still install tvheadend-dbg though so if it does crash most of the crashlines are filled in.
Debug log path: (Text field)
Debug to syslog: (Check box)
Debug trace (low-level stuff): (Check box)
Debug subsystems: (Text field)
Trace subsystems: (Text field)I have no idea what should go in any of those, but if you told me and I filled them in correctly, would I still need to do any of that other stuff?
Nothing really needs to go into those options in this case I think.
I don't know what "corekeeper" or "gdb" are, I'm guessing they are debugging software of some kind but I don't know whether they would consume additional system resources, or write unnecessary files to my hard drive, so I'd rather not install them if it's not absolutely necessary to diagnose this issue.
Without a crash log/trace nothing can be done. GDB doesn't do anything unless you run it and corekeeper only keeps an eye out for core dumps.
I'm not saying I'm not willing to do it, just that I only want to do it if it's really necessary, and if filling out one or more of those fields correctly would eliminate the need to install additional software then I'd much rather do that.
Also, this is a "headless" system with no desktop, so any GUI-based program won't work (I mention that in case the "g" in gdb stands for "Gnome" or something).
gdb is cmd line only see https://www.gnu.org/software/gdb/
Once its back up try to crash Tvheadend,
I guarantee you that won't be hard, especially on a weekend because there are a couple of channels that do not transmit on weekends. All I will have to do is try to view one and wait about ten seconds (by the way, in the stream profile the value "Timeout (sec) (0=infinite):" is set to 0, so that's not the problem).
if you're able to it should drop its core and corekeeper should catch it and place it in /var/crash/<uid>/ (cd to /var/crash and you should be able to find it.)
In order to get a crash log run gdb like this.
[...]
Edit <text> to match the folder location in /var/crash.Once in gdb run
[...]Keep pressing enter until doesn't blurt anything else out then type quit (or exit I forget which).
Paste the log here but remember to edit any lines that begin with authbuf or password/username BEFORE you upload it here.
This has always been my #1 objection to uploading log files to a public forum. I am always afraid I will miss something and post information that should not be placed online. I always wonder why that type of information is even written to such files in the first place. At least you alerted me what to watch out for, so thanks for that!
The only time authbuf gets filled in is if you auth to the webui or another client, no other system passwords etc are exposed. If you've not set any passwords at all then you have nothing to worry about :).
I posted a log publicly and left my password in it by mistake but thankfully it was a local only password so no worries.
PS: Being of advanced age isn't an excuse, I type one handed (medical condition) but I still write long replies to people even when I'm in pain.
Well I use two fingers (mostly one) but I'm not trying to compare physical abilities.
Heh, another member of the two finger club
My bigger issue is my memory is so bad that if I figure out how to do something today, two weeks from now I'll most likely have no clue how I did it unless I have notes to refer to. So any time I have to mess with a mostly working system, it scares me to death that I am REALLY going to mess it up. I particularly feel that way about TVHeadEnd because although it has been running with few problems for the past year or so, getting it set up and working initially was extremely difficult for me, since I'd had no prior experience with it. Anyway, if you can explain what needs to be filled in on that Debugging tab, I should hopefully be able to show you what you need to see in a few days.
Filling in the debugging tab really won't show whats causing the crash here, a gdb trace is really needed, if Tvheadend even drops its core. If it doesn't just run Tvheadend like this Make a backup of your config first and make sure it isn't running.
sudo gdb /usr/bin/tvheadend
then once gdb has loaded enter (into gdb):
set logging on /home/hts/tvh.log run -c /home/hts/.hts/tvheadend
Once it's running in gdb make it crash, once it has enter (into gdb).
thread apply all bt full # keep pressing enter until nothing more comes out. quit
Then post the log here (without any authbuf lines and any lines that contain username or password).