[mythtv] [mythtv-commits] mythtv commit: r16790 - in trunk byjanne

Nigel Pearson nigel at ind.tansu.com.au
Wed Apr 23 01:54:34 UTC 2008


On 26/03/2008, at 5:03 PM, Anduin Withers wrote:

> There is also a Qt 4 bug in the MySQL driver that causes database open
> failures to crash (the way we currently use MSqlQuery).
>
> The following code should reproduce it:
>
> #include <QApplication>
> #include <QSqlDatabase>
> #include <QSqlQuery>
>
> int main(int argc, char *argv[]) {
>     QApplication qapp(argc, argv);
>     QSqlDatabase qsdb = QSqlDatabase::addDatabase("QMYSQL", "atest");
>     qsdb.setHostName("test");
>     qsdb.setDatabaseName("test");
>     qsdb.setUserName("test");
>     qsdb.setPassword("test");
>     qsdb.open();
>
>     QSqlQuery query(qsdb);
> }

Sadly, I wasn't able to get that sample to crash for me
(Mac OS with Qt 4.3.4, or Linux with Qt 4.4.0-beta1).
Same deal with mythfrontend on that Linux install.


>> mythfrontend -p segfaults
>>
>
> This seems to be the cause.

Mac OS X MythFrontend.app/.../MythFrontend -p does
often die in QMYSQLResult::cleanup(), but not always.
It smells like a threading or memory corruption issue.


Here is a rough hack that reduces the occurrence for me:

% svn diff mythdbcon.cpp
Index: mythdbcon.cpp
===================================================================
--- mythdbcon.cpp       (revision 17130)
+++ mythdbcon.cpp       (working copy)
@@ -132,7 +138,8 @@
      // mdz, 2003/08/11


-    if (m_db.hostName().isEmpty())  // Bootstrapping without a  
database?
+    if (m_db.hostName().isEmpty()    // Bootstrapping without a  
database?
+        || m_db.isOpenError())       // Database invalid?
      {                                // Pretend we kicked, to  
reduce errors
          m_lastDBKick = QDateTime::currentDateTime();
          return true;
%


Even better would be removing KickDatabase(),
but I'm not sure if Qt 4 still needs it.
>

--
Nigel Pearson, nigel at ind.tansu.com.au| I've been talking to-
Telstra Net. Eng., Sydney, Australia | the ship's computer.
Office: 9202 3900    Fax:  9261 3912 | ...  It hates me!
Mobile: 0408 664435  Home: 9792 6998 |   Marvin





More information about the mythtv-dev mailing list