Bug 450370 - Portal crashed when attaching a file to a bug report
Summary: Portal crashed when attaching a file to a bug report
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-02-16 10:49 UTC by Patrick Silva
Modified: 2022-02-21 15:53 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2022-02-16 10:49:57 UTC
Application: xdg-desktop-portal-kde (5.24.80)

Qt Version: 5.15.3
Frameworks Version: 5.91.0
Operating System: Linux 5.11.0-40-generic x86_64
Windowing System: Wayland
Distribution: KDE neon Unstable Edition
DrKonqi: 5.24.80 [CoredumpBackend]

-- Information about the crash:
- What I was doing when the application crashed:
I attached a file located on desktop to a bug report in this bug tracker and then Plasma shown a crash notification.

The crash can be reproduced every time.

-- Backtrace:
Application: Portal (xdg-desktop-portal-kde), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = 0x0}
[New LWP 32882]
[New LWP 32884]
[New LWP 32885]
[New LWP 32883]
[New LWP 36656]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/x86_64-linux-gnu/libexec/xdg-desktop-portal-kde'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __GI_raise (sig=sig@entry=11) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x7fcc11d16300 (LWP 32882))]
__preamble__

[Current thread is 1 (Thread 0x7fcc11d16300 (LWP 32882))]

Thread 5 (Thread 0x7fcc08ae8700 (LWP 36656)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x563b56971b78) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x563b56971b28, cond=0x563b56971b50) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x563b56971b50, mutex=0x563b56971b28) at pthread_cond_wait.c:647
#3  0x00007fcc08ec15eb in cnd_wait (mtx=0x563b56971b28, cond=0x563b56971b50) at ../include/c11/threads_posix.h:155
#4  util_queue_thread_func (input=input@entry=0x563b56aaaa90) at ../src/util/u_queue.c:294
#5  0x00007fcc08ec11eb in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#6  0x00007fcc15894609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fcc15a4b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fcc1132f700 (LWP 32883)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x563b566c0454) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x563b566c0400, cond=0x563b566c0428) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x563b566c0428, mutex=0x563b566c0400) at pthread_cond_wait.c:647
#3  0x00007fcc15dd16db in QWaitConditionPrivate::wait (deadline=..., this=0x563b566c0400) at thread/qwaitcondition_unix.cpp:146
#4  QWaitCondition::wait (this=this@entry=0x563b566be360, mutex=mutex@entry=0x563b566be358, deadline=...) at thread/qwaitcondition_unix.cpp:225
#5  0x00007fcc13fe893d in QtWaylandClient::EventThread::waitForReading (this=0x563b566be320) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qdeadlinetimer.h:68
#6  QtWaylandClient::EventThread::run (this=0x563b566be320) at qwaylanddisplay.cpp:206
#7  0x00007fcc15dcb543 in QThreadPrivate::start (arg=0x563b566be320) at thread/qthread_unix.cpp:331
#8  0x00007fcc15894609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00007fcc15a4b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7fcc0bfff700 (LWP 32885)):
#0  0x00007fcc15a3eaff in __GI___poll (fds=0x7fcc00004a60, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fcc1429c36e in g_main_context_poll (priority=<optimized out>, n_fds=3, fds=0x7fcc00004a60, timeout=<optimized out>, context=0x7fcc00000c20) at ../../../glib/gmain.c:4346
#2  g_main_context_iterate (context=context@entry=0x7fcc00000c20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4042
#3  0x00007fcc1429c4a3 in g_main_context_iteration (context=0x7fcc00000c20, may_block=may_block@entry=1) at ../../../glib/gmain.c:4108
#4  0x00007fcc1600c9f2 in QEventDispatcherGlib::processEvents (this=0x7fcc00000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#5  0x00007fcc15fb0c9b in QEventLoop::exec (this=this@entry=0x7fcc0bffebb0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#6  0x00007fcc15dca362 in QThread::exec (this=this@entry=0x7fcc162f2d80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#7  0x00007fcc1626ef4b in QDBusConnectionManager::run (this=0x7fcc162f2d80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:179
#8  0x00007fcc15dcb543 in QThreadPrivate::start (arg=0x7fcc162f2d80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:331
#9  0x00007fcc15894609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x00007fcc15a4b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fcc10b2e700 (LWP 32884)):
#0  0x00007fcc15a3eaff in __GI___poll (fds=fds@entry=0x7fcc10b2dbe0, nfds=nfds@entry=2, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fcc13fe8996 in poll (__timeout=-1, __nfds=2, __fds=0x7fcc10b2dbe0) at /usr/include/x86_64-linux-gnu/bits/poll2.h:46
#2  QtWaylandClient::EventThread::run (this=0x563b566bc6f0) at qwaylanddisplay.cpp:208
#3  0x00007fcc15dcb543 in QThreadPrivate::start (arg=0x563b566bc6f0) at thread/qthread_unix.cpp:331
#4  0x00007fcc15894609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#5  0x00007fcc15a4b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fcc11d16300 (LWP 32882)):
[KCrash Handler]
#3  KWayland::Client::Surface::operator wl_surface* (this=0x0) at ./src/client/surface.cpp:306
#4  0x00007fcc18329720 in KWayland::Client::XdgImportedUnstableV2::Private::setParentOf (this=0x563b5688b820, surface=<optimized out>) at ./src/client/xdgforeign_v2.cpp:280
#5  0x0000563b549ab4ff in WaylandIntegration::WaylandIntegrationPrivate::<lambda()>::operator() (__closure=0x563b56a853d0) at ./src/waylandintegration.cpp:418
#6  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, WaylandIntegration::WaylandIntegrationPrivate::setParentWindow(QWindow*, const QString&)::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#7  QtPrivate::Functor<WaylandIntegration::WaylandIntegrationPrivate::setParentWindow(QWindow*, const QString&)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#8  QtPrivate::QFunctorSlotObject<WaylandIntegration::WaylandIntegrationPrivate::setParentWindow(QWindow*, const QString&)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x563b56a853c0, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443
#9  0x00007fcc15fdfd39 in QObject::event (this=0x563b549eb560 <(anonymous namespace)::Q_QGS_globalWaylandIntegration::innerFunction()::holder>, e=0x7fcc0c005210) at kernel/qobject.cpp:1314
#10 0x00007fcc1797fdc3 in QApplicationPrivate::notify_helper (this=this@entry=0x563b566a2390, receiver=receiver@entry=0x563b549eb560 <(anonymous namespace)::Q_QGS_globalWaylandIntegration::innerFunction()::holder>, e=e@entry=0x7fcc0c005210) at kernel/qapplication.cpp:3632
#11 0x00007fcc17988bb8 in QApplication::notify (this=0x7ffd3c5a3c10, receiver=0x563b549eb560 <(anonymous namespace)::Q_QGS_globalWaylandIntegration::innerFunction()::holder>, e=0x7fcc0c005210) at kernel/qapplication.cpp:3156
#12 0x00007fcc15fb219a in QCoreApplication::notifyInternal2 (receiver=0x563b549eb560 <(anonymous namespace)::Q_QGS_globalWaylandIntegration::innerFunction()::holder>, event=0x7fcc0c005210) at ../../include/QtCore/5.15.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:332
#13 0x00007fcc15fb4aa1 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x563b566844b0) at kernel/qcoreapplication.cpp:1821
#14 0x00007fcc1600d397 in postEventSourceDispatch (s=0x563b566c0840) at kernel/qeventdispatcher_glib.cpp:277
#15 0x00007fcc1429c17d in g_main_dispatch (context=0x563b566c1830) at ../../../glib/gmain.c:3309
#16 g_main_context_dispatch (context=context@entry=0x563b566c1830) at ../../../glib/gmain.c:3974
#17 0x00007fcc1429c400 in g_main_context_iterate (context=context@entry=0x563b566c1830, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4047
#18 0x00007fcc1429c4a3 in g_main_context_iteration (context=0x563b566c1830, may_block=may_block@entry=1) at ../../../glib/gmain.c:4108
#19 0x00007fcc1600c9f2 in QEventDispatcherGlib::processEvents (this=0x563b566be2e0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#20 0x00007fcc15fb0c9b in QEventLoop::exec (this=this@entry=0x7ffd3c5a3b80, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#21 0x00007fcc15fb8e44 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#22 0x0000563b5492f879 in main (argc=<optimized out>, argv=<optimized out>) at ./src/xdg-desktop-portal-kde.cpp:46

Reported using DrKonqi
Comment 1 Jan Grulich 2022-02-16 10:57:14 UTC
Possibly caused by https://bugs.kde.org/show_bug.cgi?id=450370.
Comment 2 Patrick Silva 2022-02-16 12:42:05 UTC
you posted the link to this report.
Comment 3 Jan Grulich 2022-02-16 12:45:15 UTC
Right, sorry for that. I meant https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/73.
Comment 4 Bug Janitor Service 2022-02-16 15:46:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/74
Comment 5 David Redondo 2022-02-16 19:16:46 UTC
Git commit 2982c7a8e18a09c919dbbb81126eae8fcac6f03f by David Redondo.
Committed on 16/02/2022 at 15:46.
Pushed by ngraham into branch 'master'.

Always show dialog before calling setParentWindow

Instead of having a dodgy connection that relies on timing behavior,
make sure the dialog is visible. A warning is printed if it is not
visible so we know there is a non working case and can fix it.

M  +1    -0    src/access.cpp
M  +2    -0    src/account.cpp
M  +2    -0    src/appchooser.cpp
M  +3    -0    src/filechooser.cpp
M  +1    -0    src/print.cpp
M  +2    -0    src/remotedesktop.cpp
M  +2    -0    src/screencast.cpp
M  +1    -0    src/screenshot.cpp
M  +5    -13   src/waylandintegration.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/2982c7a8e18a09c919dbbb81126eae8fcac6f03f
Comment 6 Bug Janitor Service 2022-02-17 01:10:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/75
Comment 7 Aleix Pol 2022-02-21 15:53:01 UTC
Git commit 7f767ac1efccd162d98fc56fc5462074f6fcb471 by Aleix Pol.
Committed on 21/02/2022 at 14:14.
Pushed by apol into branch 'master'.

wayland: Wait for the Expose signal to set properties on wl_surfaces

M  +18   -11   src/waylandintegration.cpp
M  +2    -0    src/waylandintegration_p.h

https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/7f767ac1efccd162d98fc56fc5462074f6fcb471