Bug 497166

Summary: Repeatable crash when connecting Android device and clicking on it in Dolphin
Product: [Applications] dolphin Reporter: Parag W <parag.lkml>
Component: searchAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: crash CC: kdedev, kfm-devel
Priority: NOR    
Version: git-master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Parag W 2024-12-07 15:26:23 UTC
SUMMARY
Connect a Android device using USB/C - stock Pixel 9 with Dec updates - either click on the taskbar notification to open it in File Manager or just within Dolphin devices sidebar. Crashes. 

STEPS TO REPRODUCE
1. Connect a Android device using USB/C 
2. Either click on the taskbar notification to open it in File Manager or just within Dolphin devices sidebar.
3. No step 3

OBSERVED RESULT
Crash
EXPECTED RESULT
Display device contents.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.80
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 7900X 12-Core Processor
Memory: 61.9 GiB of RAM
Graphics Processor 1: AMD Radeon RX 7900 GRE
Graphics Processor 2: AMD Radeon Graphics

ADDITIONAL INFORMATION
Crash stacktrace
Thread 1 "dolphin" received signal SIGSEGV, Segmentation fault.
QAbstractButton::setChecked (this=0x0, checked=false)
    at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qabstractbutton.cpp:586
586	   Q_D(QAbstractButton);
(gdb) bt
#0  QAbstractButton::setChecked (this=0x0, checked=false)
    at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qabstractbutton.cpp:586
#1  0x000055555563282e in DolphinSearchBox::setSearchPath (this=0x555555e62740, url=...)
    at /data/kde/src/dolphin/src/search/dolphinsearchbox.cpp:90
#2  0x0000555555607dc0 in DolphinViewContainer::redirect (this=0x555555e89950, oldUrl=<optimized out>, newUrl=...)
    at /data/kde/src/dolphin/src/dolphinviewcontainer.cpp:900
#3  0x00007ffff4bb1b29 in QtPrivate::QSlotObjectBase::call
    (this=0x555556053cf0, r=0x555555e89950, a=0x7fffffffbdf0, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#4  doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4124
#5  0x00007ffff7f665ea in DolphinView::redirection (this=this@entry=0x555555fa7b40, _t1=..., _t2=...)
    at /fastdata/compiles/kde/build/dolphin/src/dolphinprivate_autogen/include/moc_dolphinview.cpp:1525
#6  0x00007ffff7f6a28e in DolphinView::slotDirectoryRedirection (this=0x555555fa7b40, oldUrl=..., newUrl=...)
    at /data/kde/src/dolphin/src/views/dolphinview.cpp:1730
#7  DolphinView::slotDirectoryRedirection (this=0x555555fa7b40, oldUrl=..., newUrl=...)
    at /data/kde/src/dolphin/src/views/dolphinview.cpp:1727
#8  0x00007ffff4bb1b29 in QtPrivate::QSlotObjectBase::call
    (this=0x555556064080, r=0x555555fa7b40, a=0x7fffffffbf30, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#9  doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4124
#10 0x00007ffff7ee96da in KFileItemModel::directoryRedirection (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>)
    at /fastdata/compiles/kde/build/dolphin/src/dolphinprivate_autogen/include/moc_kfileitemmodel.cpp:426
#11 0x00007ffff4bb1b29 in QtPrivate::QSlotObjectBase::call
    (this=0x555555fb1430, r=0x555555fa8390, a=0x7fffffffc030, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#12 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4124
#13 0x00007ffff76134ca in KCoreDirLister::redirection (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>)
    at /fastdata/compiles/kde/build/kio/src/core/KF6KIOCore_autogen/include/moc_kcoredirlister.cpp:515
#14 0x00007ffff76079b9 in KCoreDirListerCache::slotRedirection (this=0x555555d96740, j=0x55555627ad60, url=<optimized out>)
--Type <RET> for more, q to quit, c to continue without paging--
    at /data/kde/src/kio/src/core/kcoredirlister.cpp:1378
#15 0x00007ffff4bb1b29 in QtPrivate::QSlotObjectBase::call
    (this=0x55555614db80, r=0x555555d96740, a=0x7fffffffc310, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#16 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4124
#17 0x00007ffff75c91e7 in KIO::ListJob::redirection (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>)
    at /fastdata/compiles/kde/build/kio/src/core/KF6KIOCore_autogen/include/moc_listjob.cpp:268
#18 0x00007ffff4bb1b29 in QtPrivate::QSlotObjectBase::call
    (this=0x555556038f60, r=0x55555627ad60, a=0x7fffffffc570, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#19 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4124
#20 0x00007ffff762e960 in KIO::WorkerInterface::redirection (this=0x55555664b210, _t1=...)
    at /fastdata/compiles/kde/build/kio/src/core/KF6KIOCore_autogen/include/moc_workerinterface_p.cpp:593
#21 KIO::WorkerInterface::dispatch (this=0x55555664b210, _cmd=20, rawdata=<optimized out>)
    at /data/kde/src/kio/src/core/workerinterface.cpp:216
#22 0x00007ffff761ebc8 in KIO::WorkerInterface::dispatch (this=0x55555664b210)
    at /data/kde/src/kio/src/core/workerinterface.cpp:58
#23 0x00007ffff7620986 in KIO::Worker::gotInput (this=0x55555664b210) at /data/kde/src/kio/src/core/worker.cpp:260
#24 0x00007ffff4bb1b29 in QtPrivate::QSlotObjectBase::call
    (this=0x555555d6f7f0, r=0x55555664b210, a=0x7fffffffc728, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#25 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4124
#26 0x00007ffff4ba2d9a in QObject::event (this=0x555556720f50, e=0x55555607b7d0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1419
#27 0x00007ffff5afe78a in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x555556720f50, e=0x55555607b7d0)
    at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3296
#28 0x00007ffff4b57ac8 in QCoreApplication::notifyInternal2 (receiver=0x555556720f50, event=event@entry=0x55555607b7d0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1168
#29 0x00007ffff4b58555 in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>)
--Type <RET> for more, q to quit, c to continue without paging--
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1612
#30 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5555556c6e80)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1968
#31 0x00007ffff4dc4f7c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1800
#32 postEventSourceDispatch (s=0x5555557252b0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#33 0x00007ffff1b0d559 in g_main_dispatch (context=0x7fffe8000f30) at ../glib/glib/gmain.c:3357
#34 0x00007ffff1b70157 in g_main_context_dispatch_unlocked (context=0x7fffe8000f30) at ../glib/glib/gmain.c:4208
#35 g_main_context_iterate_unlocked.isra.0
    (context=context@entry=0x7fffe8000f30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ../glib/glib/gmain.c:4273
#36 0x00007ffff1b0ca55 in g_main_context_iteration (context=0x7fffe8000f30, may_block=1) at ../glib/glib/gmain.c:4338
#37 0x00007ffff4dc22fd in QEventDispatcherGlib::processEvents (this=0x5555556ca090, flags=...)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#38 0x00007ffff4b61ee6 in QEventLoop::processEvents (this=0x7fffffffcc70, flags=...)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:103
#39 QEventLoop::exec (this=0x7fffffffcc70, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:194
#40 0x00007ffff4b58f4f in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74
#41 0x00007ffff5afa6ba in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2564
#42 0x00005555555e9640 in main (argc=<optimized out>, argv=<optimized out>) at /data/kde/src/dolphin/src/main.cpp:275
Comment 1 Parag W 2024-12-07 15:55:10 UTC
Device is initially connected in No data transfer USB mode which I assume means there is no content to search for? I surrounded dolphinsearchbox.cpp:90 onwards with 

 } else if (m_everywhereButton != nullptr && m_fromHereButton != nullptr) {

and then it stops crashing of course and Dolphin give a Loading cancelled message. 

Changing device connection mode to File Transfer or MTP etc. continues working - I am not sure if this is a good fix though - maybe there has to be a notion of Dolphin understanding where to enable m_everywhereButton / m_fromHereButton depending on whether there's content? Not sure.
Comment 2 TraceyC 2024-12-11 22:24:06 UTC
Thank you for the bug report. Based on the backtrace, this crash seems to be bug 497021. I'm marking this as a duplicate of that one. You can follow the progress of this issue in the other report.

*** This bug has been marked as a duplicate of bug 497021 ***