Mailing List Archive

segfault in libmysqlclient.so.21
MythTV Version : v31.0-13-g2cd6ccb419
ubuntu 19.10

I have being experiencing segfaults in mythtv processes since
libmysqlclient21 was updated from 8.0.17 to 8.0.20 -about a week ago

Reverting to 8.0.17 does fix it.

I use10.3.22-MariaDBinstead of Mysql 8.

A bit of Googling shows nobody else has the same issue.

Is it likely to be a corner case due to using MariaDB any thoughts?

mythmetadataloo[2738]: segfault at 8 ip 00007fe22b99623f sp
00007ffd4cd34570 error 4 in libmysqlclient.so.21.1.20[7fe22b934000+e7000]
mythshutdown[2239]: segfault at 8 ip 00007f9d155f423f sp
00007fff10f96010 error 4 in libmysqlclient.so.21.1.20[7f9d15592000+e7000]
mythbackend[1691]: segfault at 8 ip 00007fc57cd3023f sp 00007ffd3e24e6c0
error 4 in libmysqlclient.so.21.1.20[7fc57ccce000+e7000]

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 5/10/20 11:23 AM, jksjdevelop wrote:
> MythTV Version : v31.0-13-g2cd6ccb419
> ubuntu 19.10
>
> I have being experiencing segfaults in mythtv processes since
> libmysqlclient21 was updated from 8.0.17 to 8.0.20 -about a week ago
>
> Reverting to 8.0.17 does fix it.
>
> I use10.3.22-MariaDBinstead of Mysql 8.
>
> A bit of Googling shows nobody else has the same issue.
>
> Is it likely to be a corner case due to using MariaDB any thoughts?
>
> mythmetadataloo[2738]: segfault at 8 ip 00007fe22b99623f sp
> 00007ffd4cd34570 error 4 in libmysqlclient.so.21.1.20[7fe22b934000+e7000]
> mythshutdown[2239]: segfault at 8 ip 00007f9d155f423f sp
> 00007fff10f96010 error 4 in libmysqlclient.so.21.1.20[7f9d15592000+e7000]
> mythbackend[1691]: segfault at 8 ip 00007fc57cd3023f sp
> 00007ffd3e24e6c0 error 4 in libmysqlclient.so.21.1.20[7fc57ccce000+e7000]


I built a test system with Ubuntu 20.04 and the default version of
mariadb-server and mythtv v31 was unstable. Since it was a development
test system, I decided to punt until later. This will have to get fixed
before I update my v31 production system from 18.04 to 20.04. But I have
3 years before that is required.

Jim A


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 10/05/2020 16:23, jksjdevelop wrote:

> MythTV Version : v31.0-13-g2cd6ccb419
> ubuntu 19.10
>
> I have being experiencing segfaults in mythtv processes since
> libmysqlclient21 was updated from 8.0.17 to 8.0.20 -about a week ago
>
> Reverting to 8.0.17 does fix it.
>
> I use10.3.22-MariaDBinstead of Mysql 8.
>
> A bit of Googling shows nobody else has the same issue.
>
> Is it likely to be a corner case due to using MariaDB any thoughts?
>
> mythmetadataloo[2738]: segfault at 8 ip 00007fe22b99623f sp
> 00007ffd4cd34570 error 4 in libmysqlclient.so.21.1.20[7fe22b934000+e7000]
> mythshutdown[2239]: segfault at 8 ip 00007f9d155f423f sp
> 00007fff10f96010 error 4 in libmysqlclient.so.21.1.20[7f9d15592000+e7000]
> mythbackend[1691]: segfault at 8 ip 00007fc57cd3023f sp
> 00007ffd3e24e6c0 error 4 in libmysqlclient.so.21.1.20[7fc57ccce000+e7000]
>
>

After an update over the weekend I'm seeing this as well.


Paul H.


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 11/05/2020 13:18, Paul Harrison wrote:
> On 10/05/2020 16:23, jksjdevelop wrote:
>
>> MythTV Version : v31.0-13-g2cd6ccb419
>> ubuntu 19.10
>>
>> I have being experiencing segfaults in mythtv processes since
>> libmysqlclient21 was updated from 8.0.17 to 8.0.20 -about a week ago
>>
>> Reverting to 8.0.17 does fix it.
>>
>> I use10.3.22-MariaDBinstead of Mysql 8.
>>
>> A bit of Googling shows nobody else has the same issue.
>>
>> Is it likely to be a corner case due to using MariaDB any thoughts?
>>
>> mythmetadataloo[2738]: segfault at 8 ip 00007fe22b99623f sp
>> 00007ffd4cd34570 error 4 in
>> libmysqlclient.so.21.1.20[7fe22b934000+e7000]
>> mythshutdown[2239]: segfault at 8 ip 00007f9d155f423f sp
>> 00007fff10f96010 error 4 in
>> libmysqlclient.so.21.1.20[7f9d15592000+e7000]
>> mythbackend[1691]: segfault at 8 ip 00007fc57cd3023f sp
>> 00007ffd3e24e6c0 error 4 in
>> libmysqlclient.so.21.1.20[7fc57ccce000+e7000]
>>
>>
>
> After an update over the weekend I'm seeing this as well.
>
>
> Paul H.
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

I can confirm that the issue is not present when using mysql 8 instead
of Mariadb.

I spent several hours struggling to switch from MariaDB to mysql on my
test system. Got there in the end.

Not looking forward to doing the same with the production system.
Suspect I will have to when upgrading to Ubuntu 20.04.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 12/05/2020 08:43, John wrote:

> On 11/05/2020 13:18, Paul Harrison wrote:
>> On 10/05/2020 16:23, jksjdevelop wrote:
>>
>>> MythTV Version : v31.0-13-g2cd6ccb419
>>> ubuntu 19.10
>>>
>>> I have being experiencing segfaults in mythtv processes since
>>> libmysqlclient21 was updated from 8.0.17 to 8.0.20 -about a week ago
>>>
>>> Reverting to 8.0.17 does fix it.
>>>
>>> I use10.3.22-MariaDBinstead of Mysql 8.
>>>
>>> A bit of Googling shows nobody else has the same issue.
>>>
>>> Is it likely to be a corner case due to using MariaDB any thoughts?
>>>
>>> mythmetadataloo[2738]: segfault at 8 ip 00007fe22b99623f sp
>>> 00007ffd4cd34570 error 4 in
>>> libmysqlclient.so.21.1.20[7fe22b934000+e7000]
>>> mythshutdown[2239]: segfault at 8 ip 00007f9d155f423f sp
>>> 00007fff10f96010 error 4 in
>>> libmysqlclient.so.21.1.20[7f9d15592000+e7000]
>>> mythbackend[1691]: segfault at 8 ip 00007fc57cd3023f sp
>>> 00007ffd3e24e6c0 error 4 in
>>> libmysqlclient.so.21.1.20[7fc57ccce000+e7000]
>>>
>>>
>>
>> After an update over the weekend I'm seeing this as well.
>>
>>
>> Paul H.
>>
>>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users@mythtv.org
>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums: https://forum.mythtv.org
>
> I can confirm that the issue is not present when using mysql 8 instead
> of Mariadb.
>
> I spent several hours struggling to switch from MariaDB to mysql on my
> test system. Got there in the end.
>
> Not looking forward to doing the same with the production system.
> Suspect I will have to when upgrading to Ubuntu 20.04.
>

John just to be clear can you confirm you are seeing the same issue?

This particular bug affects all MythTV apps that use the database but
only causes a segfault when exiting the apps. The problem appears to be
caused by an update to libmysqlclient. Did you recently have an update
to that?

What distro and version are you using? I'm using Kubuntu 19.10.

There is another bug in MariaDB 10.4
(https://forum.mythtv.org/viewtopic.php?f=2&t=3720) I just want to be
sure we are not confusing the two issues.


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 5/12/20 6:43 AM, Paul Harrison wrote:
> John just to be clear can you confirm you are seeing the same issue?
>
> This particular bug affects all MythTV apps that use the database but
> only causes a segfault when exiting the apps. The problem appears to
> be caused by an update to libmysqlclient. Did you recently have an
> update to that?
>
> What distro and version are you using? I'm using Kubuntu 19.10.
>
> There is another bug in MariaDB 10.4
> (https://forum.mythtv.org/viewtopic.php?f=2&t=3720) I just want to be
> sure we are not confusing the two issues.
>
>
> Paul H.

I am also seeing this now after installing Ubuntu 20.04 and building master.

Also using mariadb - perhaps we should be using a mariadb client library
instead of the mysql one (e.g. "libmariadb3 - MariaDB database client
library" instead of "libmysqlclient21 - MySQL database client library")

FWIW Here is the backtrace

Core was generated by `mythbackend'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f19a640930f in ?? () from
/lib/x86_64-linux-gnu/libmysqlclient.so.21
[Current thread is 1 (Thread 0x7f19a9233340 (LWP 2987))]
(gdb) bt
#0  0x00007f19a640930f in  () at /lib/x86_64-linux-gnu/libmysqlclient.so.21
#1  0x00007f19a640e823 in  () at /lib/x86_64-linux-gnu/libmysqlclient.so.21
#2  0x00007f19a63ac243 in mysql_server_end () at
/lib/x86_64-linux-gnu/libmysqlclient.so.21
#3  0x00007f19b6ab10ee in  () at
/usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so
#4  0x00007f19b6ab110d in  () at
/usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so
#5  0x00007f19b61b05fb in  () at /lib/x86_64-linux-gnu/libQt5Sql.so.5
#6  0x00007f19b61b088e in QSqlDatabase::~QSqlDatabase() () at
/lib/x86_64-linux-gnu/libQt5Sql.so.5
#7  0x00007f19b61b2901 in  () at /lib/x86_64-linux-gnu/libQt5Sql.so.5
#8  0x00007f19b5ab345c in QHashData::free_helper(void
(*)(QHashData::Node*)) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007f19b61b0b4c in  () at /lib/x86_64-linux-gnu/libQt5Sql.so.5
#10 0x00007f19b61b0cb7 in  () at /lib/x86_64-linux-gnu/libQt5Sql.so.5
#11 0x00007f19b5c28852 in qt_call_post_routines() () at
/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007f19b5c289a2 in QCoreApplication::~QCoreApplication() () at
/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x000055a1780912ee in main(int, char**) (argc=1,
argv=0x7fff14ac53d8) at main.cpp:88




_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 13/05/2020 00:42, Peter Bennett wrote:
>
> On 5/12/20 6:43 AM, Paul Harrison wrote:
>> John just to be clear can you confirm you are seeing the same issue?
>>
>> This particular bug affects all MythTV apps that use the database but
>> only causes a segfault when exiting the apps. The problem appears to
>> be caused by an update to libmysqlclient. Did you recently have an
>> update to that?
>>
>> What distro and version are you using? I'm using Kubuntu 19.10.
>>
>> There is another bug in MariaDB 10.4
>> (https://forum.mythtv.org/viewtopic.php?f=2&t=3720) I just want to be
>> sure we are not confusing the two issues.
>>
>>
>> Paul H.
>
> I am also seeing this now after installing Ubuntu 20.04 and building
> master.
>
> Also using mariadb - perhaps we should be using a mariadb client
> library instead of the mysql one (e.g. "libmariadb3 - MariaDB database
> client library" instead of "libmysqlclient21 - MySQL database client
> library")
>
> FWIW Here is the backtrace
>
> Core was generated by `mythbackend'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x00007f19a640930f in ?? () from
> /lib/x86_64-linux-gnu/libmysqlclient.so.21
> [Current thread is 1 (Thread 0x7f19a9233340 (LWP 2987))]
> (gdb) bt
> #0  0x00007f19a640930f in  () at
> /lib/x86_64-linux-gnu/libmysqlclient.so.21
> #1  0x00007f19a640e823 in  () at
> /lib/x86_64-linux-gnu/libmysqlclient.so.21
> #2  0x00007f19a63ac243 in mysql_server_end () at
> /lib/x86_64-linux-gnu/libmysqlclient.so.21
> #3  0x00007f19b6ab10ee in  () at
> /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so
> #4  0x00007f19b6ab110d in  () at
> /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so
> #5  0x00007f19b61b05fb in  () at /lib/x86_64-linux-gnu/libQt5Sql.so.5
> #6  0x00007f19b61b088e in QSqlDatabase::~QSqlDatabase() () at
> /lib/x86_64-linux-gnu/libQt5Sql.so.5
> #7  0x00007f19b61b2901 in  () at /lib/x86_64-linux-gnu/libQt5Sql.so.5
> #8  0x00007f19b5ab345c in QHashData::free_helper(void
> (*)(QHashData::Node*)) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
> #9  0x00007f19b61b0b4c in  () at /lib/x86_64-linux-gnu/libQt5Sql.so.5
> #10 0x00007f19b61b0cb7 in  () at /lib/x86_64-linux-gnu/libQt5Sql.so.5
> #11 0x00007f19b5c28852 in qt_call_post_routines() () at
> /lib/x86_64-linux-gnu/libQt5Core.so.5
> #12 0x00007f19b5c289a2 in QCoreApplication::~QCoreApplication() () at
> /lib/x86_64-linux-gnu/libQt5Core.so.5
> #13 0x000055a1780912ee in main(int, char**) (argc=1,
> argv=0x7fff14ac53d8) at main.cpp:88
>
>

For reference someone has reported the bug to Ubuntu.

https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1877504


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 5/13/20 7:48 AM, Paul Harrison wrote:
> For reference someone has reported the bug to Ubuntu.
>
> https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1877504
>
>
> Paul H.

Hi Paul

The bug was showing as affecting only one person (the reporter Kim Tyler)

Please login to ubuntu and click where it says "this bug affects x
people. Does it affect you?" .

Peter

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 13/05/2020 17:34, Peter Bennett wrote:

>
> On 5/13/20 7:48 AM, Paul Harrison wrote:
>> For reference someone has reported the bug to Ubuntu.
>>
>> https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1877504
>>
>>
>> Paul H.
>
> Hi Paul
>
> The bug was showing as affecting only one person (the reporter Kim Tyler)
>
> Please login to ubuntu and click where it says "this bug affects x
> people. Does it affect you?" .
>
> Peter
>
>

Hi Peter,


Done that and the Status changed to 'Confirmed' because the bug affects
multiple users.

I also added a simple Qt test app that can be used to easily reproduce
the bug taking  MythTV out of the equation.

I wonder if they will say it's nothing to do with MySQL since it appears
to only affect users using MariaDB for the server side of things.

I tried to remove libmysqlclient21 so I could try libmariadb3 but that
wanted to remove a lot more than just libmysqlclient21 so looks like
that's not going to work.


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 5/13/20 1:16 PM, Paul Harrison wrote:
> On 13/05/2020 17:34, Peter Bennett wrote:
>
>>
>> On 5/13/20 7:48 AM, Paul Harrison wrote:
>>> For reference someone has reported the bug to Ubuntu.
>>>
>>> https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1877504
>>>
>>>
>>> Paul H.
>>
>> Hi Paul
>>
>> The bug was showing as affecting only one person (the reporter Kim
>> Tyler)
>>
>> Please login to ubuntu and click where it says "this bug affects x
>> people. Does it affect you?" .
>>
>> Peter
>>
>>
>
> Hi Peter,
>
>
> Done that and the Status changed to 'Confirmed' because the bug
> affects multiple users.
>
> I also added a simple Qt test app that can be used to easily reproduce
> the bug taking  MythTV out of the equation.
>
> I wonder if they will say it's nothing to do with MySQL since it
> appears to only affect users using MariaDB for the server side of things.
>
> I tried to remove libmysqlclient21 so I could try libmariadb3 but that
> wanted to remove a lot more than just libmysqlclient21 so looks like
> that's not going to work.
>
>
> Paul H.
>
> _______________________________________________
>
Looking at the code, it seems we do not ever delete the mythdb instance.
There is a method MythDB::destroyMythDB() that is never called. I found
that by adding a call to this to the end of each program, at the end of
main() before the return, the segfault goes away.

Is this an oversight? Perhaps we do not clean up the database connection
correctly?

There may be a better place to put the call to MythDB::destroyMythDB().
Otherwise I can add it to each program's main() function to prevent this
seg fault.

Any opinions on this? Should I make this change?

Peter



_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On 5/13/20 2:42 PM, Peter Bennett wrote:
>
> On 5/13/20 1:16 PM, Paul Harrison wrote:
>> On 13/05/2020 17:34, Peter Bennett wrote:
>>
>>>
>>> On 5/13/20 7:48 AM, Paul Harrison wrote:
>>>> For reference someone has reported the bug to Ubuntu.
>>>>
>>>> https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1877504
>>>>
>>>>
>>>> Paul H.
>>>
>>> Hi Paul
>>>
>>> The bug was showing as affecting only one person (the reporter Kim
>>> Tyler)
>>>
>>> Please login to ubuntu and click where it says "this bug affects x
>>> people. Does it affect you?" .
>>>
>>> Peter
>>>
>>>
>>
>> Hi Peter,
>>
>>
>> Done that and the Status changed to 'Confirmed' because the bug
>> affects multiple users.
>>
>> I also added a simple Qt test app that can be used to easily
>> reproduce the bug taking  MythTV out of the equation.
>>
>> I wonder if they will say it's nothing to do with MySQL since it
>> appears to only affect users using MariaDB for the server side of
>> things.
>>
>> I tried to remove libmysqlclient21 so I could try libmariadb3 but
>> that wanted to remove a lot more than just libmysqlclient21 so looks
>> like that's not going to work.
>>
>>
>> Paul H.
>>
>> _______________________________________________
>>
> Looking at the code, it seems we do not ever delete the mythdb
> instance. There is a method MythDB::destroyMythDB() that is never
> called. I found that by adding a call to this to the end of each
> program, at the end of main() before the return, the segfault goes away.
>
> Is this an oversight? Perhaps we do not clean up the database
> connection correctly?
>
> There may be a better place to put the call to
> MythDB::destroyMythDB(). Otherwise I can add it to each program's
> main() function to prevent this seg fault.
>
> Any opinions on this? Should I make this change?
>
> Peter
>
This does not work for mythfilldatabase. It looks like some more
investigation is needed.

Peter

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv] segfault in libmysqlclient.so.21 [ In reply to ]
> On 14 May 2020, at 4:42 am, Peter Bennett <pb.mythtv@gmail.com> wrote:

...
> There may be a better place to put the call to MythDB::destroyMythDB().



Haven’t looked al latest source code (in a LONG time :-), but

MythCoreContextPrivate::~MythCoreContextPrivate()

used to have:

GetMythDB()->GetDBManager()->CloseDatabases();

if (m_database) {
DestroyMythDB();
m_database = NULL;
}



I suspect there is now a race condition where the context is not being destructed in time?


--
Nigel Pearson, 02 9792 6998, 0408 66 44 35
nigel.pearson.au@gmail.com
Re: [mythtv] segfault in libmysqlclient.so.21 [ In reply to ]
I've been following the issue on both this list and at
https://bugs.launchpad.net/bugs/1877504

There doesn't appear to be a fix yet?

So my high-level questions are:

1. Since I have mythtv v31 on Ubuntu 18.04 with mariadb, should I avoid
moving to Ubuntu 20.04 when the 20.04.1 is released with an upgrade
path? seems like the answer is "yes"

2. Since this issue is mariadb specific and I really have no need to be
on mariadb specifically, could I convert to v31 and Ubuntu 20.04 doing
the following:

- backup mythconverg db (mythconverg_backup.pl) on current system and
all recordings.

- fresh install of Ubuntu 20.04 and mythtv v31 with standard mysql that
the mythtv install pulls in.

- restore all files and mythconverg db

*Alternatively I thought about this sequence:*

- backup mythconverg db as above.

- uninstall mythtv and mariadb-server

- upgrade Ubuntu to 20.04.1 and install mythtv v31 with default mysql

- restore mythconverg db

Any thoughts other than, "if it ain't broke don't fix it" :-)

Jim A
Re: [mythtv] segfault in libmysqlclient.so.21 [ In reply to ]
On Tue, 16 Jun 2020 06:41:38 -0400, you wrote:

>I've been following the issue on both this list and at
>https://bugs.launchpad.net/bugs/1877504
>
>There doesn't appear to be a fix yet?
>
>So my high-level questions are:
>
>1. Since I have mythtv v31 on Ubuntu 18.04 with mariadb, should I avoid
>moving to Ubuntu 20.04 when the 20.04.1 is released with an upgrade
>path? seems like the answer is "yes"
>
>2. Since this issue is mariadb specific and I really have no need to be
>on mariadb specifically, could I convert to v31 and Ubuntu 20.04 doing
>the following:
>
>- backup mythconverg db (mythconverg_backup.pl) on current system and
>all recordings.
>
>- fresh install of Ubuntu 20.04 and mythtv v31 with standard mysql that
>the mythtv install pulls in.
>
>- restore all files and mythconverg db
>
>*Alternatively I thought about this sequence:*
>
>- backup mythconverg db as above.
>
>- uninstall mythtv and mariadb-server
>
>- upgrade Ubuntu to 20.04.1 and install mythtv v31 with default mysql
>
>- restore mythconverg db
>
>Any thoughts other than, "if it ain't broke don't fix it" :-)
>
>Jim A

The procedure for changing from MariaDB to MySQL is (as best I
remember it from the last time I did it):

1) Backup your database.

2) Work out what all your users and their GRANTs are. Run these
commands:

sudo mysql
select distinct concat('SHOW GRANTS FOR ', QUOTE(user), '@',
QUOTE(host), ';') as query from mysql.user;

That gives you a list of commands to run. Run each of those commands
in turn. That give you all the grants for all the users. Keep a copy
of the results.

3) Install the MySQL client and server packages. This should
uninstall the corresponding MariaDB packages, and may also require
uninstalling MythTV and any other packages dependent on MariaDB/MySQL.

4) Reinstall all the dependent packages (such as MythTV) that got
uninstalled in 3).

5) Create a mythconverg database by running these commands:

sudo mysql
source /usr/share/mythtv/sql/mc.sql

This step sets up mythconverg with the necessary GRANTs and the proper
character set. If you also had other users and GRANTs, you will also
need to do them again here - see the output from step 2).

6) Restore your database.

Steps 2) and 5) are the ones that catch out people who do this for the
first time.

To convert from MySQL to MariaDB, just reverse the process - the steps
are otherwise the same.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv] segfault in libmysqlclient.so.21 [ In reply to ]
On 6/16/20 9:36 AM, Stephen Worthington wrote:
> On Tue, 16 Jun 2020 06:41:38 -0400, you wrote:
>
>> I've been following the issue on both this list and at
>> https://bugs.launchpad.net/bugs/1877504
>>
>> There doesn't appear to be a fix yet?
>>
>> So my high-level questions are:
>>
>> 1. Since I have mythtv v31 on Ubuntu 18.04 with mariadb, should I avoid
>> moving to Ubuntu 20.04 when the 20.04.1 is released with an upgrade
>> path? seems like the answer is "yes"
>>
>> 2. Since this issue is mariadb specific and I really have no need to be
>> on mariadb specifically, could I convert to v31 and Ubuntu 20.04 doing
>> the following:
>>
>> - backup mythconverg db (mythconverg_backup.pl) on current system and
>> all recordings.
>>
>> - fresh install of Ubuntu 20.04 and mythtv v31 with standard mysql that
>> the mythtv install pulls in.
>>
>> - restore all files and mythconverg db
>>
>> *Alternatively I thought about this sequence:*
>>
>> - backup mythconverg db as above.
>>
>> - uninstall mythtv and mariadb-server
>>
>> - upgrade Ubuntu to 20.04.1 and install mythtv v31 with default mysql
>>
>> - restore mythconverg db
>>
>> Any thoughts other than, "if it ain't broke don't fix it" :-)
>>
>> Jim A
> The procedure for changing from MariaDB to MySQL is (as best I
> remember it from the last time I did it):
>
> 1) Backup your database.
>
> 2) Work out what all your users and their GRANTs are. Run these
> commands:
>
> sudo mysql
> select distinct concat('SHOW GRANTS FOR ', QUOTE(user), '@',
> QUOTE(host), ';') as query from mysql.user;
>
> That gives you a list of commands to run. Run each of those commands
> in turn. That give you all the grants for all the users. Keep a copy
> of the results.
>
> 3) Install the MySQL client and server packages. This should
> uninstall the corresponding MariaDB packages, and may also require
> uninstalling MythTV and any other packages dependent on MariaDB/MySQL.
>
> 4) Reinstall all the dependent packages (such as MythTV) that got
> uninstalled in 3).
>
> 5) Create a mythconverg database by running these commands:
>
> sudo mysql
> source /usr/share/mythtv/sql/mc.sql
>
> This step sets up mythconverg with the necessary GRANTs and the proper
> character set. If you also had other users and GRANTs, you will also
> need to do them again here - see the output from step 2).
>
> 6) Restore your database.
>
> Steps 2) and 5) are the ones that catch out people who do this for the
> first time.
>
> To convert from MySQL to MariaDB, just reverse the process - the steps
> are otherwise the same.

my setup may be generic:

+-------------------------------------+
| SHOW GRANTS FOR 'mythtv'@'%';       |
| SHOW GRANTS FOR 'root'@'localhost'; |
+-------------------------------------+

| GRANT USAGE ON *.* TO 'mythtv'@'%' IDENTIFIED BY PASSWORD
'*C652033A----------etc-etc-etc-' |
| GRANT ALL PRIVILEGES ON `mythconverg`.* TO 'mythtv'@'%'

                                            |
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED VIA
unix_socket WITH GRANT OPTION |
| GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION

This seems to be set the way mc.sql would set the database on a standard
fresh install of mythtv v31.

So the questions is would my restore of the database not work unless the
password matched the crazy password dumped by the show grants command??

Jim A


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv] segfault in libmysqlclient.so.21 [ In reply to ]
On 6/16/20 9:14 AM, Jim Abernathy wrote:
>
> On 6/16/20 9:36 AM, Stephen Worthington wrote:
>> On Tue, 16 Jun 2020 06:41:38 -0400, you wrote:
>>
>>> I've been following the issue on both this list and at
>>> https://bugs.launchpad.net/bugs/1877504
>>>
>>> There doesn't appear to be a fix yet?
>>>
>>> So my high-level questions are:
>>>
>>> 1. Since I have mythtv v31 on Ubuntu 18.04 with mariadb, should I avoid
>>> moving to Ubuntu 20.04 when the 20.04.1 is released with an upgrade
>>> path? seems like the answer is "yes"
>>>
>>> 2. Since this issue is mariadb specific and I really have no need to be
>>> on mariadb specifically, could I convert to v31 and Ubuntu 20.04 doing
>>> the following:
>>>
>>> - backup mythconverg db (mythconverg_backup.pl) on current system and
>>> all recordings.
>>>
>>> - fresh install of Ubuntu 20.04 and mythtv v31 with standard mysql that
>>> the mythtv install pulls in.
>>>
>>> - restore all files and mythconverg db
>>>
>>> *Alternatively I thought about this sequence:*
>>>
>>> - backup mythconverg db as above.
>>>
>>> - uninstall mythtv and mariadb-server
>>>
>>> - upgrade Ubuntu to 20.04.1 and install mythtv v31 with default mysql
>>>
>>> - restore mythconverg db
>>>
>>> Any thoughts other than, "if it ain't broke don't fix it" :-)
>>>
>>> Jim A
>> The procedure for changing from MariaDB to MySQL is (as best I
>> remember it from the last time I did it):
>>
>> 1) Backup your database.
>>
>> 2) Work out what all your users and their GRANTs are.  Run these
>> commands:
>>
>> sudo mysql
>> select distinct concat('SHOW GRANTS FOR ', QUOTE(user), '@',
>> QUOTE(host), ';') as query from mysql.user;
>>
>> That gives you a list of commands to run.  Run each of those commands
>> in turn.  That give you all the grants for all the users.  Keep a copy
>> of the results.
>>
>> 3) Install the MySQL client and server packages.  This should
>> uninstall the corresponding MariaDB packages, and may also require
>> uninstalling MythTV and any other packages dependent on MariaDB/MySQL.
>>
>> 4) Reinstall all the dependent packages (such as MythTV) that got
>> uninstalled in 3).
>>
>> 5) Create a mythconverg database by running these commands:
>>
>> sudo mysql
>> source /usr/share/mythtv/sql/mc.sql
>>
>> This step sets up mythconverg with the necessary GRANTs and the proper
>> character set.  If you also had other users and GRANTs, you will also
>> need to do them again here - see the output from step 2).
>>
>> 6) Restore your database.
>>
>> Steps 2) and 5) are the ones that catch out people who do this for the
>> first time.
>>
>> To convert from MySQL to MariaDB, just reverse the process - the steps
>> are otherwise the same.
>
> my setup may be generic:
>
> +-------------------------------------+
> | SHOW GRANTS FOR 'mythtv'@'%';       |
> | SHOW GRANTS FOR 'root'@'localhost'; |
> +-------------------------------------+
>
> | GRANT USAGE ON *.* TO 'mythtv'@'%' IDENTIFIED BY PASSWORD '*C652033A----------etc-etc-etc-' |
> | GRANT ALL PRIVILEGES ON `mythconverg`.* TO 'mythtv'@'%'
>
>                                             |
> | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION |
> | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
>
> This seems to be set the way mc.sql would set the database on a standard fresh install of mythtv v31.
>
> So the questions is would my restore of the database not work unless the password matched the crazy password dumped by the show grants command??

The "crazy password" is the encrypted value of the real password.
For example, if the password is mythtv:

MariaDB [mythconverg]> SELECT PASSWORD('mythtv');
+-------------------------------------------+
| PASSWORD('mythtv') |
+-------------------------------------------+
| *CC8F35F587CA5A556B4132C2407E556D92172FFC |
+-------------------------------------------+

The above doesn't work in MySQL v8.

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv] segfault in libmysqlclient.so.21 [ In reply to ]
On Tue, 16 Jun 2020 10:19:02 -0500, you wrote:


>The "crazy password" is the encrypted value of the real password.
>For example, if the password is mythtv:
>
>MariaDB [mythconverg]> SELECT PASSWORD('mythtv');
>+-------------------------------------------+
>| PASSWORD('mythtv') |
>+-------------------------------------------+
>| *CC8F35F587CA5A556B4132C2407E556D92172FFC |
>+-------------------------------------------+
>
>The above doesn't work in MySQL v8.

The password has to match the password in your config.xml file -
mythconverg_restore.pl defaults to looking there for a password to
access the database. The password hashing is such that it should not
be reversible, so you can not retrieve the password from the database.
You can take the password in the config.xml file and generate a hashed
one from it using the PASSWORD() function and you can then see if that
hashed password matches the one in the database, as above.

Passwords and GRANTs are an area where MySQL and MariaDB now have some
differences. As I have been using MariaDB for quite a few years, I am
not up to date with how MySQL is doing it.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv] segfault in libmysqlclient.so.21 [ In reply to ]
On 6/16/20 11:33 AM, Stephen Worthington wrote:
> On Tue, 16 Jun 2020 10:19:02 -0500, you wrote:
>
>
>> The "crazy password" is the encrypted value of the real password.
>> For example, if the password is mythtv:
>>
>> MariaDB [mythconverg]> SELECT PASSWORD('mythtv');
>> +-------------------------------------------+
>> | PASSWORD('mythtv') |
>> +-------------------------------------------+
>> | *CC8F35F587CA5A556B4132C2407E556D92172FFC |
>> +-------------------------------------------+
>>
>> The above doesn't work in MySQL v8.
> The password has to match the password in your config.xml file -
> mythconverg_restore.pl defaults to looking there for a password to
> access the database. The password hashing is such that it should not
> be reversible, so you can not retrieve the password from the database.
> You can take the password in the config.xml file and generate a hashed
> one from it using the PASSWORD() function and you can then see if that
> hashed password matches the one in the database, as above.
>
> Passwords and GRANTs are an area where MySQL and MariaDB now have some
> differences. As I have been using MariaDB for quite a few years, I am
> not up to date with how MySQL is doing it.

I think in my case the solution is much simpler. I did a test run.

I have a Ubuntu 20.04 Desktop running only mythtv-frontend. Here's the
steps I did:

1. sudo apt remove --purge mythtv-frontend

2. delete /etc/mythtv and $HOME/.mythtv

3. rename host to the same name as my production mythtv-backend that
uses mariadb.

4. power off the production backend

5. apt install mythtv

6.  mkdir -p $HOME/.mythtv
     ln -s -f /etc/mythtv/config.xml ~/.mythtv/config.xml

7.  /usr/share/mythtv/mythconverg_restore.pl --drop_database
--create_database --filename /full path to directory of database backup.
(BTW, the restore was successful without any errors)

8. copy recording files over to test system

9. mythtv-setup and configure the settings that need to change on the
test system. (different tuners and different file locations.)

10. I then installed XMLTV the same as on my production system and now
it's identical to my production system from a content and schedule point
of view.

FYI,  I know from experience if I install a fresh Ubuntu 20.04 and fresh
mythtv I do not have to setup the link for the config.xml file for my
user 'jim' to the /etc/mythtv/config.xml. However, because I still had
the user 'jim' as a part of the mythtv group or because the mythtv user
was already created I had to do the link.  I think there must be some
install logic that skips the link setup if certain thinks already exist.

Jim A



_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: segfault in libmysqlclient.so.21 [ In reply to ]
On Tue, May 12, 2020 at 10:44 AM Paul Harrison <mythtv@mythqml.net> wrote:

> There is another bug in MariaDB 10.4
> (https://forum.mythtv.org/viewtopic.php?f=2&t=3720) I just want to be
> sure we are not confusing the two issues.

Apparently resolved in the 10.4.14 release(*)
which finally released a few days ago. So
just upgrade to the latest versions and
everything works fine :-). And there is also
10.5.4 (or better), where you get the fix too.




(*) The fix was originally intended to get into
10.4.13, but it missed the timing by a day
or so. If, or when, your distro will repackage
mariadb at a release level is something you
need to discuss with your distro's mariadb
package maintainer if you are not into building
your own versions. Personally, I just built
mariadb 10.4.13 with the fix when it became
available (and thought of this email thread
when I rebuilt with 10.4.14 this afternoon).
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org