Bug 481488

Summary: Plasmashell crashes when attempting to use Open With -> Other Application... through the notification
Product: [Plasma] plasmashell Reporter: Antti Savolainen <antti.savo>
Component: NotificationsAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: bugseforuns, contact+bugs.kde.org, kde, nicolas.fella, shubhamarora
Priority: NOR Keywords: qt6
Version First Reported In: 5.93.0   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Backtrace

Description Antti Savolainen 2024-02-17 22:14:45 UTC
Created attachment 165915 [details]
Backtrace

SUMMARY
Demonstrative video: https://www.youtube.com/watch?v=0HJM3DJaI18
When attempting to change the application that a file is opened in, through the notification, plasmashell crashes

STEPS TO REPRODUCE
1. Download the file from https://bugs.kde.org/show_bug.cgi?id=467117 for example
2. Attempt to change the program that the file is opened in

OBSERVED RESULT
Plasmashell crashes

EXPECTED RESULT
No crash should happen

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7
Comment 1 Nicolas Fella 2024-02-19 08:32:31 UTC
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007bf27e2ab393 in __pthread_kill_internal (signo=11, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007bf27e25a6c8 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#3  0x00007bf2811e844f in KCrash::defaultCrashHandler (sig=11) at /usr/src/debug/kcrash/kcrash-5.249.0/src/kcrash.cpp:586
#4  0x00007bf27e25a770 in <signal handler called> () at /usr/lib/libc.so.6
#5  0x00007bf280934260 in QWidget::window (this=this@entry=0x64464ebdf420) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/widgets/kernel/qwidget.cpp:4301
#6  0x00007bf279934221 in KIOOpenWith::promptUserForApplication (this=0x64464f702090, job=<optimized out>, urls=..., mimeType=<optimized out>) at /usr/src/debug/plasma-integration/plasma-integration-5.93.0/qt6/src/platformtheme/kdeplatformtheme.cpp:109
#7  0x00007bf27e996dd9 in QtPrivate::QSlotObjectBase::call (a=0x7ffc996e9a60, r=0x64464bb6a6f0, this=0x64464f641720, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobjectdefs_impl.h:469
#8  doActivate<false> (sender=0x64464f642340, signal_index=6, argv=0x7ffc996e9a60) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobject.cpp:4060
#9  0x00007bf27f934bda in KJob::result (this=this@entry=0x64464f642340, _t1=<optimized out>, _t1@entry=0x64464f642340, _t2=...) at /usr/src/debug/kcoreaddons/build/src/lib/KF6CoreAddons_autogen/include/moc_kjob.cpp:622
#10 0x00007bf27f93710c in KJob::finishJob (this=0x64464f642340, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons/kcoreaddons-5.249.0/src/lib/jobs/kjob.cpp:98
#11 0x00007bf27f9371f2 in KJob::emitResult (this=<optimized out>) at /usr/src/debug/kcoreaddons/kcoreaddons-5.249.0/src/lib/jobs/kjob.cpp:329
#12 0x00007bf27e13dc7a in operator() (__closure=0x64464f704c80) at /usr/src/debug/kio/kio-5.249.0/src/core/mimetypefinderjob.cpp:162
#13 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KIO::MimeTypeFinderJobPrivate::statFile()::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:137
#14 QtPrivate::FunctorCallable<KIO::MimeTypeFinderJobPrivate::statFile()::<lambda()> >::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:345
#15 QtPrivate::QCallableObject<KIO::MimeTypeFinderJobPrivate::statFile()::<lambda()>, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x64464f704c70, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:555
#16 0x00007bf27e996dd9 in QtPrivate::QSlotObjectBase::call (a=0x7ffc996e9c70, r=0x64464f642340, this=0x64464f704c70, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobjectdefs_impl.h:469
#17 doActivate<false> (sender=0x64464f6411a0, signal_index=6, argv=0x7ffc996e9c70) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobject.cpp:4060
#18 0x00007bf27f934bda in KJob::result (this=this@entry=0x64464f6411a0, _t1=<optimized out>, _t1@entry=0x64464f6411a0, _t2=...) at /usr/src/debug/kcoreaddons/build/src/lib/KF6CoreAddons_autogen/include/moc_kjob.cpp:622
#19 0x00007bf27f93710c in KJob::finishJob (this=0x64464f6411a0, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons/kcoreaddons-5.249.0/src/lib/jobs/kjob.cpp:98
#20 0x00007bf27e996dd9 in QtPrivate::QSlotObjectBase::call (a=0x7ffc996e9d48, r=0x64464f6411a0, this=0x64464eb4f3f0, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobjectdefs_impl.h:469
#21 doActivate<false> (sender=0x64464f2d3db0, signal_index=7, argv=0x7ffc996e9d48) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobject.cpp:4060
#22 0x00007bf27e1a5b24 in KIO::WorkerInterface::finished (this=0x64464f2d3db0) at /usr/src/debug/kio/build/src/core/KF6KIOCore_autogen/include/moc_workerinterface_p.cpp:523
#23 KIO::WorkerInterface::dispatch (this=0x64464f2d3db0, _cmd=104, rawdata=...) at /usr/src/debug/kio/kio-5.249.0/src/core/workerinterface.cpp:129
#24 0x00007bf27e195bde in KIO::WorkerInterface::dispatch (this=0x64464f2d3db0) at /usr/src/debug/kio/kio-5.249.0/src/core/workerinterface.cpp:60
#25 0x00007bf27e1985da in KIO::Worker::gotInput (this=0x64464f2d3db0) at /usr/src/debug/kio/kio-5.249.0/src/core/worker.cpp:263
#26 0x00007bf27e996dd9 in QtPrivate::QSlotObjectBase::call (a=0x7ffc996ea0d8, r=0x64464f2d3db0, this=0x64464d52e580, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobjectdefs_impl.h:469
#27 doActivate<false> (sender=0x64464cd65510, signal_index=3, argv=0x7ffc996ea0d8) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobject.cpp:4060
#28 0x00007bf27e987c64 in QObject::event (this=0x64464cd65510, e=0x64464ebce200) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qobject.cpp:1446
#29 0x00007bf2808fbf5b in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x64464cd65510, e=0x64464ebce200) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/widgets/kernel/qapplication.cpp:3298
#30 0x00007bf27e93d2c8 in QCoreApplication::notifyInternal2 (receiver=0x64464cd65510, event=event@entry=0x64464ebce200) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qcoreapplication.cpp:1134
#31 0x00007bf27e93d654 in QCoreApplication::sendEvent (event=0x64464ebce200, receiver=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qcoreapplication.cpp:1575
#32 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x64464a019ba0) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qcoreapplication.cpp:1946
#33 0x00007bf27eb860c4 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qcoreapplication.cpp:1803
#34 postEventSourceDispatch (s=0x64464a09ee20) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qeventdispatcher_glib.cpp:244
#35 0x00007bf27d58af69 in g_main_dispatch (context=0x7bf274000ef0) at ../glib/glib/gmain.c:3476
#36 0x00007bf27d5e93a7 in g_main_context_dispatch_unlocked (context=0x7bf274000ef0) at ../glib/glib/gmain.c:4284
#37 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7bf274000ef0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4349
#38 0x00007bf27d589162 in g_main_context_iteration (context=0x7bf274000ef0, may_block=1) at ../glib/glib/gmain.c:4414
#39 0x00007bf27eb83b04 in QEventDispatcherGlib::processEvents (this=0x64464a0481b0, flags=...) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qeventdispatcher_glib.cpp:394
#40 0x00007bf27e9454fe in QEventLoop::processEvents (flags=..., this=0x7ffc996ea570) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qeventloop.cpp:100
#41 QEventLoop::exec (this=0x7ffc996ea570, flags=...) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/kernel/qeventloop.cpp:182
#42 0x00007bf27e940ee8 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/corelib/global/qflags.h:74
#43 0x00007bf2808f84aa in QApplication::exec () at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta3/src/widgets/kernel/qapplication.cpp:2568
#44 0x000064464877a3e9 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/plasma-workspace/plasma-workspace-5.93.0/shell/main.cpp:214
Comment 2 duha.bugs 2024-02-19 18:12:20 UTC
*** Bug 479975 has been marked as a duplicate of this bug. ***
Comment 3 Bug Janitor Service 2024-02-19 20:24:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-integration/-/merge_requests/139
Comment 4 Nicolas Fella 2024-02-20 21:11:31 UTC
Git commit df85938437594c6feb9f2fd4292578111541a17d by Nicolas Fella.
Committed on 20/02/2024 at 21:11.
Pushed by nicolasfella into branch 'master'.

KIOOpenWith: Store parent widget in QPointer

The parent may be closed in the time between creating the KIOOpenWith and promptUserForApplication

If that happens m_parentWidget is dangling

M  +1    -1    qt6/src/platformtheme/kdeplatformtheme.cpp

https://invent.kde.org/plasma/plasma-integration/-/commit/df85938437594c6feb9f2fd4292578111541a17d
Comment 5 Nicolas Fella 2024-02-20 21:12:06 UTC
Git commit 42e595748d05a96c283f3d400781ff1cf9c540a2 by Nicolas Fella.
Committed on 20/02/2024 at 21:11.
Pushed by nicolasfella into branch 'Plasma/6.0'.

KIOOpenWith: Store parent widget in QPointer

The parent may be closed in the time between creating the KIOOpenWith and promptUserForApplication

If that happens m_parentWidget is dangling
(cherry picked from commit df85938437594c6feb9f2fd4292578111541a17d)

M  +1    -1    qt6/src/platformtheme/kdeplatformtheme.cpp

https://invent.kde.org/plasma/plasma-integration/-/commit/42e595748d05a96c283f3d400781ff1cf9c540a2