Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 215784 - dev-db/mysql-5.0.56 crashing when used via Qt bindings
Summary: dev-db/mysql-5.0.56 crashing when used via Qt bindings
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-01 22:01 UTC by rushfan73
Modified: 2008-11-14 05:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Backtrace (backtrace.log,1.42 KB, text/plain)
2008-04-01 22:02 UTC, rushfan73
Details
emerge --info (emerge.info,4.65 KB, text/plain)
2008-04-01 22:03 UTC, rushfan73
Details
new backtrace (backtrace.log,2.82 KB, text/plain)
2008-04-04 20:42 UTC, rushfan73
Details
backtrace.log (backtrace.log,26.10 KB, text/plain)
2008-04-05 01:21 UTC, rushfan73
Details
Hopefully a more informative backtrace of the problem (backtrace.log,1.92 KB, text/plain)
2008-05-15 20:55 UTC, Benny P.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rushfan73 2008-04-01 22:01:54 UTC
When changing channels with MythTV (using the ivtv driver), it segfaults. 

Reproducible: Always

Steps to Reproduce:
1.Load MythTV
2.Change Channel
3.Watch Crash
Comment 1 rushfan73 2008-04-01 22:02:45 UTC
Created attachment 148020 [details]
Backtrace
Comment 2 rushfan73 2008-04-01 22:03:29 UTC
Created attachment 148021 [details]
emerge --info
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2008-04-02 00:43:47 UTC
version of MySQL and QT?
Comment 4 rushfan73 2008-04-02 01:11:33 UTC
(In reply to comment #3)
> version of MySQL and QT?
> 

MySQL version is dev-db/mysql-5.0.56 and Qt version is x11-libs/qt-3.3.8-r4

I also have x11-libs/qt-4.4.0_beta installed but I cant imagine that affecting mythtv since it uses qt3.
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2008-04-02 13:31:47 UTC
Well, I've got the same version of Qt and 5.0.54 of MySQL. Works fine for me. Considering we're on different versions of MySQL and the last 3 frames of the crash are in MySQL, I'm going to kick it over to those guys.
Comment 6 Scott Martin 2008-04-02 23:32:47 UTC
I have the same issue with segfaults from mythtv when changing channels.
Comment 7 Doug Goldstein (RETIRED) gentoo-dev 2008-04-03 14:23:18 UTC
And backing off versions of mysql fixes this or not?
Comment 8 rushfan73 2008-04-03 20:18:50 UTC
(In reply to comment #7)
> And backing off versions of mysql fixes this or not?
> 

Well, I tried, but the automake fails when I try to downgrade to 5.0.54.

***** automake *****
***** automake --add-missing --copy --foreign

configure.in:37: required file `../ltmain.sh' not found
Comment 9 rushfan73 2008-04-04 16:07:06 UTC
(In reply to comment #7)
> And backing off versions of mysql fixes this or not?
> 

So I got 5.0.54 to compile. IT now segfaults before the frontend can even finish loading.
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-04-04 19:34:19 UTC
Please rebuild mysql w/ CFLAGS="${CFLAGS} -ggdb" FEATURES="${FEATURES} splitdebug keepwork" USE="${USE} test"

Then step up to the third stack frame after you get a new coredump, and check for null pointers being given to MySQL, by MythTV or Qt.
Comment 11 rushfan73 2008-04-04 20:42:55 UTC
Created attachment 148652 [details]
new backtrace

Sorry, I'm not entirely sure what you mean by that, but I recompiled mysql with those options and got a new backtrace.
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-04-04 21:09:38 UTC
It doesn't look like you did. It should have given you sourcecode filenames and line numbers. Once you do have a backtrace with those,

fire up gdb, and instead of printing a backtrace, use up to select the third stack frame, and them examine the variables in there (look at the gdb docs).
Comment 13 rushfan73 2008-04-04 23:11:12 UTC
(In reply to comment #12)
> It doesn't look like you did. It should have given you sourcecode filenames and
> line numbers. Once you do have a backtrace with those,
> 
> fire up gdb, and instead of printing a backtrace, use up to select the third
> stack frame, and them examine the variables in there (look at the gdb docs).
> 

#3  0x00002aaaaaf30d0a in ?? () from /usr/lib/libmysqlclient.so.15
(gdb) list
392         {
393             VERBOSE(VB_IMPORTANT, QString(
394                         "Error: Failed to parse --generate-preview "
395                         "param '%1'").arg(param));
396         }
397
398         return ok;
399     }
400
401     int main(int argc, char **argv)

Is that what you're talking about? I read through the gdb doc frames section.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-04-05 00:36:37 UTC
That listing isn't _anywhere_ in MySQL.
The address you printed there also isn't consistent with your previous traces.

1. CFLAGS="-march=k8 -O2 -pipe -ggdb" \
CXXFLAGS="-march=k8 -O2 -pipe -ggdb" \
FEATURES="keepwork splitdebug" \
USE="debug" \
emerge mysql =qt-3.3* mythtv
2. ulimit -c unlimited
3. run $BINARY
4. cause bug
5. gdb $BINARY $CORE
6. 'set logging file backtrace.log'
7. 'set logging on'
8. 'thread apply all bt full'

Paste the full output from #7 (which will also be in backtrace.log) into this bug, and look for a null pointer in it - I suspect that Qt or MythTV is passing a null pointer in as the argument for a prepared statement.
Comment 15 rushfan73 2008-04-05 01:20:58 UTC
Thank you for the instructions, I wasnt following you. I have to backtrace.log and I see all a null pointer in there (I think). Tragically I can't make much sense of it all. Anyhow, I uploaded the file. 
Comment 16 rushfan73 2008-04-05 01:21:19 UTC
Created attachment 148681 [details]
backtrace.log
Comment 17 Benny P. 2008-05-15 06:19:22 UTC
I believe I am getting the same SEGFAULT described in this bug.  MythTV is now completely unusable - mythbackend SEGFAULTs immediately upon starting, with a backtrace similar to what's shown above (terminating at _db_return_ () from /usr/lib/libmysqlclient.so.15).

I have the debugging symbols compiled, and stepped through the previous calls.  Looking at the variables in the functions, I don't see anything obvious happening.

It appears it might be an issue with Qt/MySQL on AMD64, since that is what I am running also.

QT: 3.3.8-r4 (and 4.3.3)
MySQL: 5.0.54 (same thing happens with 5.0.56)
MythTV: 0.21_p17100

If I have a bit more time, I'll look through the debugging again.  Let me know if you want anything specific.
Comment 18 Benny P. 2008-05-15 20:52:50 UTC
Ok I think I've got some really useful info.

MySQL appears to crash within the debugging functions, specifically _db_return_ in dbug.c:828 (see attachment).  For me, tentatively, **it appears to work if MySQL is NOT emerged with the debug flag.**

The code in dbug.c is

826     #ifndef THREAD
827         if (state->framep != NULL)
828           state->framep = (char **) *state->framep;
829     #endif

which doesn't make too much sense to me.  I have attached a backtrace of that thread, with file/line numbers.
Comment 19 Benny P. 2008-05-15 20:55:57 UTC
Created attachment 153259 [details]
Hopefully a more informative backtrace of the problem

Crashing of MythTV (mythbackend) due to libmysqlclient problems.
Comment 20 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-11-14 05:27:30 UTC
Upstream mysql redid that part of the codebase recently, please reset with the latest arch release of dev-db/mysql (5.0.70).