MythTV 31 Frontend Crashes on Connection to Backend

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
markvannoy
Newcomer
Posts: 5
Joined: Fri Feb 05, 2021 8:58 pm
United States of America

MythTV 31 Frontend Crashes on Connection to Backend

Post by markvannoy » Fri Feb 05, 2021 9:35 pm

I have a strange problem. About a year ago I set up MythTV using version 30 on an external USB SSD running under OpenSUSE Leap 15.1. I installed Myth by grabbing the source from Github and compiling myself. All was going well with MythTV. Since this was running on my existing Windows Media Center HTPC, I did not have a lot of time to work on the build out since WMC needed to be able to do its thing. While getting the drivers for the Hauppauge WinTV-HVR-2250 working in OpenSUSE enough time went by that MythTV 31 was released and the Windows Media Center hard drive failed.

So, now the hardware is fully dedicated to MythTV. With version 30 I was able to successfully watch live TV. After verifying that was working I made the decision to move to 31 so that I could get the newer JSON channel listings from Schedules Direct. Unfortunately, when I executed the Github command from the MythTv Wiki, I unknowingly pulled down the 32 dev bits instead of fixes/31. After compiling and installing 32 dev the mythfrontend application threw a segmentation fault and core dump on launch before the GUI could come up. I assumed the issue was with 32 so I grabbed the fixes/31 branch, did a compile, install, and then dropped the existing database before creating a fresh one. It still crashes on startup.

At this point, I have tried compiling out any new features between 30 and 31. That was futile. Looking at the logs, I can see the frontend connect to the backend and then almost immediately disconnect. When I have two terminal windows side by side I can see the backend disconnect coincides with the segmentation fault time wise. No specific fault or error is given, even when I set the log level to debug. The media monitor initializes then crash. I am not sure if anything else should spew to the console as part of the start up logging. I have tried using the -r option to reset mythfrontend. I have also noticed that if I shutdown the backend and launch the frontend then I get the normal GUI that says it cannot talk to the backend and lets me change a few settings. So that suggests that all my video drivers are working fine with the move to OpenGL. Everything is running of a single computer. Normally, I expect that a segmentation fault is an invalid pointer dereference, but I cannot fathom what would be causing that. The failure as soon as it connects to the backend would seem to suggest there is a bad setting coming from the backend. I have tried running the backend as a daemon as well as running it in the same session as the frontend with the same result. Mythtv-setup runs just fine and I was able to get XMLtv installed from source with a channel scan working no problem.

I am kind of at wits end and am just about to roll everything back to version 30. I would like to use the JSON schedules, but that isn't worth much if I cannot get the frontend to actually run. I will say that since this was an existing WMC computer the hardware is pretty old now. Since I want to use it for the same purpose I figure it should be up to the task though. (I am trying to get back up to speed with Linux as I was old hat back in the Slackware, Yggdrasil, Caldera days running Afterstep and thinking SystemV style init.d was just fine.)

Thank you in advance for any help anyone can provide,

Mark

gedakc
Junior
Posts: 50
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: MythTV 31 Frontend Crashes on Connection to Backend

Post by gedakc » Fri Feb 05, 2021 9:51 pm

Were you aware that the XMLTV JSON schedules can be used with earlier versions of MythTV?

For example see Jim A's tutorial on how he installed MythTV v30 on RPi4 back in 2019. Some things have changed since then and there is a newer tutorial for v31.

markvannoy
Newcomer
Posts: 5
Joined: Fri Feb 05, 2021 8:58 pm
United States of America

Re: MythTV 31 Frontend Crashes on Connection to Backend

Post by markvannoy » Fri Feb 05, 2021 10:28 pm

Thank you, gedakc. I was not aware that XMLTV could work with versions prior to 31. The MythTV documentation on XMLTV was ambiguous enough, to me, that I got the impression I needed to be at version 31. While I would like to know why 31 is crashing, maybe 30 is the answer to my specific problem.

User avatar
kmdewaal
Developer
Posts: 288
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: MythTV 31 Frontend Crashes on Connection to Backend

Post by kmdewaal » Fri Feb 05, 2021 11:03 pm

The basic idea is that MythTV should never crash....
If you just want to watch TV then using v30 is the best option probably.
However, if you want to polish up your Linux skills then a bit of debugging is a good start!
To figure out where your frontend crashes you can start mythfrontend with gbd and then do a backtrace when it has crashed, like this:

Code: Select all

gdb mythfrontend
run
<wait for crash>
bt
thread apply all bt full
This will show at which point the program crashed and where it was called from.

Does mythtv-setup work correct? Can you do a channel scan?

OpenSuse is not used very often. Ubuntu is by far the most popular followed by Fedora. For these distributions pre-built packages are available which are more convenient than building from source.

blm-ubunet
Senior
Posts: 168
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: MythTV 31 Frontend Crashes on Connection to Backend

Post by blm-ubunet » Fri Feb 05, 2021 11:31 pm

Large parts of the world have always used XMLTV with MythTV using web sourced listings or extracted from OTA MHEG with RedButton etc.
At least 12yrs here..
What's new for SD is using XMLTV.

Markvannoy
Your problems could very well be old libraries/binaries.
You should have a manual clean out of the likely places /usr/local/lib /usr/local/bin etc..
And then clean out cruft from the source folders.
If you upgrade before distclean etc then not all cruft is removed.

and building from source must:
$ make clean
$ make distclean
after most (if not all) git pulls.

I would be suspicious of the BE launch script. w.r.t. syslog options etc..

markvannoy
Newcomer
Posts: 5
Joined: Fri Feb 05, 2021 8:58 pm
United States of America

Re: MythTV 31 Frontend Crashes on Connection to Backend

Post by markvannoy » Sat Feb 06, 2021 1:19 am

kmdewaal:

I am not sure the Gnu Debugger is brushing up on my Linux skills so much as brushing up on my C/C++ skills. I may need to break out my copy of K&R! Thanks for the suggestion. That should, most likely, tell me what is actually crashing. I'll give it a try as I am quite curious.

mythtv-setup works great. I can do a channel scan just fine, get their icons, and so on.

I do realize that OpenSUSE is less commonly used. They have packages for MythTV. I happened to follow the advice on the MythTV Wiki and built from source for both MythTV and XMLTV. So I would have done the same with other distributions because I was trying to follow the best practice. I also remember the days when Red Hat introduced the RPM and how we always had to install through either a .tar.gz or compile form source for everything before that time. So I am not too shy about compiling even if it is not my favorite thing to do.

blm-ubunet:

Thank you for the make distclean reference. I did perform a make clean, but was unfamiliar with the make distclean. The distclean probably popped up as a standard while I was on my leave of absense from the Linux world.

I also was a little suspicious that the problem was the systemd launch of the backend as a daemon. That is why I launched it side by side with the frontend interactively to remove that possibility.

markvannoy
Newcomer
Posts: 5
Joined: Fri Feb 05, 2021 8:58 pm
United States of America

Re: MythTV 31 Frontend Crashes on Connection to Backend

Post by markvannoy » Sun Feb 07, 2021 6:27 am

I think it may be time to throw in the towel.

make clean
make distclean
make -j 5
sudo make install
gdb mythfrontend
run

Instead of crashing the debugger hangs, the terminal is unresponsive, the system is still partially functional though X stops drawing a mouse. Hit the menu key and I get mouse and keyboard back. However, to regain normal function of the entire X system, I have to reboot.

Best guess based on release notes is that there is something interacting unexpectedly with the OpenGL rendering in 31. I cannot compile it out and even my ancient onboard Intel video i965 supports OpenGL so it does not look like I can stop the crash from occurring. Even updated Mesa drivers do not help. So I guess it is a rebuild from fixes/30 and declare my hardware too old. I will give something newer than 30 a go again when I update the hardware once ATSC 3.0 has tuner support.

Thank you everyone.

blm-ubunet
Senior
Posts: 168
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: MythTV 31 Frontend Crashes on Connection to Backend

Post by blm-ubunet » Sun Feb 07, 2021 7:52 pm

Your crashing does appear like in X server or openGL video drivers, this X stuff is not very robust.
You might be able to configure opengl out but I think it is fundamental to any practical usage.

You can pass cmd line options to mythfrontend when launching with gdb; I would try pass it:-
$ gdb --args /usr/local/bin/mythfrontend -v all --loglevel=debug

It helps to compile (./configure) a debug build type to get symbols

Building from source:
After make distclean you really need to (must) run ./configure
$ ./configure --previous
$ ./configure --help
are handy.
Also need to build in the mythplugins folder AFTER installing (sudo make install) from mythtv folder.

systemd (native launch script) for BE works fine. I had to remove syslog stuff to make it reliable.
Need to ./configure mythtv to have systemd support.

markvannoy
Newcomer
Posts: 5
Joined: Fri Feb 05, 2021 8:58 pm
United States of America

Re: MythTV 31 Frontend Crashes on Connection to Backend

Post by markvannoy » Sun Mar 07, 2021 11:36 pm

I just wanted to provide an update in order to close this thread. Moving back to MythTV 30 did fix my segmentation fault crashes. I was able to fairly easily add support for XMLTV using JSON rather than SQLlite. It took me a little more work to get proper UDEV entries for my hauppauge tuner card so that the Systemd setup would successfully wait for the tuner card to get the firmware loaded before starting the backend. With all of that working reboots are a non issue because the backend is fully up and working without any user interaction and the Schedules Direct EPG is getting updated daily. Multiple recordings have been made and watched to verify everything is working as expected. Given that even after loading the Mesa drivers for OpenGL support, version 31 and 32 dev crashed with a segmentation fault core dump when the mythfrontend was started, it looks like the solution for my hardware is confirmed to be to stick with version 30.

Thank you everyone for your help, feedback, and support,

Mark

Post Reply