lxqt / xdg-desktop-portal-lxqt

A backend implementation for xdg-desktop-portal
GNU Lesser General Public License v2.1
22 stars 9 forks source link

File dialog segfaults when extra choice is used #18

Closed robxnano closed 8 months ago

robxnano commented 1 year ago

The QFileDialog used by xdg-desktop-portal-lxqt segfaults on close when an extra combo or check box is added to it through the portal's 'choice' option.

Affected Versions:

0.2.0 from Lubuntu 22.10, 0.3.0 from Lubuntu 22.04 backports

Steps to reproduce:

This can be reproduced using Gnome's Text Editor. apt-get install gnome-text-editor && export GDK_DEBUG=portals && gnome-text-editor In the application, click on the Open button and then the folder icon. When you click the Open button in the file dialog, xdg-desktop-portal-lxqt crashes. The application doesn't receive the details of the selected file.

Backtrace:

GNU gdb (Ubuntu 12.1-3ubuntu2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/libexec/xdg-desktop-portal-lxqt...
(No debugging symbols found in /usr/libexec/xdg-desktop-portal-lxqt)
(gdb) run
Starting program: /usr/libexec/xdg-desktop-portal-lxqt 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff2b0f6c0 (LWP 13849)]
[New Thread 0x7ffff0b116c0 (LWP 13850)]
xdp-lxqt: Desktop portal registered successfully
xdp-lxqt-file-chooser: OpenFile called with parameters:
xdp-lxqt-file-chooser:     handle:  "/org/freedesktop/portal/desktop/request/1_213/gtk356050825"
xdp-lxqt-file-chooser:     parent_window:  "x11:2c0000f"
xdp-lxqt-file-chooser:     title:  "Open Source"
xdp-lxqt-file-chooser:     options:  QMap(("accept_label", QVariant(QString, "_Open"))("choices", QVariant(QDBusArgument, ))("directory", QVariant(bool, false))("filters", QVariant(QDBusArgument, ))("modal", QVariant(bool, true))("multiple", QVariant(bool, false)))
[New Thread 0x7fffebfff6c0 (LWP 13910)]
[New Thread 0x7fffeb7fe6c0 (LWP 13911)]
[New Thread 0x7fffea3316c0 (LWP 13912)]
[New Thread 0x7fffe9b306c0 (LWP 13913)]
[New Thread 0x7fffe932f6c0 (LWP 13914)]
[Thread 0x7fffe932f6c0 (LWP 13914) exited]
[Thread 0x7fffea3316c0 (LWP 13912) exited]
[Thread 0x7fffe9b306c0 (LWP 13913) exited]
[New Thread 0x7fffe9b306c0 (LWP 13915)]
[New Thread 0x7fffe932f6c0 (LWP 13916)]
[Thread 0x7fffe932f6c0 (LWP 13916) exited]
[New Thread 0x7fffe932f6c0 (LWP 13917)]
[Thread 0x7fffe932f6c0 (LWP 13917) exited]

Thread 1 "xdg-desktop-por" received signal SIGSEGV, Segmentation fault.
0x0000555555567238 in QScopedPointerDeleter<QWidget>::cleanup(QWidget*) ()
(gdb) bt
#0  0x0000555555567238 in QScopedPointerDeleter<QWidget>::cleanup(QWidget*) ()
#1  0x0000555555563bd3 in QScopedPointer<QWidget, QScopedPointerDeleter<QWidget> >::~QScopedPointer() ()
#2  0x000055555555d56d in LXQt::FileChooserPortal::OpenFile(QDBusObjectPath const&, QString const&, QString const&, QString const&, QMap<QString, QVariant> const&, QMap<QString, QVariant>&) ()                                                                                                
#3  0x000055555555a6c7 in LXQt::FileChooserPortal::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
#4  0x000055555555a896 in LXQt::FileChooserPortal::qt_metacall(QMetaObject::Call, int, void**) ()
#5  0x00007ffff7d8323b in  () at /lib/x86_64-linux-gnu/libQt5DBus.so.5
#6  0x00007ffff7d86cf0 in  () at /lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007ffff7d876f2 in  () at /lib/x86_64-linux-gnu/libQt5DBus.so.5
#8  0x00007ffff7d89a0c in  () at /lib/x86_64-linux-gnu/libQt5DBus.so.5
#9  0x00007ffff6d49b30 in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff780cf32 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff6d1ce38 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff6d1feb1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff6d77427 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff65294f9 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff657e228 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff6526cb0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff6d76aea in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007ffff6d1b7cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007ffff6d23c2a in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x000055555556f17a in main ()
tsujan commented 1 year ago

when an extra combo or check box is added to it

Then why reporting it here? It should be reported where the code has been added.

robxnano commented 1 year ago

Well according to the backtrace, the segfault occurs here.

tsujan commented 1 year ago

~Adding any widget requires changing the code. The problem should be in the changes.~

tsujan commented 1 year ago

Oh, very sorry! I thought the report was made against LXQt file dialog (because of the title).

robxnano commented 1 year ago

Ah, I see. Sorry for the confusion!

tsujan commented 1 year ago

It was my fault; should have paid attention to the repository name.