Opened 15 years ago

Closed 15 years ago

#686 closed patch (fixed)

mythfilldatabase segfaults when backend is not running and wakeup not set

Reported by: mythdev@… Owned by: cpinkham
Priority: minor Milestone: 0.19
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no


Common 'installation' sequence is to run mythtv-install, then mythfilldatabase, then start backend/frontend - so this segfault will be seen by 'new' users and may cause some concern. Following fixes the segfault + a minor cosmetic fix to connection reporting - currently the loop reports ".... (try 6 of 5)" because the maxcount doesn't include the first pass through the loop before the retries.

Index: mythtv/libs/libmyth/mythcontext.cpp
--- mythtv/libs/libmyth/mythcontext.cpp (revision 7959)
+++ mythtv/libs/libmyth/mythcontext.cpp (working copy)
@@ -908,7 +908,7 @@
         VERBOSE(VB_GENERAL, QString("Connecting to backend server: "
                                     "%1:%2 (try %3 of %4)")
-                                    .arg(maxConnTry));
+                                    .arg(maxConnTry+1));

         serverSock = new QSocketDevice(QSocketDevice::Stream);

@@ -961,7 +961,7 @@
     while (cnt <= maxConnTry);

-    if (!CheckProtoVersion(serverSock))
+    if (serverSock && !CheckProtoVersion(serverSock))
         delete serverSock;
         serverSock = NULL;

Change History (2)

comment:1 Changed 15 years ago by cpinkham

Owner: changed from Isaac Richards to cpinkham

comment:2 Changed 15 years ago by cpinkham

Resolution: fixed
Status: newclosed

(In [7973]) Apply patch from #686 to fix segfault in mythfilldatabase when mythbackend is not up and running. Also fix off-by-one display count by starting cnt at 1 instead of zero so we reallly only try maxConnTry attempts and not maxConnTry+1. Closes #686.

Add -v/--verbose argument parsing to mythfilldatabase. The default level is only "important general", so previously you couldn't for example see VB_NETWORK error messages. Now you can use any applicable verbose flags.

Check gContext->IsConnectedToMaster?() before calling ScheduledRecording::signalChange(-1) in mythfilldatabase to suppress a warning/error message when the backend is not up and we can't reschedule.

Add a %VERBOSELEVEL% keyword replacement option to mythjobqueue for User Jobs so you can pass in the value of print_verbose_messages to other Myth apps that understand the -V command-line option such as mythcommflag and mythtranscode.

Note: See TracTickets for help on using tickets.