Bug 508745 - xdg-desktop-portal-kde crashes in KFilePlacesModel::supportedSchemes when clicking OK button multiple times due to the UI briefly freezing
Summary: xdg-desktop-portal-kde crashes in KFilePlacesModel::supportedSchemes when cli...
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (other bugs)
Version First Reported In: 6.17.0
Platform: Fedora RPMs Linux
: HI crash
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: drkonqi
: 508547 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-08-26 03:19 UTC by jjj333.p.1325
Modified: 2025-08-27 18:45 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
New crash information added by DrKonqi (100.58 KB, text/plain)
2025-08-26 03:19 UTC, jjj333.p.1325
Details
Video recording from cell phone of reproduction of bug (3.79 MB, video/mp4)
2025-08-26 22:44 UTC, jjj333.p.1325
Details
the file used to reproduce, signal-2025-08-25-161600.jpeg (388.68 KB, image/jpeg)
2025-08-26 22:47 UTC, jjj333.p.1325
Details
Portal crash when selecting save location in signal desktop flatpak (60.40 KB, text/vnd.kde.kcrash-report)
2025-08-27 01:11 UTC, jjj333.p.1325
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jjj333.p.1325 2025-08-26 03:19:43 UTC
Application: xdg-desktop-portal-kde (6.4.4)

ApplicationNotResponding [ANR]: false
Qt Version: 6.9.1
Frameworks Version: 6.17.0
Operating System: Linux 6.15.10-200.fc42.x86_64 x86_64
Windowing System: Wayland
Distribution: "Fedora Linux 42 (KDE Plasma Desktop Edition)"
DrKonqi: 6.4.4 [CoredumpBackend]

-- Information about the crash:
- selecting file in /tmp that showed up after the portal was opened
- application has access to /tmp and correctly got the selection (and was able to read the file)
- i could not screen record this as it crashes the portal that obs uses to record screen, i have attached a phone recording
- I clicked the okay button a couple times (i think it lagged a slight bit) which may have triggered some sort of race condition with it exiting
- if it is relevant, the application opening the portal was the gajim 1.9.5 flatpak version

i accidentally clicked that i cannot reproduce, however i can with this specific file for some reason.
- file is https://mega.nz/file/tYAjVZ4L#PZU0HVBoiSPE6FdDMoxjY1gtilrsAyJ1JyVA6jMo-TQ with filename signal-2025-08-25-161600.jpeg 
- recording of repro: https://mega.nz/file/FQ42HJqa#EgWr-ELZ130QVxY9SCabnrw7KkCVWecxxFL3D2Co8LA
- it sounds like i single clicked, but i double clicked really fast, this is important as it doesnt crash without double clicking

I can reproduce, i just misclicked and dont know how to change what it says below this

The crash does not seem to be reproducible.

-- Backtrace (Reduced):
#5  0x00007facaf933a8b in QArrayDataPointer<QString>::QArrayDataPointer (this=0x7ffdc44cbb70, other=...) at /usr/include/qt6/QtCore/qarraydatapointer.h:38
#6  QList<QString>::QList (this=0x7ffdc44cbb70, this=<optimized out>) at /usr/include/qt6/QtCore/qlist.h:76
#7  KFilePlacesModel::supportedSchemes (this=0x56191bd1e950) at /usr/src/debug/kf6-kio-6.17.0-1.fc42.x86_64/src/filewidgets/kfileplacesmodel.cpp:1536
#8  0x00007facaf915985 in KFileWidget::slotOk (this=<optimized out>) at /usr/include/c++/15/bits/unique_ptr.h:193
#9  0x00007facac5657ba in QtPrivate::QSlotObjectBase::call (this=0x56191c044b10, r=0x56191c023d40, a=0x7ffdc44cbd50) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobjectdefs_impl.h:461
#10 doActivate<false> (sender=0x56191c053d40, signal_index=9, argv=argv@entry=0x7ffdc44cbd50) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobject.cpp:4146
[...]
#13 QAbstractButton::clicked (this=this@entry=0x56191c053d40, _t1=<optimized out>) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/redhat-linux-build/src/widgets/Widgets_autogen/include/moc_qabstractbutton.cpp:252
#14 0x00007facad989043 in QAbstractButtonPrivate::emitClicked (this=0x56191be0f5c0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/widgets/qabstractbutton.cpp:381
#15 0x00007facad98a743 in QAbstractButtonPrivate::click (this=0x56191be0f5c0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/widgets/qabstractbutton.cpp:374
#16 0x00007facad98a96d in QAbstractButton::mouseReleaseEvent (this=0x56191c053d40, e=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/widgets/qabstractbutton.cpp:976
#17 0x00007facad8a6908 in QWidget::event (this=0x56191c053d40, event=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qwidget.cpp:9367
#18 0x00007facad83d97f in QApplicationPrivate::notify_helper (this=this@entry=0x56191b990020, receiver=receiver@entry=0x56191c053d40, e=e@entry=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qapplication.cpp:3303
#19 0x00007facad848593 in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qapplication.cpp:2780
#20 0x00007facac4f9f38 in QCoreApplication::notifyInternal2 (receiver=0x56191c053d40, event=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qcoreapplication.cpp:1106
#21 0x00007facac4fa1ad in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qcoreapplication.cpp:1560
#22 0x00007facad846e29 in QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x56191c053d40, event=event@entry=0x7ffdc44cc380, alienWidget=<optimized out>, nativeWidget=nativeWidget@entry=0x56191c369710, buttonDown=buttonDown@entry=0x7facadfeb9d0 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qapplication.cpp:2361


Reported using DrKonqi
Comment 1 jjj333.p.1325 2025-08-26 03:19:47 UTC
Created attachment 184446 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 TraceyC 2025-08-26 19:25:26 UTC
Searchable backtrace


Thread 1 (Thread 0x7faca6b7cdc0 (LWP 3559)):
[KCrash Handler]
#5  0x00007facaf933a8b in QArrayDataPointer<QString>::QArrayDataPointer (this=0x7ffdc44cbb70, other=...) at /usr/include/qt6/QtCore/qarraydatapointer.h:38
#6  QList<QString>::QList (this=0x7ffdc44cbb70, this=<optimized out>) at /usr/include/qt6/QtCore/qlist.h:76
#7  KFilePlacesModel::supportedSchemes (this=0x56191bd1e950) at /usr/src/debug/kf6-kio-6.17.0-1.fc42.x86_64/src/filewidgets/kfileplacesmodel.cpp:1536
#8  0x00007facaf915985 in KFileWidget::slotOk (this=<optimized out>) at /usr/include/c++/15/bits/unique_ptr.h:193
#9  0x00007facac5657ba in QtPrivate::QSlotObjectBase::call (this=0x56191c044b10, r=0x56191c023d40, a=0x7ffdc44cbd50) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobjectdefs_impl.h:461
#10 doActivate<false> (sender=0x56191c053d40, signal_index=9, argv=argv@entry=0x7ffdc44cbd50) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobject.cpp:4146
#11 0x00007facac55c089 in QMetaObject::activate (sender=sender@entry=0x56191c053d40, m=m@entry=0x7facadfa7f20, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7ffdc44cbd50) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobject.cpp:4206
#12 0x00007facad988dba in QMetaObject::activate<void, bool> (sender=0x56191c053d40, mo=0x7facadfa7f20, local_signal_index=2, ret=0x0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobjectdefs.h:306
#13 QAbstractButton::clicked (this=this@entry=0x56191c053d40, _t1=<optimized out>) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/redhat-linux-build/src/widgets/Widgets_autogen/include/moc_qabstractbutton.cpp:252
#14 0x00007facad989043 in QAbstractButtonPrivate::emitClicked (this=0x56191be0f5c0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/widgets/qabstractbutton.cpp:381
#15 0x00007facad98a743 in QAbstractButtonPrivate::click (this=0x56191be0f5c0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/widgets/qabstractbutton.cpp:374
#16 0x00007facad98a96d in QAbstractButton::mouseReleaseEvent (this=0x56191c053d40, e=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/widgets/qabstractbutton.cpp:976
#17 0x00007facad8a6908 in QWidget::event (this=0x56191c053d40, event=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qwidget.cpp:9367
#18 0x00007facad83d97f in QApplicationPrivate::notify_helper (this=this@entry=0x56191b990020, receiver=receiver@entry=0x56191c053d40, e=e@entry=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qapplication.cpp:3303
#19 0x00007facad848593 in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qapplication.cpp:2780
#20 0x00007facac4f9f38 in QCoreApplication::notifyInternal2 (receiver=0x56191c053d40, event=0x7ffdc44cc380) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qcoreapplication.cpp:1106
#21 0x00007facac4fa1ad in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qcoreapplication.cpp:1560
#22 0x00007facad846e29 in QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x56191c053d40, event=event@entry=0x7ffdc44cc380, alienWidget=<optimized out>, nativeWidget=nativeWidget@entry=0x56191c369710, buttonDown=buttonDown@entry=0x7facadfeb9d0 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qapplication.cpp:2361
#23 0x00007facad8bc3b5 in QWidgetWindow::handleMouseEvent (this=0x56191be2a100, event=0x7ffdc44cc610) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qwidgetwindow.cpp:669
#24 0x00007facad8beeb3 in QWidgetWindow::event (this=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qwidgetwindow.cpp:292
#25 0x00007facad83d97f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x56191be2a100, e=0x7ffdc44cc610) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qapplication.cpp:3303
#26 0x00007facac4f9f38 in QCoreApplication::notifyInternal2 (receiver=0x56191be2a100, event=0x7ffdc44cc610) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qcoreapplication.cpp:1106
#27 0x00007facac4fa1ad in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qcoreapplication.cpp:1560
#28 0x00007facaccf22a9 in QGuiApplicationPrivate::processMouseEvent (e=0x7fac8c002ff0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/gui/kernel/qguiapplication.cpp:2476
#29 0x00007facacd5c76c in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/gui/kernel/qwindowsysteminterface.cpp:1113
#30 0x00007facacd5c988 in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/gui/kernel/qwindowsysteminterface.cpp:1082
#31 0x00007facac565c5a in doActivate<false> (sender=0x56191b992bd0, signal_index=4, argv=0x7ffdc44cc8b8, argv@entry=0x0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobject.cpp:4158
#32 0x00007facac55c089 in QMetaObject::activate (sender=sender@entry=0x56191b992bd0, m=m@entry=0x7facacaa16e0 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobject.cpp:4206
#33 0x00007facac4f2cc7 in QAbstractEventDispatcher::awake (this=this@entry=0x56191b992bd0) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/redhat-linux-build/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:128
#34 0x00007facac80f9eb in QEventDispatcherGlib::processEvents (this=0x56191b992bd0, flags=...) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:406
#35 0x00007facac507b03 in QEventLoop::exec (this=this@entry=0x7ffdc44cc9f0, flags=..., flags@entry=...) at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/global/qflags.h:77
#36 0x00007facac503419 in QCoreApplication::exec () at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qcoreapplication.cpp:1449
#37 0x00007facaccddbad in QGuiApplication::exec () at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/gui/kernel/qguiapplication.cpp:1986
#38 0x00007facad83d8e9 in QApplication::exec () at /usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/widgets/kernel/qapplication.cpp:2570
#39 0x0000561907fd16fc in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/xdg-desktop-portal-kde-6.4.4-1.fc42.x86_64/src/xdg-desktop-portal-kde.cpp:68
Comment 3 TraceyC 2025-08-26 20:17:24 UTC
I'm not able to reproduce this in Plasma 6.4.4 or git-master

Testing steps:
1. Use Firefox to upload a file to my Nextcloud instance (6.4.4), or open it with Gwenview (git-master). These use the same File Open dialog
2. Select the file /tmp/signal-2025-08-25-161600.jpeg
3. Double click Open

I'll leave this open so others can try to reproduce.

Please attach the two files directly to this report. Resources on the Internet can disappear. You'll have to reduce the size of the recording.
Comment 4 Nate Graham 2025-08-26 21:32:59 UTC
*** Bug 508547 has been marked as a duplicate of this bug. ***
Comment 5 David Edmundson 2025-08-26 22:23:07 UTC
Things we know:
 - KFileWidget is alive for most of slotOk, otherwise we wouldn't get this far
 - m_model is dangling
- m_model has the same lifespan as KFileWidget

ergo KFileWidget is being deleted midway through slotOk.

That would be one of these:

        int res = statJob->exec();

this is obviously bad.

Worst case it needs a lazy QPointer guard of 'this' round every invocation.
Comment 6 jjj333.p.1325 2025-08-26 22:44:34 UTC
Created attachment 184487 [details]
Video recording from cell phone of reproduction of bug
Comment 7 jjj333.p.1325 2025-08-26 22:47:35 UTC
Created attachment 184488 [details]
the file used to reproduce, signal-2025-08-25-161600.jpeg
Comment 8 jjj333.p.1325 2025-08-26 22:47:59 UTC
(In reply to TraceyC from comment #3)
> I'm not able to reproduce this in Plasma 6.4.4 or git-master
> 
> Testing steps:
> 1. Use Firefox to upload a file to my Nextcloud instance (6.4.4), or open it
> with Gwenview (git-master). These use the same File Open dialog
> 2. Select the file /tmp/signal-2025-08-25-161600.jpeg
> 3. Double click Open
> 
> I'll leave this open so others can try to reproduce.
> 
> Please attach the two files directly to this report. Resources on the
> Internet can disappear. You'll have to reduce the size of the recording.

it may specifically need to be flatpak without filesystem access. 

I didnt know i could attach files, so i will do that now.
Comment 9 jjj333.p.1325 2025-08-27 01:10:10 UTC
I'm going to attach another drkonqui backtrace that i think may be related, i got a similar kde portals crash when selecting a save location for an image (in /tmp) for signal desktop. I cannot repro, but maybe the additional backtrace will be useful
Comment 10 jjj333.p.1325 2025-08-27 01:11:14 UTC
Created attachment 184491 [details]
Portal crash when selecting save location in signal desktop flatpak
Comment 11 TraceyC 2025-08-27 15:55:08 UTC
(In reply to jjj333.p.1325 from comment #10)
> Created attachment 184491 [details]
> Portal crash when selecting save location in signal desktop flatpak

That backtrace looks entirely different from the one originally reported. Can you please open a new bug report and attach that backtrace to it? Thanks.