Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#2527 - mythtv segfaults due to mysql

Attached to Project: Arch Linux
Opened by Sasha (kleptophobiac) - Friday, 08 April 2005, 17:21 GMT
Last edited by Judd Vinet (judd) - Tuesday, 12 April 2005, 06:52 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To dorphell (dorphell)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

The mythtv package is thoroughly useless due to rampant segmentation faults. For mythfrontend, they usually occur when starting a media stream, usually livetv or a recording - but not for the first time. It occurs when opening for the second time.

A similar problem occurs with mythbackend. When doing db manipulations, the backend will sometimes segfault as well.

I think that myth is crashing when db connections aren't being closed and reopened on time, and it might be causing a race condition - hence the slight randomness of the problem.

Also, this is not an issue using the stock Slackware packages, so that may be a point of reference... a comparison of mysql packages perhaps. Also, I am not the only user that experiences this, and it has been a consistent problem ever since Arch went mysql 4.1.x.

I did an strace of the frontend as it died, and here it is:

open("/etc/localtime", O_RDONLY) = 15
fstat64(15, {st_mode=S_IFREG|0644, st_size=1267, ...}) = 0
close(15) = 0
gettimeofday({1112979219, 696566}, NULL) = 0
write(11, "481 QUERY_CHECKFILE[]:[]Good"..., 489) = 489
select(12, [11], NULL, NULL, {0, 0}) = 0 (Timeout)
ioctl(11, FIONREAD, [0]) = 0
gettimeofday({1112979219, 697874}, NULL) = 0
select(12, [11], NULL, NULL, {0, 5000}) = 0 (Timeout)
ioctl(11, FIONREAD, [0]) = 0
gettimeofday({1112979219, 703723}, NULL) = 0
nanosleep({0, 500000}, NULL) = 0
select(12, [11], NULL, NULL, {0, 5000}) = 1 (in [11], left {0, 4000})
ioctl(11, FIONREAD, [9]) = 0
read(11, "1 ", 8) = 8
gettimeofday({1112979219, 708327}, NULL) = 0
read(11, "1", 1) = 1
access("/root/.kde/lib/kde3/plugins/sqldrivers/.", F_OK) = -1 ENOENT (No such file or directory)
access("/opt/kde/lib/kde3/plugins/sqldrivers/.", F_OK) = -1 ENOENT (No such file or directory)
access("/opt/qt/plugins/sqldrivers/.", F_OK) = 0
open("/opt/qt/plugins/sqldrivers", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 15
fstat64(15, {st_mode=S_IFDIR|0755, st_size=144, ...}) = 0
fcntl64(15, F_SETFD, FD_CLOEXEC) = 0
getdents64(15, /* 5 entries */, 131072) = 168
lstat64("/opt/qt/plugins/sqldrivers/libqsqlite.so", {st_mode=S_IFREG|0755, st_size=397788, ...}) = 0
lstat64("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", {st_mode=S_IFREG|0755, st_size=41764, ...}) = 0
lstat64("/opt/qt/plugins/sqldrivers/libqsqlpsql.so", {st_mode=S_IFREG|0755, st_size=60732, ...}) = 0
getdents64(15, /* 0 entries */, 131072) = 0
close(15) = 0
access("/usr/bin/sqldrivers/.", F_OK) = -1 ENOENT (No such file or directory)
access("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", F_OK) = 0
access("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", F_OK) = 0
lstat64("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", {st_mode=S_IFREG|0755, st_size=41764, ...}) = 0
access("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", F_OK) = 0
access("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", F_OK) = 0
access("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", F_OK) = 0
access("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", F_OK) = 0
access("/opt/qt/plugins/sqldrivers/libqsqlmysql.so", F_OK) = 0
rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_IGN}, 8) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 15
fcntl64(15, F_GETFL) = 0x2 (flags O_RDWR)
connect(15, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("192.168.1.8")}, 16) = 0
setsockopt(15, SOL_IP, IP_TOS, [8], 4) = 0
setsockopt(15, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(15, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
read(15, "4\0\0\0", 4) = 4
read(15, "\n4.1.11\0\25\0\0\0J$o&loi?\0,\2420\2\0\0\0\0\0\0\0"..., 52) = 52
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
This task depends upon

Closed by  dorphell (dorphell)
Tuesday, 26 April 2005, 02:53 GMT
Reason for closing:  Fixed
Comment by Dale Blount (dale) - Friday, 08 April 2005, 17:27 GMT
This may or may not have to do with the recent feature request I submitted for a thread-safe-client version of our mysql package. It needs another tweak (some symlinks) but versions above 4.11-2 should be used to compile mythtv to see if it improves the crashing.
Comment by Sasha (kleptophobiac) - Friday, 08 April 2005, 18:56 GMT
I updated everything and then recompiled from abs, with the same symptoms. :(
Comment by Dale Blount (dale) - Friday, 08 April 2005, 19:03 GMT
4.1.11-2 isn't out yet...
Comment by Sasha (kleptophobiac) - Friday, 08 April 2005, 19:47 GMT
Ok, this doesn't seem to be a mythtv problem, but a mysql problem. Read the second page:

http://bbs.archlinux.org/viewtopic.php?t=8346

I tried that, and it works beautifully. woohoo!
Comment by dorphell (dorphell) - Friday, 08 April 2005, 19:52 GMT
Okay then, I'll pass it onto judd, maintainer of mysql
Comment by Sasha (kleptophobiac) - Friday, 08 April 2005, 20:45 GMT
Completely off topic, but "Judd, maintainer of MySQL" sounds an awful lot like a fantasy/scifi introduction: "<name>, {son, daughter, father, mother} of <name>"
Comment by Judd Vinet (judd) - Tuesday, 12 April 2005, 06:52 GMT
4.1.11-2 will be out tonight.

Passing back to dorph.
Comment by dorphell (dorphell) - Wednesday, 13 April 2005, 05:02 GMT
Sasha, Is this still an issue now that 4.1.11-2 is out?
Comment by Dale Blount (dale) - Wednesday, 13 April 2005, 12:04 GMT
Dorphell, I'd assume you'd need to rebuild mythtv first... It's a new set of client libs that we hope mythtv picks up instead of the standard ones.
Comment by dorphell (dorphell) - Wednesday, 13 April 2005, 14:37 GMT
It might work without, that's why I'm asking.
Comment by Sasha (kleptophobiac) - Wednesday, 13 April 2005, 20:20 GMT
I'll go install the official 4.1.11-2 now, as I've been operating on a package I compiled with the provided patch. I'll let you know how that works.

I don't think a new mythtv is required, and I didn't make one after I fixed sql.

Dorphell, if you do make another mythtv, would you consider adding native ALSA support? There's really no reason not to have it, as OSS still works, and some of the other deps for myth need the alsa-libs anyway.
Comment by Dale Blount (dale) - Wednesday, 13 April 2005, 20:28 GMT
Sasha, which patch are you using currently?
Comment by dorphell (dorphell) - Wednesday, 13 April 2005, 20:43 GMT
yeah i'll add alsa support. (if you wanna save me some time, give me the configure line for it or whatever needs to be added)
Comment by Sasha (kleptophobiac) - Wednesday, 13 April 2005, 21:39 GMT
Ok, I just tried the new mysql, and it has the same problem as the old one. Here's the line I have in the PKGBUILD for mysql to make it work:

sed -i 's/my_once_free/free_charsets();\n my_once_free/' mysys/my_init.c

And here's what to use to enable ALSA:

echo "CONFIG += using_alsa" >> settings.pro
echo "ALSA_LIBS = -lasound" >> settings.pro

A couple more myth based suggestions...
Make myth part of the PVR package group, and add the myth plugins to the group. Also, lirc support is almost a must with any real life home theater project w/ linux, so it might as well be added too. Here's the lines for that:

echo "EXTRA_LIBS += -lGL -lGLU" >> settings.pro
echo "LIRC_LIBS = -llirc_client" >> settings.pro

Anyway, I've done a lot of work to make mythtv a reality under arch, mainly because I think it's the coolest thing ever (yes, both arch and myth. I demolished a perfectly working slackware/myth combo, just to make it work under the most perfect distro ever)

Here's a dump of my pkgbuilds and whatnot. Some of the packages are more or less direct rips from the official packages with a couple modifications. A bunch are fresh. Here's the site:

http://www.mstcforum.com/projects/arch/

The arch packages I've modified:
lirc - just made it part of the pvr group
faad2 - installed all the header files, not just the defaults
mplayer - added lirc support
mythtv - added lirc and alsa support
mysql - added fix for the charset crash bug (thanks Towner!)
fftw - made an fftw2 for legacy fftw support, mythmusic needs the backwards version

Fresh packages:
mythdvd - dvd player and ripper plugin
mythvideo - video player plugin
mythmusic - music player and ripper plugin
mythnews - rss newsreader plugin
mythweather - weather plugin
perl-xml-simple - needed for mythvideo perl script that queries IMDB

Loading...