Bug 381606 - Kwrite crashes upon close
Summary: Kwrite crashes upon close
Status: RESOLVED UPSTREAM
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: 16.12
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2017-06-24 14:28 UTC by Giampaolo
Modified: 2017-07-09 12:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KWrite console output - crash on exit (36.45 KB, text/plain)
2017-07-06 13:40 UTC, Itzik Ephraim
Details
KWrite console output - normal exit (10.82 KB, text/plain)
2017-07-06 13:40 UTC, Itzik Ephraim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giampaolo 2017-06-24 14:28:00 UTC
Hi there,

Starting a few weeks ago, Kwrite almost always crashes upon exit (click on the top right X button). 
90% of the time it crashes when it is the last instance of kwrite open on my desktop (I often open multiple ones). 10% of the time it seems to happen when other kwrite instances are still open and functioning.

Bug is reproduceable. 

Thank you and kindest regards!
Giampaolo

Please find below general and developer information:
---------------
Eseguibile: kwrite PID: 14905 Segnale: Segmentation fault (11) Ora: 24/06/17 16:15:50
---------------

Application: kwrite (kwrite), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f84fbcaa580 (LWP 14905))]

Thread 2 (Thread 0x7f84eb83a700 (LWP 14907)):
[KCrash Handler]
#6  0x00007f84f9703f8d in QObject::disconnect(QObject const*, char const*, QObject const*, char const*) () at /lib64/libQt5Core.so.5
#7  0x00007f84f994c570 in QDBusConnectionPrivate::closeConnection() () at /lib64/libQt5DBus.so.5
#8  0x00007f84f993b0f2 in QDBusConnectionManager::run() () at /lib64/libQt5DBus.so.5
#9  0x00007f84f95399ca in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#10 0x00007f84f611273a in start_thread () at /lib64/libpthread.so.0
#11 0x00007f84f8922e0f in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7f84fbcaa580 (LWP 14905)):
#0  0x00007f84f6118460 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f84f953a04a in QWaitCondition::wait(QMutex*, unsigned long) () at /lib64/libQt5Core.so.5
#2  0x00007f84f95395ce in QThread::wait(unsigned long) () at /lib64/libQt5Core.so.5
#3  0x00007f84f9938696 in QDBusConnectionManager::~QDBusConnectionManager() () at /lib64/libQt5DBus.so.5
#4  0x00007f84f9938759 in (anonymous namespace)::Q_QGS__q_manager::innerFunction()::Holder::~Holder() () at /lib64/libQt5DBus.so.5
#5  0x00007f84f885574a in __cxa_finalize () at /lib64/libc.so.6
#6  0x00007f84f9937e03 in __do_global_dtors_aux () at /lib64/libQt5DBus.so.5
#7  0x00007ffee3771510 in  ()
#8  0x00007f84fdc044ea in _dl_fini () at /lib64/ld-linux-x86-64.so.2
Comment 1 Itzik Ephraim 2017-07-06 13:40:16 UTC
Created attachment 106460 [details]
KWrite console output - crash on exit
Comment 2 Itzik Ephraim 2017-07-06 13:40:39 UTC
Created attachment 106461 [details]
KWrite console output - normal exit
Comment 3 Itzik Ephraim 2017-07-06 13:55:24 UTC
Hello,

I can confirm that I can see the exact same crash on my machine:
On some occasions KWrite will crash on exit and display the exact same (minus the memory addresses maybe) stack trace with Threads 1 & 2.


Here are simple reproduction steps that work for me every time:
1. Open KWrite.
2. Press [Ctrl]+[O] or [Ctrl]+[S] to bring the "Open"/"Save as" filesystem browser dialog.
3. Press [Esc] to cancel the dialog.
4. Press [Alt]+[F4] to close KWrite.

Actual behavior: Kwrite closes but a bug report notification indicates that KWrite crashed on while closing.
Attached is the console output for this case.

Expected behavior: KWrite should close silently.
This happens if just do steps 1 and 4. I've attached the console output for this case too, for comparison.

* Distro: Fedora 25 - KDE Spin, x64
* KWrite version: 16.12.3
* Kate Part / KDE Frameworks: 5.34.0
* Qt 5.7.1 (built against 5.7.1)

It might be worth mentioning that I use `fish` (v2.3.1) as the default shell for my user. I bring it up because I used to use Kate and it seemed to have an issue with `fish` as the shell at the time - and that's when I switched to KWrite IIRC.

I'd be glad to provide any other information to assist in the investigation.

Thanks
Comment 4 Christoph Feck 2017-07-09 11:54:13 UTC
Fixed in Qt 5.9

https://bugreports.qt.io/browse/QTBUG-52988
Comment 5 Itzik Ephraim 2017-07-09 12:20:00 UTC
(In reply to Christoph Feck from comment #4)
> Fixed in Qt 5.9
> 
> https://bugreports.qt.io/browse/QTBUG-52988

Thanks Christoph!

Unfortunately, seems like Fedora 26 will only use Qt 5.8 and so KWrite is still expected to exhibit this bug, unless built locally with Qt 5.9 (risking other instabilities in the process).

Do I get the picture right?