Bug 390690 - Crash using contextual "Compress to" option
Summary: Crash using contextual "Compress to" option
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (other bugs)
Version First Reported In: 17.12.2
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2018-02-18 17:11 UTC by Edmund Kasprzak
Modified: 2018-02-18 22:34 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edmund Kasprzak 2018-02-18 17:11:06 UTC
Application: ark (17.12.2)

Qt Version: 5.9.3
Frameworks Version: 5.43.0
Operating System: Linux 4.13.0-32-generic x86_64
Distribution: KDE neon Developer Edition

-- Information about the crash:
- What I was doing when the application crashed:
1. Open folder (dolphin)
2. Right click on any file --> compress --> compress to
3. crash happens

- Custom settings of the application:
It happens only if none if the "main" plugins is not enabled.
From my testing it looks like "main" plugins are:
info-zip, libarchive, libzip, p7zip, rar, unarchiver.

So, if all of the other are enabled (bzip2, gzip, libarchive-read only), lzma) then issue appears.
From my understanding Ark can compress using only these "main" plugins.
What I would expect in this situation is some error message like "none of the required plugins is enabled/installed" instead of crash.

The crash can be reproduced every time.

-- Backtrace:
Application: Ark (ark), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fce8855e8c0 (LWP 5771))]

Thread 5 (Thread 0x7fce65ccd700 (LWP 5775)):
#0  0x00007fce8472227d in read () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fce7eeb76f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fce7ee73e74 in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fce7ee74330 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fce7ee7449c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fce8504d6cb in QEventDispatcherGlib::processEvents (this=0x7fce600008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#6  0x00007fce84ff5e2a in QEventLoop::exec (this=this@entry=0x7fce65ccccd0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#7  0x00007fce84e1e8f4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#8  0x00007fce8240e315 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#9  0x00007fce84e23709 in QThreadPrivate::start (arg=0x7fce82682d40) at thread/qthread_unix.cpp:368
#10 0x00007fce808a86ba in start_thread (arg=0x7fce65ccd700) at pthread_create.c:333
#11 0x00007fce8473241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7fce66b9e700 (LWP 5774)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fce6c188893 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007fce6c1886f7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007fce808a86ba in start_thread (arg=0x7fce66b9e700) at pthread_create.c:333
#4  0x00007fce8473241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fce6739f700 (LWP 5773)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fce6c188893 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007fce6c1886f7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007fce808a86ba in start_thread (arg=0x7fce6739f700) at pthread_create.c:333
#4  0x00007fce8473241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fce75766700 (LWP 5772)):
#0  0x00007fce8472674d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fce7e055c62 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007fce7e0578d7 in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fce77cbd1f9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007fce84e23709 in QThreadPrivate::start (arg=0xcadd60) at thread/qthread_unix.cpp:368
#5  0x00007fce808a86ba in start_thread (arg=0x7fce75766700) at pthread_create.c:333
#6  0x00007fce8473241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7fce8855e8c0 (LWP 5771)):
[KCrash Handler]
#6  QString::toLatin1_helper (string=...) at tools/qstring.cpp:4551
#7  0x00007fce85087128 in QString::toLatin1() const & (this=0x7fce850e3168 <QListData::shared_null+8>) at ../../include/QtCore/../../src/corelib/tools/qstring.h:512
#8  QMimeBinaryProvider::resolveAlias (this=0xfb5bc0, name=...) at mimetypes/qmimeprovider.cpp:479
#9  0x00007fce85075077 in QMimeDatabasePrivate::mimeTypeForName (nameOrAlias=..., this=<optimized out>) at mimetypes/qmimedatabase.cpp:108
#10 QMimeDatabase::mimeTypeForName (this=this@entry=0x7fff3ca39420, nameOrAlias=...) at mimetypes/qmimedatabase.cpp:327
#11 0x00007fce881d2063 in Kerfuffle::CreateDialog::currentMimeType (this=this@entry=0xf73fe0) at /workspace/build/kerfuffle/createdialog.cpp:233
#12 0x00007fce881d3420 in Kerfuffle::CreateDialog::CreateDialog (this=0xf73fe0, parent=<optimized out>, caption=..., startDir=...) at /workspace/build/kerfuffle/createdialog.cpp:97
#13 0x00007fce881e1e8c in Kerfuffle::AddToArchive::showAddDialog (this=this@entry=0xf77260) at /workspace/build/kerfuffle/addtoarchive.cpp:98
#14 0x000000000040cc2c in main (argc=5, argv=<optimized out>) at /workspace/build/app/main.cpp:258

Reported using DrKonqi
Comment 1 Elvis Angelaccio 2018-02-18 18:08:32 UTC
Ooops. 
For the record, the "main" plugins are the read-write ones, i.e. the plugins that can create new archives.
Comment 2 Elvis Angelaccio 2018-02-18 22:34:14 UTC
Git commit 2af8d35e362ba07d213855019a614a0c3d86a889 by Elvis Angelaccio.
Committed on 18/02/2018 at 22:31.
Pushed by elvisangelaccio into branch 'Applications/17.12'.

Stop crashing when all read-write plugins are disabled

CreateDialog assumes that `m_supportedMimeTypes` is never empty, it will crash otherwise.

If that's the case (i.e. when all the read-write plugins have been disabled),
we just disable the Compress menu item and the New action (as the
CreateDialog would just be useless).

For the New action, we also need to check whether the settings have been
changed and update its enabled status accordingly.
FIXED-IN: 17.12.3

M  +1    -5    app/compressfileitemaction.cpp
M  +5    -1    app/mainwindow.cpp

https://commits.kde.org/ark/2af8d35e362ba07d213855019a614a0c3d86a889