Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#12735 closed Bug Report - Crash (fixed)

Regression: MythFrontend fails when config.xml is not set up

Reported by: Peter Bennett Owned by: stuartm
Priority: blocker Milestone: 0.28.1
Component: MythTV - General Version: 0.28.0
Severity: high Keywords:
Cc: Ticket locked: no

Description

This worked in 0.27 but fails in 0.28.

If you start mythfrontend and either the config.xml does not exist, or the database server is down, the program prompts for Language and Country, then ends with a failure (sometimes segfault, sometimes just ends). In the case of a new remote frontend installation, a user will not know what to do.

In version 0.27 in these cases it would proceed to the prompt for database details, and after entering those, the frontend could start.

The user can work around this by either of the following methods:

  1. Copy the config.xml from the master backend to .mythtv directory in the remote frontend user home directory.

or

  1. Run mythtv-setup on the remote frontend. This prompts for database settings and creates the config.xml. The user must exit out of mythtv-setup after configuring those, and not go into any other setup options.

After doing one of these workarounds they can start the frontend.

Change History (7)

comment:1 Changed 4 years ago by Stuart Auchterlonie

Milestone: unknown0.28.1
Priority: minorblocker
Severity: mediumhigh

comment:2 Changed 3 years ago by Stuart Auchterlonie

Owner: set to stuartm
Status: newassigned

Backtrace occurs when hitting save on the country/language selection screen

Program received signal SIGSEGV, Segmentation fault.
0x00007fffeb05de03 in QObject::event (this=0x7fffffffcd20, e=0x0) at kernel/qobject.cpp:1234
....
(gdb) bt full
#0  0x00007fffeb05de03 in QObject::event(QEvent*) (this=0x7fffffffcd20, e=0x0) at kernel/qobject.cpp:1234
#1  0x00007ffff364338c in MythDialog::exec() (this=0x7fffffffcd20) at mythdialogs.cpp:185
        __FUNCTION__ = "exec"
        eventLoop = {<QObject> = {_vptr.QObject = 0x7fffffffd690, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x7fffeb19e480 <qt_meta_stringdata_QObject>, data = 0x7fffeb19e360 <qt_meta_data_QObject>, static_metacall = 0x7fffeb064d10 <QObject::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, d_ptr = {d = 0x7ffff7df1db0 <_dl_runtime_resolve+80>}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x7fffeb1e5fe0 <qt_meta_stringdata_Qt>, data = 0x7fffeb1e3560 <qt_meta_data_Qt>, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x7fffeb26ede0 <QObject::staticMetaObject>, stringdata = 0x7fffeb1fca20 <qt_meta_stringdata_QEventLoop>, data = 0x7fffeb1fc9c0 <qt_meta_data_QEventLoop>, static_metacall = 0x7fffeb0d83e0 <QEventLoop::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}}
        res = kDialogCodeRejected
#2  0x00007ffff362f706 in ConfigurationDialog::exec(bool, bool) (this=0x7fffffffcd20, saveOnAccept=true, doLoad=true) at mythconfigdialogs.cpp:100
        dialog = 0x7fffffffcd20
        ret = kDialogCodeRejected
#3  0x00007ffff363b470 in MythContextPrivate::PromptForDatabaseParams(QString const&) (this=0xbffae0, error=...) at mythcontext.cpp:586
        settings = {<ConfigurationWizard> = {<ConfigurationDialog> = {<Storage> = {_vptr.Storage = 0x99d888 <vtable for DatabaseSettings+16>}, cfgChildren = std::vector of length 2, capacity 2 = {0x189abc0, 0x18a11e0}, childwidget = std::vector of length 0, capacity 0, dialog = 0x0, cfgGrp = 0x18652b0}, <No data fields>}, <No data fields>}
        accepted = false
        __FUNCTION__ = "PromptForDatabaseParams"
#4  0x00007ffff3638dea in MythContextPrivate::FindDatabase(bool, bool) (this=0xbffae0, prompt=false, noAutodetect=false) at mythcontext.cpp:422
        manualSelect = false
        failure = {static null = {<No data fields>}, d = 0xbfabf0}
        loaded = false
        dbParamsFromFile = {dbHostName = {static null = {<No data fields>}, d = 0xc039b0}, dbHostPing = true, dbPort = 3306, dbUserName = {static null = {<No data fields>}, d = 0xc03540}, dbPassword = {static null = {<No data fields>}, d = 0xc038f0}, dbName = {static null = {<No data fields>}, d = 0xc03a50}, dbType = {static null = {<No data fields>}, d = 0xc03980}, localEnabled = false, localHostName = {static null = {<No data fields>}, d = 0xc039f0}, wolEnabled = false, wolReconnect = 0, wolRetry = 5, wolCommand = {static null = {<No data fields>}, d = 0xbffcd0}, forceSave = false, verVersion = {static null = {<No data fields>}, d = 0x7fffeb0fd120 <QArrayData::shared_null>}, verBranch = {static null = {<No data fields>}, d = 0x7fffeb0fd120 <QArrayData::shared_null>}, verProtocol = {static null = {<No data fields>}, d = 0x7fffeb0fd120 <QArrayData::shared_null>}, verBinary = {static null = {<No data fields>}, d = 0x7fffeb0fd120 <QArrayData::shared_null>}, verSchema = {static null = {<No data fields>}, d = 0x7fffeb0fd120 <QArrayData::shared_null>}}
        autoSelect = true
        __FUNCTION__ = "FindDatabase"
#5  0x00007ffff363882f in MythContextPrivate::Init(bool, bool, bool, bool) (this=0xbffae0, gui=true, promptForBackend=false, noPrompt=false, ignoreDB=false) at mythcontext.cpp:300
#6  0x00007ffff36408eb in MythContext::Init(bool, bool, bool, bool) (this=0x9ecae0, gui=true, promptForBackend=false, disableAutoDiscovery=false, ignoreDB=false) at mythcontext.cpp:1182
        __FUNCTION__ = "Init"
        homedir = {static null = {<No data fields>}, d = 0xc02710}
        confdir = {static null = {<No data fields>}, d = 0x7fffeb0fd120 <QArrayData::shared_null>}
#7  0x0000000000462641 in main(int, char**) (argc=1, argv=0x7fffffffde78) at main.cpp:1778
        bPromptForBackend = false
        bBypassAutoDiscovery = false
        cmdline = {<MythCommandLineParser> = {_vptr.MythCommandLineParser = 0x994a08 <vtable for MythFrontendCommandLineParser+16>, m_appname = {static null = {<No data fields>}, d = 0x9fbf50}, m_optionedArgs = {d = 0x9fc5d0}, m_namedArgs = {d = 0x9fc540}, m_passthroughActive = false, m_overridesImported = false, m_verbose = false}, <No data fields>}
        callCleanup = {m_cleanFunction = 0x455768 <(anonymous namespace)::cleanup()>}
        signallist = {<QListSpecialMethods<int>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0xbf0f80}, d = 0xbf0f80}}
        retval = 0
        ResetSettings = false
        __FUNCTION__ = "main"
        fileprefix = {static null = {<No data fields>}, d = 0x7fffffffd564}
        dir = {d_ptr = {d = 0x7fff00000008}}
        bonjour = {d = 0x7fffffffd5b0}
        themename = {static null = {<No data fields>}, d = 0x9f7f00}
        themedir = {static null = {<No data fields>}, d = 0x8}
        mainWindow = 0x9fb750
        mon = 0x6c1310 <__static_initialization_and_destruction_0(int, int)+74>
        networkControl = 0x19
        themeUpdateChecker = 0x6c1329 <_GLOBAL__sub_I_moc_upnpscanner.cpp(void)+19>
        sysEventHandler = 0x19
        bcm = {<QObject> = {_vptr.QObject = 0x7fffffffdbb0, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x7fffeb19e480 <qt_meta_stringdata_QObject>, data = 0x7fffeb19e360 <qt_meta_data_QObject>, static_metacall = 0x7fffeb064d10 <QObject::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, d_ptr = {d = 0x7fffea1d7cac <__GI___libc_free+76>}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x7fffeb1e5fe0 <qt_meta_stringdata_Qt>, data = 0x7fffeb1e3560 <qt_meta_data_Qt>, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x7fffeb26ede0 <QObject::staticMetaObject>, stringdata = 0x6ff7a0 <qt_meta_stringdata_BackendConnectionManager>, data = 0x6ff820 <qt_meta_data_BackendConnectionManager>, static_metacall = 0x6bcce2 <BackendConnectionManager::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, m_reconnecting = 0x7fffffffd770, m_reconnect_timer = 0x8, m_reconnect_again = 112}
        housekeeping = 0x18
        ret = 0

comment:3 Changed 3 years ago by Peter Bennett

Reporter: changed from Peter Bennett <pgbennett@…> to Peter Bennett

I am thinking about taking a look at this, and improving the general frontend startup for when the database or backend are down. Currently if the database is down the user is prompted for country and language. This is not appropriate behavior. It should warn that the database is inaccessible and allow the user to wait for it to come up and allow the user to wait or exit. If the database is up and the backend is down it does just that, although it fills up the log with repeated error messages while retrying.

If you set up a database wake on lan string it behaves somewhat better if it can wake the database, although while it is waking the database the screen is blank.

Let me know if you would like me to take over this ticket, and make some startup improvement at the same time.

comment:4 Changed 3 years ago by Roger Siddons <rsiddons@…>

Resolution: fixed
Status: assignedclosed

In f9ecf013da6e045d84100b63027d4b059dad22d2/mythtv:

Fix crash when frontend can't find the database

e845eae introduced a duplicate class name that
corrupts Qt moc processing of signals, resulting in a segfault when the frontend
tries to invoke the Database Settings dialog.

All credit to StuartA for his dogged sleuthing.

Fixes #12735

comment:5 Changed 3 years ago by Stuart Auchterlonie

Peter,

One thought I had the other day, is to add support for Network Manager to the frontend, so it can leverage network manager to determine if the networking is online.

You can trigger the database selection screen on a frontend that start from SSD, as the frontend starts up before the network is ready, and therefore the database cannot be found.

Regards Stuart

comment:6 Changed 3 years ago by Roger Siddons <rsiddons@…>

In d9182ff1b3efdcad978eee6cc42e28e09ab3e0cd/mythtv:

Fix crash when frontend can't find the database

e845eae introduced a duplicate class name that
corrupts Qt moc processing of signals, resulting in a segfault when the frontend
tries to invoke the Database Settings dialog.

All credit to StuartA for his dogged sleuthing.

Fixes #12735

Signed-off-by: Stuart Auchterlonie <stuarta@…>

comment:7 in reply to:  5 Changed 3 years ago by gary.buhrmaster@…

Replying to stuarta:

One thought I had the other day, is to add support for Network Manager to the frontend, so it can leverage network manager to determine if the networking is online.

And then there is systemd-networkd (one init system to rule them all?)

Note: See TracTickets for help on using tickets.