Bug 298425 - Amarok crashes if it can not find mysql server
Summary: Amarok crashes if it can not find mysql server
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.5.0
Platform: Ubuntu Linux
: HI crash
Target Milestone: 2.6
Assignee: Amarok Developers
: 300152 300191 (view as bug list)
Depends on:
Reported: 2012-04-19 16:33 UTC by Yurii Kolesnykov
Modified: 2012-08-08 12:55 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.6


Note You need to log in before you can comment on or make changes to this bug.
Description Yurii Kolesnykov 2012-04-19 16:33:40 UTC
Application: amarok (2.5.0)
KDE Platform Version: 4.8.2 (4.8.2)
Qt Version: 4.8.1
Operating System: Linux 3.2.0-23-generic x86_64
Distribution: Ubuntu 12.04 LTS

-- Information about the crash:
- What I was doing when the application crashed:
Reinstall Linux, saving old /home partition
- Custom settings of the application:
Amarok was configured to use external MySQL db

The crash can be reproduced every time.

-- Backtrace:
Application: Amarok (amarok), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f2842abf7c0 (LWP 6114))]

Thread 3 (Thread 0x7f281f397700 (LWP 6209)):
#0  0x00007f283f3aeb03 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f283781135f in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#2  0x00007f283780276c in pa_mainloop_poll () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#3  0x00007f2837802dd9 in pa_mainloop_iterate () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007f2837802e90 in pa_mainloop_run () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007f283781130f in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007f2832c56d18 in ?? () from /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#7  0x00007f28310cfb74 in ?? () from /usr/lib/nvidia-current/libGL.so.1
#8  0x00007f283bad1e9a in start_thread (arg=0x7f281f397700) at pthread_create.c:308
#9  0x00007f283f3ba4bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f28120cb700 (LWP 6487)):
[KCrash Handler]
#6  0x00007f281331463b in DirWatchJob::run (this=0x2323cf0) at ../../../../../../src/core-impl/collections/db/ScanManager.cpp:372
#7  0x00007f283d06705b in ThreadWeaver::JobRunHelper::runTheJob (this=0x7f28120caca0, th=0x24db5a0, job=0x2323cf0) at ../../../threadweaver/Weaver/Job.cpp:106
#8  0x00007f283d0671cc in ThreadWeaver::Job::execute (this=0x2323cf0, th=0x24db5a0) at ../../../threadweaver/Weaver/Job.cpp:135
#9  0x00007f283d06681f in ThreadWeaver::ThreadRunHelper::run (this=0x7f28120cad20, parent=0x24cf6d0, th=0x24db5a0) at ../../../threadweaver/Weaver/Thread.cpp:95
#10 0x00007f283d0668db in ThreadWeaver::Thread::run (this=0x24db5a0) at ../../../threadweaver/Weaver/Thread.cpp:142
#11 0x00007f283fc16fcb in QThreadPrivate::start (arg=0x24db5a0) at thread/qthread_unix.cpp:298
#12 0x00007f28310cfb74 in ?? () from /usr/lib/nvidia-current/libGL.so.1
#13 0x00007f283bad1e9a in start_thread (arg=0x7f28120cb700) at pthread_create.c:308
#14 0x00007f283f3ba4bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#15 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f2842abf7c0 (LWP 6114)):
#0  0x00007f283f3ad0bd in read () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f28310ce0bc in ?? () from /usr/lib/nvidia-current/libGL.so.1
#2  0x00007f28300f6b27 in ?? () from /usr/lib/nvidia-current/tls/libnvidia-tls.so.295.40
#3  0x00007f2839fee88f in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f2839fb3abd in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f2839fb3f96 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f2839fb4124 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f283fd453bf in QEventDispatcherGlib::processEvents (this=0x1ab5ad0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#8  0x00007f28407b2d6e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#9  0x00007f283fd14c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#10 0x00007f283fd14ed7 in QEventLoop::exec (this=0x7fff1bbb5930, flags=...) at kernel/qeventloop.cpp:204
#11 0x00007f2840bda946 in QDialog::exec (this=0x2319bd0) at dialogs/qdialog.cpp:554
#12 0x00007f284241468a in KMessageBox::createKMessageBox (dialog=<optimized out>, icon=..., text=..., strlist=..., ask=..., checkboxReturn=0x0, options=..., details=..., notifyType=QMessageBox::Critical) at ../../kdeui/dialogs/kmessagebox.cpp:344
#13 0x00007f2842414e64 in KMessageBox::createKMessageBox (dialog=0x2319bd0, icon=QMessageBox::Critical, text=..., strlist=..., ask=..., checkboxReturn=0x0, options=..., details=...) at ../../kdeui/dialogs/kmessagebox.cpp:159
#14 0x00007f2842415b5b in KMessageBox::errorListWId (parent_id=0, text=..., strlist=..., caption=..., options=...) at ../../kdeui/dialogs/kmessagebox.cpp:854
#15 0x00007f2842415d7b in KMessageBox::error (parent=<optimized out>, text=..., caption=..., options=...) at ../../kdeui/dialogs/kmessagebox.cpp:821
#16 0x00007f281331a74a in Collections::SqlCollection::SqlCollection (this=<optimized out>, id=..., prettyName=..., storage=0x1dda380) at ../../../../../../src/core-impl/collections/db/sql/SqlCollection.cpp:176
#17 0x00007f281331c42f in Collections::SqlCollectionFactory::createSqlCollection (this=<optimized out>, id=..., prettyName=..., storage=0x1dda380) at ../../../../../../src/core-impl/collections/db/sql/SqlCollectionFactory.cpp:31
#18 0x00007f281357c46b in Collections::MySqlServerCollectionFactory::init (this=0x2308250) at ../../../../../../../src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.cpp:41
#19 0x00007f284195c5e9 in CollectionManager::loadPlugins (this=0x1ad3590, factories=...) at ../../src/core-impl/collections/support/CollectionManager.cpp:207
#20 0x00007f284195fb84 in CollectionManager::init (this=0x1ad3590, factories=...) at ../../src/core-impl/collections/support/CollectionManager.cpp:175
#21 0x00007f2841ad5b4a in Plugins::PluginManager::init (this=0x22d3a80) at ../../src/PluginManager.cpp:82
#22 0x00007f2841ad6d69 in Plugins::PluginManager::PluginManager (this=0x22d3a80, parent=<optimized out>) at ../../src/PluginManager.cpp:64
#23 0x00007f2841ad6f37 in Plugins::PluginManager::instance () at ../../src/PluginManager.cpp:43
#24 0x00007f2841ab8b7d in pluginManager () at ../../src/PluginManager.h:76
#25 MainWindow::MainWindow (this=0x22b5d10) at ../../src/MainWindow.cpp:139
#26 0x00007f2841a90e6f in App::continueInit (this=0x7fff1bbb6da0) at ../../src/App.cpp:545
#27 0x00007f2841a9255c in App::App (this=0x7fff1bbb6da0) at ../../src/App.cpp:185
#28 0x0000000000408e45 in main (argc=3, argv=0x7fff1bbb9228) at ../../src/main.cpp:301

Possible duplicates by query: bug 295607, bug 294699, bug 289891, bug 281312.

Reported using DrKonqi
Comment 1 Yurii Kolesnykov 2012-04-19 16:48:27 UTC
Problem resolved after I installed mysql-server.
Comment 2 Myriam Schweingruber 2012-04-20 00:55:33 UTC
Well, yes, a working MySQL, either as an external server or an internal database are mandatory for Amarok to work, that is not a bug but a dependency. Please talk to your distribution, there is a packaging error somewhere as it should not be possible to have Amarok without MySQL or MySQLe
Comment 3 Yurii Kolesnykov 2012-04-20 13:08:08 UTC
Music player which requires sql server are you kidding me?
Comment 4 Jonathan Thomas 2012-04-20 13:46:28 UTC
I don't think this is a correct analysis. The packaging for Amarok already depends on the libraries required for running embedded MySQL, making it impossible for the Ubuntu Amarok package to be installed without at least MySQLe support.

The issue here is that configuration taken from a computer with a local external database and placed on a computer without the configured database set up yet. If Yuriy decided to switch to using the embedded database, this crash would not occur.

In the database configuration section of Amarok's settings, it does give the warning that Amarok expects external databases to already exist, but a case could be made that an incorrectly configured database shouldn't crash Amarok, but to instead provide an error reporting path that does not result in the immediate termination of the application.

Either way the Amarok development team chooses to look at this, the issue is either an Amarok bug or a user configuration bug, and not a packaging bug.
Comment 5 Yurii Kolesnykov 2012-04-20 14:26:48 UTC
The problem is that I can not reach settings page because amarok had crashed at start.
Comment 6 Myriam Schweingruber 2012-04-20 21:49:43 UTC
Well, you can set up a MySQL server without the configuration dialog of Amarok, please have a look at the wiki page here: http://amarok.kde.org/wiki/MySQL_Server

Jonathan: the default is MySQLe, not an external server and it doesn't need any user intervention to set it up. While I agree with you that Amarok should give a warning and close instead of crash, this is really a corner case as it is due to a user configuration bug.
Comment 7 Myriam Schweingruber 2012-05-16 18:10:35 UTC
*** Bug 300152 has been marked as a duplicate of this bug. ***
Comment 8 Myriam Schweingruber 2012-05-17 15:26:06 UTC
Changing importance, apparently the MySQL version 5.5.23 shipped by Opensuse and Debian sid doesn't provide an embedded MySQLe. This is of course a MySQL problem, but it shouldn't crash Amarok.
Comment 9 Myriam Schweingruber 2012-05-17 15:27:28 UTC
*** Bug 300191 has been marked as a duplicate of this bug. ***
Comment 10 Frederik Schwarzer 2012-05-17 16:29:19 UTC
MySQLe is provided. In Debian the package just does not create the folder /etc/mysql/conf.d/. If that folder is there, Amarok runs fine.
Comment 11 Ralf Engels 2012-08-08 12:55:38 UTC
Git commit a3d9d08eb7eee7fea7b0d5141b513d959af122f5 by Ralf Engels.
Committed on 08/08/2012 at 14:48.
Pushed by rengels into branch 'master'.

Prevent crash in case of non-working sql collection

Add some validity checks for the case where a collection is

M  +1    -0    ChangeLog
M  +21   -0    src/core-impl/collections/db/sql/SqlRegistry.cpp
M  +14   -15   src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp