Bug 252424 - Amarok crashed when it launched [@ MySqlEmbeddedStorage::MySqlEmbeddedStorage]
Summary: Amarok crashed when it launched [@ MySqlEmbeddedStorage::MySqlEmbeddedStorage]
Status: RESOLVED UPSTREAM
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.3.90
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: 2.4.0
Assignee: Amarok Developers
URL:
Keywords:
: 260936 261051 261213 261547 262408 265837 266817 267409 269252 272432 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-26 13:35 UTC by Charles-Antoine Couret
Modified: 2011-05-04 17:16 UTC (History)
18 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (6.07 KB, text/plain)
2010-12-23 09:00 UTC, Andrew shapovalov
Details
Upgrade the embedded MySQL Database manually. (359 bytes, text/plain)
2011-01-03 13:39 UTC, Colin Guthrie
Details
Workaround patch "mysql_server_init( 0,0,0 )" crash (1.25 KB, patch)
2011-01-13 00:19 UTC, Martin Kho
Details
New crash information added by DrKonqi (4.78 KB, text/plain)
2011-02-14 18:14 UTC, Mickaël
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Charles-Antoine Couret 2010-09-26 13:35:40 UTC
Application: amarok (2.3.1.90)
KDE Platform Version: 4.5.1 (KDE 4.5.1)
Qt Version: 4.7.0
Operating System: Linux 2.6.35.4-28.fc14.x86_64 x86_64
Distribution: "Fedora release 14 (Laughlin)"

-- Information about the crash:
When I launch Amarok, it crashed. I have remove the configuration file and I have downgrade the version of Amarok but, no amelioration…

The crash can be reproduced every time.

-- Backtrace:
Application: Amarok (amarok), signal: Segmentation fault
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[Current thread is 1 (Thread 0x7fbf75844840 (LWP 32238))]

Thread 8 (Thread 0x7fbf609b7710 (LWP 32239)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:216
#1  0x00007fbf698f4d21 in ?? () from /usr/lib64/libxine.so.1
#2  0x00000030ea406d5b in start_thread (arg=0x7fbf609b7710) at pthread_create.c:301
#3  0x00000030e98e4a6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 7 (Thread 0x7fbf601b6710 (LWP 32240)):
#0  0x00000030e98db093 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=<value optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00000030ec443774 in g_main_context_poll (context=0x7fbf580009b0, block=1, dispatch=1, self=<value optimized out>) at gmain.c:3063
#2  g_main_context_iterate (context=0x7fbf580009b0, block=1, dispatch=1, self=<value optimized out>) at gmain.c:2745
#3  0x00000030ec443cad in g_main_context_iteration (context=0x7fbf580009b0, may_block=1) at gmain.c:2813
#4  0x0000003f5a386936 in QEventDispatcherGlib::processEvents (this=0x7fbf580008c0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:417
#5  0x0000003f5a35ab52 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#6  0x0000003f5a35ad9c in QEventLoop::exec (this=0x7fbf601b5ce0, flags=...) at kernel/qeventloop.cpp:201
#7  0x0000003f5a26fe44 in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:490
#8  0x00007fbf69b80cf0 in Phonon::Xine::XineThread::run (this=0xe8c890) at /usr/src/debug/phonon-4.4.2/xine/xinethread.cpp:143
#9  0x0000003f5a27265e in QThreadPrivate::start (arg=0xe8c890) at thread/qthread_unix.cpp:266
#10 0x00000030ea406d5b in start_thread (arg=0x7fbf601b6710) at pthread_create.c:301
#11 0x00000030e98e4a6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 6 (Thread 0x7fbf5f7b0710 (LWP 32241)):
#0  0x00000030e98db093 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=<value optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x0000003f5f22cc0f in ?? () from /usr/lib64/libpulse.so.0
#2  0x0000003f5f21cae6 in pa_mainloop_poll () from /usr/lib64/libpulse.so.0
#3  0x0000003f5f21dec9 in pa_mainloop_iterate () from /usr/lib64/libpulse.so.0
#4  0x0000003f5f21df80 in pa_mainloop_run () from /usr/lib64/libpulse.so.0
#5  0x0000003f5f22ca0b in ?? () from /usr/lib64/libpulse.so.0
#6  0x0000003f61438878 in ?? () from /usr/lib64/libpulsecommon-0.9.21.so
#7  0x00000030ea406d5b in start_thread (arg=0x7fbf5f7b0710) at pthread_create.c:301
#8  0x00000030e98e4a6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 5 (Thread 0x7fbf5efaf710 (LWP 32242)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fbf69906deb in ?? () from /usr/lib64/libxine.so.1
#2  0x00000030ea406d5b in start_thread (arg=0x7fbf5efaf710) at pthread_create.c:301
#3  0x00000030e98e4a6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 4 (Thread 0x7fbf5e3a5710 (LWP 32243)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fbf69906deb in ?? () from /usr/lib64/libxine.so.1
#2  0x00000030ea406d5b in start_thread (arg=0x7fbf5e3a5710) at pthread_create.c:301
#3  0x00000030e98e4a6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 3 (Thread 0x7fbf5dba4710 (LWP 32244)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fbf69906deb in ?? () from /usr/lib64/libxine.so.1
#2  0x00000030ea406d5b in start_thread (arg=0x7fbf5dba4710) at pthread_create.c:301
#3  0x00000030e98e4a6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 2 (Thread 0x7fbf5d3a3710 (LWP 32245)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fbf69906deb in ?? () from /usr/lib64/libxine.so.1
#2  0x00000030ea406d5b in start_thread (arg=0x7fbf5d3a3710) at pthread_create.c:301
#3  0x00000030e98e4a6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7fbf75844840 (LWP 32238)):
[KCrash Handler]
#6  0x00007fbf57842b30 in handle_options () from /usr/lib64/mysql/libmysqld.so.0
#7  0x00007fbf576e2979 in ?? () from /usr/lib64/mysql/libmysqld.so.0
#8  0x00007fbf576e4ead in ?? () from /usr/lib64/mysql/libmysqld.so.0
#9  0x00007fbf576e5635 in init_embedded_server () from /usr/lib64/mysql/libmysqld.so.0
#10 0x00007fbf5c6941bf in MySqlEmbeddedStorage::MySqlEmbeddedStorage (this=0xe7cf00, storageLocation=<value optimized out>) at /usr/src/debug/amarok-2.3.1.90/src/core-impl/collections/sqlcollection/mysqlecollection/MySqlEmbeddedStorage.cpp:83
#11 0x00007fbf5c69258c in Collections::MySqlEmbeddedCollectionFactory::init (this=0x12017e0) at /usr/src/debug/amarok-2.3.1.90/src/core-impl/collections/sqlcollection/mysqlecollection/MySqlEmbeddedCollection.cpp:34
#12 0x0000003b491c7a5f in CollectionManager::init (this=0x121c480) at /usr/src/debug/amarok-2.3.1.90/src/core-impl/collections/support/CollectionManager.cpp:196
#13 0x0000003b491c9f48 in CollectionManager::CollectionManager (this=0x121c480) at /usr/src/debug/amarok-2.3.1.90/src/core-impl/collections/support/CollectionManager.cpp:117
#14 0x0000003b491ca038 in CollectionManager::instance () at /usr/src/debug/amarok-2.3.1.90/src/core-impl/collections/support/CollectionManager.cpp:94
#15 0x0000003b490a753c in ServiceFactory::ServiceFactory (this=0x12225f0) at /usr/src/debug/amarok-2.3.1.90/src/services/ServiceBase.cpp:38
#16 0x00007fbf5c8dad16 in MagnatuneServiceFactory () at /usr/src/debug/amarok-2.3.1.90/src/services/magnatune/MagnatuneStore.h:47
#17 create_plugin () at /usr/src/debug/amarok-2.3.1.90/src/services/magnatune/MagnatuneStore.cpp:53
#18 0x0000003b4802aa53 in Plugins::PluginManager::createFromService (service=...) at /usr/src/debug/amarok-2.3.1.90/src/core/plugins/PluginManager.cpp:109
#19 0x0000003b490b8aca in ServicePluginManager::collect (this=0xe54150) at /usr/src/debug/amarok-2.3.1.90/src/services/ServicePluginManager.cpp:66
#20 0x0000003b490b971d in ServicePluginManager::ServicePluginManager (this=0xe54150) at /usr/src/debug/amarok-2.3.1.90/src/services/ServicePluginManager.cpp:43
#21 0x0000003b490b97c8 in ServicePluginManager::instance () at /usr/src/debug/amarok-2.3.1.90/src/services/ServicePluginManager.cpp:33
#22 0x0000003b493fc201 in MainWindow::MainWindow (this=0x11f3520) at /usr/src/debug/amarok-2.3.1.90/src/MainWindow.cpp:161
#23 0x0000003b493c2833 in App::continueInit (this=0x7fff587be1f0) at /usr/src/debug/amarok-2.3.1.90/src/App.cpp:645
#24 0x0000003b493c4bdb in App::App (this=0x7fff587be1f0) at /usr/src/debug/amarok-2.3.1.90/src/App.cpp:210
#25 0x00000000004081a5 in main (argc=1, argv=0x7fff587c0158) at /usr/src/debug/amarok-2.3.1.90/src/main.cpp:235

Reported using DrKonqi
Comment 1 Myriam Schweingruber 2010-09-26 19:32:37 UTC
BTW, Amarok 2.3.2 has been released a few days ago, how about updating? Please also install debugging symbols for mysql as your backtrace is not showing all debugging information

Also you didn't sepcify if you are using the embedded mysqle or if you did setup an external MySQL server.
Comment 2 Charles-Antoine Couret 2010-09-26 20:04:27 UTC
I use the repos kde-redhat with Fedora. 
I will see to MySQL…
Comment 3 Myriam Schweingruber 2010-12-14 00:30:39 UTC
Is this still valid with Amarok 2.3.2 or Amarok 2.4 beta?
Comment 4 Myriam Schweingruber 2010-12-22 15:07:28 UTC
*** Bug 260936 has been marked as a duplicate of this bug. ***
Comment 5 Myriam Schweingruber 2010-12-22 15:07:52 UTC
Confirmed by duplicate on 2.4 beta.

Do you use the default MySQL embedded and have the appropriate packages installed or do you use an external MySQL server?
Comment 6 Myriam Schweingruber 2010-12-22 15:08:16 UTC
Changing version.
Comment 7 Andrea Scarpino 2010-12-22 15:11:11 UTC
Same error using the mysql 5.5.8 package in Arch Linux
Comment 8 Andrea Scarpino 2010-12-22 21:08:33 UTC
some more useful info:

$ sudo mysql_inmysqld --defaults-file=/home/bash/.kde4/share/apps/amarok/my.cnf --datadir=/home/bash/.kde4/share/apps/amarok/mysqle/ --socket=test.socket
mysqld: Table 'mysql.plugin' doesn't exist
101222 21:06:49 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.5
101222 21:06:49  InnoDB: Initializing buffer pool, size = 128.0M
101222 21:06:49  InnoDB: Completed initialization of buffer pool
101222 21:06:49  InnoDB: highest supported file format is Barracuda.
101222 21:06:49  InnoDB: 1.1.4 started; log sequence number 1595675
101222 21:06:49 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
Comment 9 Andrea Scarpino 2010-12-22 21:11:00 UTC
s/mysql_inmysqld/mysql_upgrade
Comment 10 Myriam Schweingruber 2010-12-22 21:40:50 UTC
Andrea: you didn't really answer my question...
Comment 11 Andrea Scarpino 2010-12-22 22:02:36 UTC
Myriam: because I don't understand what are you asking. I use the Arch Linux packages so I should reply to you that I installed the appropriate packages and, reading at PKGBUILD, -DWITH_EMBEDDED_SERVER=ON is passed to MySQL cmake.
Comment 12 Andrew shapovalov 2010-12-23 09:00:29 UTC
Created attachment 55181 [details]
New crash information added by DrKonqi

amarok (2.3.2) on KDE Platform 4.5.4 (KDE 4.5.4) using Qt 4.7.1

- What I was doing when the application crashed:
I update the system to last version today. After reboot I try to load the amarok from console and take the message about crash like this:
[koshechka@notebook ~]$ amarok
KCrash: Application 'amarok' crashing...
KCrash: Attempting to start /usr/libexec/kde4/drkonqi from kdeinit
sock_file=/home/koshechka/.kde/socket-notebook/kdeinit4__0

-- Backtrace (Reduced):
#6  0x00007f96a106fc21 in handle_options () from /usr/lib64/mysql/libmysqld.so.0
[...]
#8  0x00007f96a0feed8c in init_embedded_server () from /usr/lib64/mysql/libmysqld.so.0
#9  0x00007f96a1bbd1bf in MySqlEmbeddedStorage::MySqlEmbeddedStorage (this=0x21477d0, storageLocation=<value optimized out>) at /usr/src/debug/amarok-2.3.2/src/core-impl/collections/sqlcollection/mysqlecollection/MySqlEmbeddedStorage.cpp:83
#10 0x00007f96a1bbb58c in Collections::MySqlEmbeddedCollectionFactory::init (this=0x1d38dd0) at /usr/src/debug/amarok-2.3.2/src/core-impl/collections/sqlcollection/mysqlecollection/MySqlEmbeddedCollection.cpp:34
#11 0x00007f96cbf7c5cc in CollectionManager::loadServices (this=0x212ffb0, services=<value optimized out>) at /usr/src/debug/amarok-2.3.2/src/core-impl/collections/support/CollectionManager.cpp:215
Comment 13 Mikko C. 2010-12-23 11:45:37 UTC
*** Bug 261051 has been marked as a duplicate of this bug. ***
Comment 14 Mikko C. 2010-12-23 11:47:27 UTC
There was a big fat warning about running mysql_upgrade after upgrading mysql on Archlinux. I'm not sure if that could be related.
Anyway, maybe ask arch devs to recompile amarok against the new mysql version, that could possibly fix this crash.
Comment 15 Andrea Scarpino 2010-12-23 12:21:46 UTC
Hi Mikko, I am the maintainer of Amarok on Arch Linux and I just adopted and update MySQL too. Maybe Arch Linux users are reporting this because no one else have updated to 5.5 yet?

I am trying to debug into this since yesterday without success and I already rebuilt Amarok with MySQL 5.5 with no luck.
Comment 16 Myriam Schweingruber 2010-12-26 19:29:32 UTC
*** Bug 261213 has been marked as a duplicate of this bug. ***
Comment 17 Myriam Schweingruber 2010-12-26 19:30:51 UTC
There seems to be a problem with this particular MySQL version
Comment 18 Shlomi Fish 2010-12-29 22:50:29 UTC
I'm now getting this crash on Mandriva Cooker running on a Pentium 4 2.4GHz machine (x86-32) with mysql-5.5.8-0mdv2011.0.i586 .
Comment 19 Dima Panov 2011-01-02 08:46:12 UTC
Still crash on FreeBSD with mysql 5.5.8 when use embedded database. with external connection all fine.
KDE 4.5.90, Amarok 2.3.90, qt 4.7.1
Comment 20 Colin Guthrie 2011-01-03 13:39:37 UTC
Created attachment 55516 [details]
Upgrade the embedded MySQL Database manually.

This is a script which performs the necessary mysql_upgrade on the embedded amarok database. Not sure if this is supposed to be handled internally in Amarok or if it should be done separately like this.

Do NOT run as root or via sudo, only as your regular user.

Even after updating the database like this, I could not make Amarok run but I am able to start and run MySQL quite happily on the embedded directory. I dunno what the larger problem actually is yet.
Comment 21 Dima Panov 2011-01-03 14:17:20 UTC
Colin, amarok starts now with embedded base too. 

But just for test - with empty config, on a clean profile  - when I start amarok, it always try to create embedded database, and crash again :(
Comment 22 Myriam Schweingruber 2011-01-04 00:43:46 UTC
*** Bug 261547 has been marked as a duplicate of this bug. ***
Comment 23 Myriam Schweingruber 2011-01-04 00:47:39 UTC
The problem is upstream at MySQL, please see also https://bugzilla.novell.com/show_bug.cgi?id=661950

You should talk to your distribution to patch this version.
Comment 24 Dima Panov 2011-01-04 13:39:56 UTC
Nope. It's fails on a clean profile on database creation. exactly, on mysql_server_init. - config is created, but database isn't
Comment 25 Martin Kho 2011-01-04 13:55:39 UTC
Hi,

Can confirm comment #24. Patch doesn't work for me either ;-(

Martin Kho
Comment 26 Martin Kho 2011-01-05 13:54:47 UTC
Hi,

I've played a little with MySQL:

1. I came across the following test:

"mysqltest_embedded"

Running it as normal user and as root gives:

mysqltest got signal 11
read_command_buf at 0xf384e0 = 
Attempting backtrace...
stack_bottom = (nil) thread_stack 0x40000
mysqltest_embedded(my_print_stacktrace+0x33)[0x526cf3]
mysqltest_embedded[0x50250e]
/lib64/libpthread.so.0[0x300100f3d0]
mysqltest_embedded(handle_options+0x88)[0x524eb8]
mysqltest_embedded[0x539adc]
mysqltest_embedded(init_embedded_server+0x183)[0x53cfd3]
mysqltest_embedded(main+0x3fe)[0x50f68e]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x300041ee7d]
mysqltest_embedded[0x502289]
Writing a core file...
Segmentation fault (core dumped)

In this 'backtrace' you can see that the exact the same functions are failing that fail in amarok.

2. I fiddled somewhat with the options of mysql_library_init (this function  replaced mysql_server_init). I used example 1 in [1] for my experimentations.
a. copy/paste the code, compiled the program -> running it was ok
b. changed the line:
 "mysql_library_init(num_elements, server_options, server_groups);" to
 "mysql_library_init(0, 0, 0); (what is used in amarok)
-> running it wasn't ok: segmentation fault (core dumped)
Example 2 [1] says:
"* You can use mysql_library_init(0, NULL, NULL), and it
   * initializes the server using groups = {
   *   "server", "embedded", NULL"
Bad, this isn't working (any more?)-> segmentation fault (core dumped)

3. 'Patched' "amarok-2.3.90/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.cpp" as follows:

+    static char *server_options[] = \
+       { NULL, "--defaults-file=my.cnf", NULL };
+    int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
+
+    static char *server_groups[] = { NULL, NULL, NULL };
+
     setenv( "MYSQL_HOME", storagePath.toAscii().data(), 1 );
-    if( mysql_server_init( 0 , 0, 0 ) != 0 )
+    if( mysql_library_init( num_elements , server_options, server_groups ) != 0 )

-> amarok runs again, but the option "--defaults-file=my.cnf" is not correct. The seems that the server is always reading the system my.cnf file.

What is my conclusion?
It's a problem with MySQL 5.5.8 and not with Amarok. For test case 1 I've filed a bug at bugzilla.redhat.com [2]

Hope someone else can confirm (or disprove :-)) my experiences.

Martin Kho

[1] http://dev.mysql.com/doc/refman/5.5/en/libmysqld-example.html
[2] https://bugzilla.redhat.com/show_bug.cgi?id=667365
Comment 27 Myriam Schweingruber 2011-01-09 19:46:24 UTC
*** Bug 262408 has been marked as a duplicate of this bug. ***
Comment 28 Martin Kho 2011-01-12 23:03:21 UTC
Hi,

The status of this report is marked as "RESOLVED as UPSTREAM". But today Amarok 2.4.0-1 was pushed to Fedora rawhide (aka fc15) and this update - final version? - still crashes. The patch from comment #23 didn't make it, as it seems.
In MySqlEmbeddedStorage.cpp I still see: "out << "collation-server = utf8_bin" << endl;". In the patch this was replaced by "out << "collation-server = utf8_unicode_ci" << endl;"

Can someone tell me what the status of this report is? Is it closed?

Martin Kho

Btw: For those who want to have a temporary 'workaround patch'. I've reworked the 'patch' in comment #26 a little, so that Amarok works like before :-). I created the patch against Amarok 2.3.90 so I'll first check if it also works for Amarok 2.4.0.
Comment 29 Martin Kho 2011-01-13 00:19:48 UTC
Created attachment 55951 [details]
Workaround patch "mysql_server_init( 0,0,0 )" crash

Hi,

This patch is a very ugly workaround for the Amarok crash when using MySQL 5.5.8.
It works with amarok-2.3.90 and amarok-2.4.0. I'm not a programmer so the code can be much better :-)

Martin Kho
Comment 30 Andrea Scarpino 2011-01-13 00:45:25 UTC
(In reply to comment #29)
> This patch is a very ugly workaround for the Amarok crash when using MySQL
> 5.5.8.
> It works with amarok-2.3.90 and amarok-2.4.0. I'm not a programmer so the code
> can be much better :-)
Thank you very much Martin!!! I can use amarok (2.4.0) and MySQL 5.5.8 if I patch amarok with your patch!
Comment 31 Myriam Schweingruber 2011-01-13 02:39:13 UTC
(In reply to comment #28)
> Hi,
> 
> The status of this report is marked as "RESOLVED as UPSTREAM". But today Amarok
> 2.4.0-1 was pushed to Fedora rawhide (aka fc15) and this update - final
> version? - still crashes. The patch from comment #23 didn't make it, as it
> seems.
> In MySqlEmbeddedStorage.cpp I still see: "out << "collation-server = utf8_bin"
> << endl;". In the patch this was replaced by "out << "collation-server =
> utf8_unicode_ci" << endl;"
> 
> Can someone tell me what the status of this report is? Is it closed?

Well, it is not an Amarok bug but a MySQL one, so it needs to be fixed in MySQL. You need to ask upstream (e.g MySQL or your distribution) about the status of the bug there.
Comment 32 Martin Kho 2011-01-13 09:24:48 UTC
Hi,

@Myriam: You're absolutely right, the patch is under ways upstream [1]. So please do not apply my ugly workaround patch or drop it!.

Sorry for my impatience. Till today I didn't get any response on my report I mentioned in comment #26.

Thanks for the great music application :-)

Martin Kho

[1] http://bugs.mysql.com/bug.php?id=57931
Comment 33 Martin Kho 2011-01-13 11:53:11 UTC
Hi,

In Fedora's rawhide MySQL 5.5.8-4 solves the issue for the mysqltest_embedded program. Amarok doesn't crash either, but it still won't start. This is because MySQL (embedded) can't find amarok's my.cnf defaults file.

In .xsesson-errors I see:

"mysql_embedded: Table 'mysql.plugin' doesn't exist
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.5
110113  9:35:15  InnoDB: Using Linux native AIO
110113  9:35:15  InnoDB: Initializing buffer pool, size = 128.0M
110113  9:35:15  InnoDB: Completed initialization of buffer pool
110113  9:35:15  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /var/lib/mysql/ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation."

This message means that mysql is using the wrong my.cnf config file (/etc/my.cnf). This issue can be workarounded (solved?) by copying ./kde/share/apps/amarok/my.cnf to ~/.my.cnf.

Is this satisfactory or still a bug? (is a new report needed?)

Martin Kho
Comment 34 Myriam Schweingruber 2011-01-13 13:30:06 UTC
I would say still an upstream bug then, I have no problem at all with my embedded MySQL here, using a much older version.
Comment 35 Martin Kho 2011-01-13 13:34:41 UTC
Hi,

True, it's a specific problem with MySQL 5.5.x (x= ..8). With MySQL 5.1.x everything was fine.

I'll create a bug report at bugzilla.redhat and see what they have to say.

Martin Kho
Comment 36 Dima Panov 2011-01-13 16:15:08 UTC
this ugly patch still needed. when  init mysql embedded engine, application MUST specify path to separated my.cnf in server_options.
Comment 37 Martin Kho 2011-01-13 17:16:19 UTC
Hi Dima,

Are you suggesting that the MYSQL_HOME environment variable is no longer valid /used in mysql 5.5.8? I've searched the change history of MySQL 5.5.8 [1], but  couldn't find any statements that the variable is removed in relation to the embedded server. There was a report [2] stating that MySQL 5.5.8 didn't use the environment variable. Do you have any other information why you say that the path 'MUST' be specified?

Martin Kho

Btw: FYI: I've filed a bug at bugzilla.redhat.com [3] against MySQL.

[1] http://dev.mysql.com/doc/refman/5.5/en/news-5-5-x.html
[2] http://forums.mysql.com/read.php?11,401403,401403
[3] https://bugzilla.redhat.com/show_bug.cgi?id=669364
Comment 38 Martin Kho 2011-01-13 21:37:09 UTC
Hi,

In Fedora rawhide version MySQL 5.5.8-5 solves all issues with respect to Amarok. For those who want to have more information about the MYSQL_HOME fix see report [1]. IMHO, this report can be closed, meaning it's fixed upstream.

Thanks.

Martin Kho


[1] http://bugs.mysql.com/bug.php?id=59280
Comment 39 Dima Panov 2011-01-14 11:25:22 UTC
Martin, about suggested patch for MYSQL_HOME: 
this is answer from FreeBSD port maintainer. I follow to agree with him.


No, no, and no, sorry :-) If you want to be 100% sure to use a config
file, you have to specify it on the command line, otherwise the default
search order come into play, and if an /etc/my.cnf file exists, your
MYSQL_HOME/.my.cnf is completely ignored.
Comment 40 Myriam Schweingruber 2011-02-09 13:08:42 UTC
*** Bug 265837 has been marked as a duplicate of this bug. ***
Comment 41 Mickaël 2011-02-14 18:14:32 UTC
Created attachment 57253 [details]
New crash information added by DrKonqi

amarok (2.4-GIT) on KDE Platform 4.6.00 (4.6.0) using Qt 4.7.1

My GIT-installation of Amarok was working perfectly since a bad command which installed Amarok in /usr/local instead of /usr/.
Now Amarok properly compile and install, but does not start :
[mickael@Arch ~]$ amarok -d
KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work 
amarok: BEGIN: App::App() 
amarok:   BEGIN: void App::continueInit() 
amarok:     BEGIN: EngineController::EngineController() 
amarok:     END__: EngineController::EngineController() [Took: 0s] 
amarok:     BEGIN: void EngineController::initializePhonon() 
amarok(6138)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-mickael/ksycoca4"

(amarok:6138): GStreamer-CRITICAL **: gst_debug_add_log_function: assertion `func != NULL' failed
amarok:       [EngineController] Tick Interval (actual):  100 
amarok:     END__: void EngineController::initializePhonon() [Took: 0.59s] 
amarok:     BEGIN: MainWindow::MainWindow() 
amarok:       BEGIN: void CollectionManager::init() 
amarok:         [PluginManager] Plugin trader constraint:  "[X-KDE-Amarok-framework-version] == 60 and [X-KDE-Amarok-plugintype] == 'collection' and [X-KDE-Amarok-rank] > 0" 
amarok:         [CollectionManager] Received [ "8" ] collection plugin offers 
amarok:         BEGIN: void CollectionManager::loadServices(const KService::List&) 
amarok:           [CollectionManager] Initialising "mysqle-collection" 
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = amarok path = /usr/bin pid = 6138
KCrash: Arguments: /usr/bin/amarok --nocrashhandler -d 
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/mickael/.kde4/socket-ArchCyberTux/kdeinit4__0
unnamed app(6137): Communication problem with  "amarok" , it probably crashed. 
Error message was:  "org.freedesktop.DBus.Error.ServiceUnknown" : " "The name org.kde.amarok was not provided by any .service files" " 

It does the same with a clean profil (new user).
I tried to remove all the file related to amarok (locate amarok) and then I re-installed it from GIT. Same error.

Then I removed all the files (with some manually, for example /usr/lib/libamarokqtjson.so was a broken link and had not been removed) and installed the official Archlinux package, it worked perfectly. Removed it, the GIT installation still does not work. Removed the GIT installation, installed the package (=> it works fine), then install the GIT source WITH the package installed => it does not work anymore...

Is it really a bug with mysql ?

-- Backtrace (Reduced):
#6  0x00007f3667b2aec8 in handle_options () from /usr/lib/kde4/amarok_collection-mysqlecollection.so
#7  0x00007f3667adaa08 in init_common_variables() () from /usr/lib/kde4/amarok_collection-mysqlecollection.so
#8  0x00007f3667addda4 in init_embedded_server () from /usr/lib/kde4/amarok_collection-mysqlecollection.so
#9  0x00007f3667acb5a7 in MySqlEmbeddedStorage::MySqlEmbeddedStorage (this=0x1045b60, storageLocation=...) at /donnees/amarok/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.cpp:85
#10 0x00007f3667aca00f in Collections::MySqlEmbeddedCollectionFactory::init (this=0xac8b50) at /donnees/amarok/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.cpp:34
Comment 42 Myriam Schweingruber 2011-02-17 19:32:19 UTC
Well, which MySQL version are you using? If you are not running version 5.5.8 then it is unlikely.

There are also indications that this might be a problem with Gstreamer, try to change the phonon backend to VLC and see if that helps
Comment 43 Myriam Schweingruber 2011-02-21 17:57:59 UTC
*** Bug 266817 has been marked as a duplicate of this bug. ***
Comment 44 Mickaël 2011-02-24 21:12:19 UTC
Myriam : the version of my mysql package is 5.5.9-1 => It might be corrected, isn't it ?
And using Xine backend does not change anything (besides there is a crash of Phonon when switching from GStreamer to Xine...)
Comment 45 Myriam Schweingruber 2011-02-25 11:02:55 UTC
(In reply to comment #44)
> Myriam : the version of my mysql package is 5.5.9-1 => It might be corrected,
> isn't it ?

Well, apparently it is not.

> And using Xine backend does not change anything (besides there is a crash of
> Phonon when switching from GStreamer to Xine...)

Which is a known bug. Also I suggested you try the VLC backend, not the xine one...
Comment 46 Artyom Aleksyuk 2011-02-26 18:58:38 UTC
Looks like a similar problem. Mysql 5.5.9, archlinux, fresh amarok git, phonon-vlc as a backend.
Amarok-git built at 2011-February-04 works fine.
----------
Application: Amarok (amarok), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f8b52dd47a0 (LWP 9990))]

Thread 2 (Thread 0x7f8b0267d700 (LWP 9995)):
#0  0x00007f8b4d9d834c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f8b33727532 in ?? () from /usr/lib/libvlccore.so.4
#2  0x00007f8b4d9d3cb0 in start_thread () from /lib/libpthread.so.0
#3  0x00007f8b4f7e895d in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f8b52dd47a0 (LWP 9990)):
[KCrash Handler]
#6  0x00007f8b00d9c528 in handle_options () from /usr/lib/kde4/amarok_collection-mysqlecollection.so
#7  0x00007f8b00d4c068 in init_common_variables() () from /usr/lib/kde4/amarok_collection-mysqlecollection.so
#8  0x00007f8b00d4f404 in init_embedded_server () from /usr/lib/kde4/amarok_collection-mysqlecollection.so
#9  0x00007f8b00d3d065 in MySqlEmbeddedStorage::MySqlEmbeddedStorage (this=0x27f0940, storageLocation=<value optimized out>) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.cpp:85
#10 0x00007f8b00d3c272 in Collections::MySqlEmbeddedCollectionFactory::init (this=0x28433c0) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.cpp:34
#11 0x00007f8b51c5790e in CollectionManager::loadServices (this=0x288b930, services=<value optimized out>) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/core-impl/collections/support/CollectionManager.cpp:216
#12 0x00007f8b51c580a3 in CollectionManager::init (this=0x288b930) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/core-impl/collections/support/CollectionManager.cpp:195
#13 0x00007f8b51c582c6 in CollectionManager::CollectionManager (this=0x288b930) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/core-impl/collections/support/CollectionManager.cpp:117
#14 0x00007f8b51c58355 in CollectionManager::instance () at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/core-impl/collections/support/CollectionManager.cpp:94
#15 0x00007f8b51d7797b in MainWindow::MainWindow (this=0x288ac60) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/MainWindow.cpp:136
#16 0x00007f8b51d57d1a in App::continueInit (this=0x7fffa9fa3b80) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/App.cpp:623
#17 0x00007f8b51d58a39 in App::App (this=0x7fffa9fa3b80) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/App.cpp:212
#18 0x0000000000406e18 in main (argc=1, argv=0x7fffa9fa60c8) at /var/abs/local/yaourtbuild/amarok-git/src/amarok/src/main.cpp:280
Comment 47 Philipp Schmidt 2011-02-26 19:07:45 UTC
I recommend reverting to MySQL 5.1. The Upstream Bugreport apparently already has a fix, however it is not yet accepted. Let's hope they do that fast...
Comment 48 Myriam Schweingruber 2011-03-07 11:26:02 UTC
*** Bug 267409 has been marked as a duplicate of this bug. ***
Comment 49 Myriam Schweingruber 2011-03-24 08:30:19 UTC
*** Bug 269252 has been marked as a duplicate of this bug. ***
Comment 50 Myriam Schweingruber 2011-05-04 17:16:08 UTC
*** Bug 272432 has been marked as a duplicate of this bug. ***