Bug 431738 - Amarok sometimes crashes when searching in Collection Browser
Summary: Amarok sometimes crashes when searching in Collection Browser
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collection Browser (show other bugs)
Version: kf5
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: kf5
Assignee: Amarok Developers
URL:
Keywords: drkonqi
: 432030 478788 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-17 16:10 UTC by Matěj Laitl
Modified: 2024-04-22 15:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matěj Laitl 2021-01-17 16:10:39 UTC
Application: amarok (2.9.70)

Qt Version: 5.15.2
Frameworks Version: 5.77.0
Operating System: Linux 5.10.4-gentoo x86_64
Windowing system: X11
Distribution: Gentoo/Linux

-- Information about the crash:
- What I was doing when the application crashed:
Searching Collection Browser.

Amarok based on Qt5 / KDE Frameworks 5 compiled from sources.
Git commit 0e15bdf35d from Dec 30, 2020.

I want to eventually look into fixing this, but wanted to have a record for this in issue tracker.

The crash can be reproduced sometimes.

-- Backtrace:
Application: Amarok (amarok), signal: Segmentation fault
Content of s_kcrashErrorMessage: (null)
[KCrash Handler]
#6  0x0000000000000000 in  ()
#7  0x00007f55d2aec8b2 in Collections::SqlQueryMaker::abortQuery() (this=this@entry=0x562f340142e0) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/core-impl/collections/db/sql/SqlQueryMaker.cpp:172
#8  0x00007f55d2af23da in Collections::SqlQueryMaker::~SqlQueryMaker() (this=0x562f340142e0, __in_chrg=<optimized out>) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/core-impl/collections/db/sql/SqlQueryMaker.cpp:159
#9  0x00007f55d2af2609 in Collections::SqlQueryMaker::~SqlQueryMaker() (this=0x562f340142e0, __in_chrg=<optimized out>) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/core-impl/collections/db/sql/SqlQueryMaker.cpp:165
#10 0x00007f55ebcabc7f in QObject::event(QEvent*) (this=0x562f340142e0, e=0x562f35228770) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qobject.cpp:1301
#11 0x00007f55ec6d4d8f in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x562f33c307b0, receiver=receiver@entry=0x562f340142e0, e=e@entry=0x562f35228770) at /var/tmp/portage/dev-qt/qtwidgets-5.15.2/work/qtbase-everywhere-src-5.15.2/src/widgets/kernel/qapplication.cpp:3632
#12 0x00007f55ec6dda40 in QApplication::notify(QObject*, QEvent*) (this=0x7ffc504580b0, receiver=0x562f340142e0, e=0x562f35228770) at /var/tmp/portage/dev-qt/qtwidgets-5.15.2/work/qtbase-everywhere-src-5.15.2/src/widgets/kernel/qapplication.cpp:3156
#13 0x00007f55ebc80497 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x562f340142e0, event=0x562f35228770) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qcoreapplication.cpp:1063
#14 0x00007f55ebc82fc0 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x562f33bba8f0) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qcoreapplication.cpp:1817
#15 0x00007f55ebcd5df3 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x562f33c93f50) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qeventdispatcher_glib.cpp:277
#16 0x00007f55e7145887 in g_main_dispatch (context=0x7f55dc005000) at ../glib-2.64.5/glib/gmain.c:3309
#17 g_main_context_dispatch (context=context@entry=0x7f55dc005000) at ../glib-2.64.5/glib/gmain.c:3974
#18 0x00007f55e7145b10 in g_main_context_iterate (context=context@entry=0x7f55dc005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.64.5/glib/gmain.c:4047
#19 0x00007f55e7145b9f in g_main_context_iteration (context=0x7f55dc005000, may_block=may_block@entry=1) at ../glib-2.64.5/glib/gmain.c:4108
#20 0x00007f55ebcd5b9d in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x562f33ca5730, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qeventdispatcher_glib.cpp:423
#21 0x00007f55ebc7f2c3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffc50457f60, flags=..., flags@entry=...) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/include/QtCore/../../src/corelib/global/qflags.h:69
#22 0x00007f55ebc87220 in QCoreApplication::exec() () at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/include/QtCore/../../src/corelib/global/qflags.h:121
#23 0x0000562f32666764 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/main.cpp:391
[Inferior 1 (process 1417290) detached]

Possible duplicates by query: bug 431077, bug 430722, bug 430698, bug 429973, bug 429643.

Reported using DrKonqi
Comment 1 Myriam Schweingruber 2021-01-26 16:18:20 UTC
*** Bug 432030 has been marked as a duplicate of this bug. ***
Comment 2 Tuomas Nurmi 2024-04-15 19:42:33 UTC
*** Bug 478788 has been marked as a duplicate of this bug. ***
Comment 3 Tuomas Nurmi 2024-04-15 19:48:29 UTC
Would be great to hear if this is reproducible in 2.9.82. I don't think I have encountered this (at least not in some years).
I can't right away recognize this as something that has been fixed, but since there have been quite a bit of different improvements all around, it could well be.
Comment 4 Tuomas Nurmi 2024-04-20 11:30:52 UTC
Okay, actually, when enabling the sql autotests on invent.kde.org pipelines, I found out that testsqlquerymaker very often crashes during TestSqlQueryMaker::testDeleteQueryMakerWithRunningQuery(). This might be related, I'll see if I can find out what's the problem there.
Comment 5 Bug Janitor Service 2024-04-21 20:01:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/amarok/-/merge_requests/90
Comment 6 Tuomas Nurmi 2024-04-22 15:13:09 UTC
Git commit e3a14e6ed3aeb0800df2a781b5c999d71e4d524c by Tuomas Nurmi.
Committed on 22/04/2024 at 14:41.
Pushed by nurmi into branch 'master'.

Avoid crash when a running SqlQueryMaker is deleted

Deletion only after a job has finished seems to prevent crashes in cases where
an already deleted job finishes and runs defaultEnd, and additionally cases
where SqlQueryMakerInternal is deleted during an sql query and it tries to emit
now deleted signals based on query results.

Also try to avoid running any further extra steps in SqlQueryMakerInternal::run if
abort has been called.

Fixes a flaky test, hopefully fixes also fixes a related bug

M  +14   -1    src/core-impl/collections/db/sql/SqlQueryMaker.cpp
M  +13   -2    src/core-impl/collections/db/sql/SqlQueryMakerInternal.cpp
M  +2    -0    src/core-impl/collections/db/sql/SqlQueryMakerInternal.h

https://invent.kde.org/multimedia/amarok/-/commit/e3a14e6ed3aeb0800df2a781b5c999d71e4d524c