Bug 387334

Summary: Crash on Open and then Save As
Product: [Applications] krita Reporter: ibbt
Component: UsabilityAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: crash CC: comicfans44, halla
Priority: NOR    
Version First Reported In: 3.3.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description ibbt 2017-11-27 00:22:15 UTC
System:
I am using Krita 3.3.2 in Arch Linux 64 bit in LxQT.
KDE Frameworks 5.40.0
Qt 5.9.3 (built against 5.9.2)
The xcb windowing system

Steps to reproduce:
- Start Krita
- Open a file
- Click File - Save as
Then it crashes. It shows the dialog outline (window borders) but not the whole window.

If I run from terminal it shows:
----
delete ProxyFolderModel
Segmentation fault (core dumped)
----

Expectation:
I expect it to show the save as dialog, and offer me to save normally.
Comment 1 Christoph Feck 2017-11-27 01:39:19 UTC
Could you try running Krita in gdb or otherwise produce a backtrace, even if incomplete (i.e. without debug symbols)?

For more information, please see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Comment 2 Halla Rempt 2017-11-27 07:31:29 UTC
This is unlikely to be a bug in Krita: we don't release a version of Krita that cannot open or save files. It must be a problem with the archlinux installation. 
A backtrace could possibly help figure out what is wrong there. Without more information, it's impossible to help you.
Comment 3 ibbt 2017-11-28 05:54:10 UTC
@Christoph Feck
Thanks. But I see this in the article:
> Arch
> Arch currently doesn't offer debug packages with symbols (Feature Request). You therefore need to recompile all concerned packages with debugging symbols. See their informative document Getting Traces. 

So, I would need to recompile from source with debugging symbols.
Unfortunately, I am not that good with compiling.

@Boudewijn Rempt
I am sure that you take care of this. But it was working with the previous version. I just updated and I noticed this issue.
Comment 4 Halla Rempt 2017-11-28 06:51:17 UTC
If you're not that good with compiling, you probably should not be using Arch Linux. Arch Linux is a distribution for people who know what they're doing or are eager to learn. You can try to report this issue to Arch, and someone from that community might be able to help you, but it's a distribution issue.
Comment 5 comicfans44 2018-01-03 16:39:28 UTC
I've confirmed this bug , seems it's triggered by lxqt customized qt plugin

a lxqt filedialog (as LXQtFileDialogHelper member) is created as following steps:

create
0x00007fffdcef400c in LXQtFileDialogHelper::LXQtFileDialogHelper() (this=0x6040002b1d10)
    at /srv/nfs4/working/lxqt-qtplugin/src/lxqt-qtplugin-0.12.0/src/lxqtfiledialoghelper.cpp:22
#1  0x00007fffdcef5365 in non-virtual thunk to LXQtPlatformTheme::createPlatformDialogHelper(QPlatformTheme::DialogType) const ()
    at /usr/include/qt/QtCore/qcoreapplication.h:116
#2  0x00007ffff54a7b20 in QDialogPrivate::platformHelper() const () at /usr/lib/libQt5Widgets.so.5
#3  0x00007ffff54ba3fd in QFileDialogPrivate::init(QUrl const&, QString const&, QString const&) () at /usr/lib/libQt5Widgets.so.5
#4  0x00007ffff54ba822 in QFileDialog::QFileDialog(QWidget*, QString const&, QString const&, QString const&) () at /usr/lib/libQt5Widgets.so.5
#5  0x00007ffff5e7e46c in KoFileDialog::createFileDialog() () at /usr/lib/libkritawidgetutils.so.18
#6  0x00007ffff5e7efd7 in KoFileDialog::filename() () at /usr/lib/libkritawidgetutils.so.18
#7  0x00007ffff692592a in KisMainWindow::saveDocument(KisDocument*, bool, bool, int) () at /usr/lib/libkritaui.so.18




but when save as triggered, it's deleted during QFileDialog::setOptions

#0  0x00007fffdceecec0 in LXQtFileDialogHelper::~LXQtFileDialogHelper() (this=0x6040002b1d10)
    at /srv/nfs4/working/lxqt-qtplugin/src/lxqt-qtplugin-0.12.0/src/lxqtfiledialoghelper.cpp:39
#1  0x00007ffff54a7dc6 in QDialogPrivate::deletePlatformHelper() () at /usr/lib/libQt5Widgets.so.5
#2  0x00007ffff54b9b19 in  () at /usr/lib/libQt5Widgets.so.5
#3  0x00007ffff54b9d69 in QFileDialog::setOptions(QFlags<QFileDialog::Option>) () at /usr/lib/libQt5Widgets.so.5
#4  0x00007ffff5e7e603 in KoFileDialog::createFileDialog() () at /usr/lib/libkritawidgetutils.so.18
#5  0x00007ffff5e7efd7 in KoFileDialog::filename() () at /usr/lib/libkritawidgetutils.so.18
#6  0x00007ffff692592a in KisMainWindow::saveDocument(KisDocument*, bool, bool, int) () at /usr/lib/libkritaui.so.18


after this, Krita called dialog exec
QString KoFileDialog::filename()
{
    QString url;
    createFileDialog();  --- > already deleted lxqt FileDialog
    if (d->fileDialog->exec() == 

and exec triggered the already-destructed lxqt FileDialog's timer slot 

#0 0x7fffdc77aaa6 in operator() /home/comicfans/working/pacman/src/libfm-qt-0.12.0/src/filedialog.cpp:425
    #1 0x7fffdc77aaa6 in call /usr/include/qt/QtCore/qobjectdefs_impl.h:130
    #2 0x7fffdc77aaa6 in call /usr/include/qt/QtCore/qobjectdefs_impl.h:240
    #3 0x7fffdc77aaa6 in QtPrivate::QFunctorSlotObject<Fm::FileDialog::selectFilePathWithDelay(Fm::FilePath const&)::{lambda()#1}, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) [clone .lto_priv.363] /usr/include/qt/QtCore/qobjectdefs_impl.h:423
    #4 0x7ffff4574a03  (/usr/lib/libQt5Core.so.5+0x2d9a03)
    #5 0x7ffff456840a in QObject::event(QEvent*) (/usr/lib/libQt5Core.so.5+0x2cd40a)
    #6 0x7ffff52b1e3b in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib/libQt5Widgets.so.5+0x151e3b)
    #7 0x7ffff52b9815 in QApplication::notify(QObject*, QEvent*) (/usr/lib/libQt5Widgets.so.5+0x159815)
    #8 0x7ffff68ead97 in KisApplication::notify(QObject*, QEvent*) (/usr/lib/libkritaui.so.18+0x57ed97)
    #9 0x7ffff45371df in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/lib/libQt5Core.so.5+0x29c1df)
    #10 0x7ffff4592ad7 in QTimerInfoList::activateTimers() (/usr/lib/libQt5Core.so.5+0x2f7ad7)
    #11 0x7ffff45932d1  (/usr/lib/libQt5Core.so.5+0x2f82d1)
    #12 0x7fffebb0c26f in g_main_context_dispatch (/usr/lib/libglib-2.0.so.0+0x6b26f)
    #13 0x7fffebb0df68  (/usr/lib/libglib-2.0.so.0+0x6cf68)
    #14 0x7fffebb0dfad in g_main_context_iteration (/usr/lib/libglib-2.0.so.0+0x6cfad)
    #15 0x7ffff4593690 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt5Core.so.5+0x2f8690)
    #16 0x7fffe0b46281  (/usr/lib/libQt5XcbQpa.so.5+0xc5281)
    #17 0x7ffff453582a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt5Core.so.5+0x29a82a)
    #18 0x7ffff54a8dca in QDialog::exec() (/usr/lib/libQt5Widgets.so.5+0x348dca)
    #19 0x7ffff5e7efe8 in KoFileDialog::filename() (/usr/lib/libkritawidgetutils.so.18+0x61fe8)
    #20 0x7ffff6925929 in KisMainWindow::saveDocument(KisDocument*, bool, bool, int) (/usr/lib/libkritaui.so.18+0x5b9929)
    #21 0x7ffff6926d45 in KisMainWindow::slotFileSaveAs() (/usr/lib/libkritaui.so.18+0x5bad45)
    #22 0x7ffff692b706  (/usr/lib/libkritaui.so.18+0x5bf706)

this leads crash. 

lxqt connect this callback as:

    QTimer::singleShot(0, [this, path]() {
       ...
seems Qt only disconnect this after control flow return to main loop. manually call processEvents can workaround this. should this addressed by Krita, or lxqt, or Qt itself?
Comment 6 Halla Rempt 2018-01-03 19:16:25 UTC
lxqt definitely. In Krita, you can probably avoid the crash by disabling native file dialogs in the settings.