Bug 230426 - Kate crashes when closing automatically selected file
Summary: Kate crashes when closing automatically selected file
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: VHI crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 231899 232323 238369 238485 241898 242355 245331 248220 250336 250468 252617 254650 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-12 10:42 UTC by Michiel Helvensteijn
Modified: 2010-10-23 16:48 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (5.41 KB, text/plain)
2010-04-26 11:21 UTC, Brice Maron
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michiel Helvensteijn 2010-03-12 10:42:47 UTC
Application: kate (3.4.1)
KDE Platform Version: 4.4.1 (KDE 4.4.1) (Compiled from sources)
Qt Version: 4.6.2
Operating System: Linux 2.6.32-gentoo x86_64
Distribution (Platform): Gentoo Packages

-- Information about the crash:
Kate crashed for me if I close a file that has not been manually selected in the list.

The last file in the list is automatically selected on startup. I click the close button, and Kate crashes. If I first select another file, then back to the last, I can close without a problem. However, closing the file that is *then* automatically selected (was second to last, is now last) will cause the same crash. Not until I have manually selected a file can I safely close it.

The following is merely a guess: It looks as though the automatic file select at startup, or after safely closing a file, only shows on the interface, but is not registered internally as it is with a manual select.

The crash can be reproduced every time.

 -- Backtrace:
Application: Kate (kdeinit4), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f2c956bf760 (LWP 19940))]

Thread 2 (Thread 0x7f2c838ae710 (LWP 19941)):
#0  0x00007f2c9313423c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2c8424b136 in ?? () from /usr/lib64/qt4/libQtScript.so.4
#2  0x00007f2c8424b179 in ?? () from /usr/lib64/qt4/libQtScript.so.4
#3  0x00007f2c9312f894 in start_thread () from /lib/libpthread.so.0
#4  0x00007f2c91832f9d in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f2c956bf760 (LWP 19940)):
[KCrash Handler]
#5  0x00007f2c93462dfb in QUrl::QUrl(QUrl const&) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007f2c9513a259 in KUrl::KUrl(KUrl const&) () from /usr/lib64/libkdecore.so.5
#7  0x00007f2c94e1aaf1 in KParts::ReadOnlyPart::url() const () from /usr/lib64/libkparts.so.4
#8  0x00007f2c8766ce0f in KateDocManager::data (this=<value optimized out>, index=<value optimized out>, role=<value optimized out>)
    at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/katedocmanager.cpp:133
#9  0x00007f2c876a0270 in KateViewDocumentProxyModel::data (this=0x29f5ba0, index=..., role=35) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/kateviewdocumentproxymodel.cpp:325
#10 0x00007f2c876a202b in KateViewDocumentProxyModel::sort (this=0x2de22b0) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/kateviewdocumentproxymodel.cpp:637
#11 0x00007f2c876a3408 in KateViewDocumentProxyModel::opened (this=0x29f5ba0, index=...) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/kateviewdocumentproxymodel.cpp:216
#12 0x00007f2c87676fef in KateMainWindow::slotWindowActivated (this=0x2809990) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/katemainwindow.cpp:566
#13 0x00007f2c8767b913 in KateMainWindow::qt_metacall (this=0x2809990, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff454464d0)
    at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1_build/kate/app/katemainwindow.moc:181
#14 0x00007f2c934c4bff in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#15 0x00007f2c8768097c in KateViewManager::activateView (this=0x298e3c0, view=0x2dbb540) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/kateviewmanager.cpp:469
#16 0x00007f2c8768175f in KateViewManager::createView (this=0x298e3c0, doc=<value optimized out>) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/kateviewmanager.cpp:308
#17 0x00007f2c87682bca in KateViewManager::qt_metacall (this=0x298e3c0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff45446720)
    at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1_build/kate/app/kateviewmanager.moc:138
#18 0x00007f2c934c4bff in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#19 0x00007f2c87667712 in KateDocManager::documentDeleted (this=0x7fff45445e50, _t1=0x295fb50) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1_build/kate/app/katedocmanager.moc:138
#20 0x00007f2c87668b1b in KateDocManager::deleteDoc (this=0x26e8290, doc=0x295fb50) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/katedocmanager.cpp:218
#21 0x00007f2c8766d892 in KateDocManager::closeDocument (this=0x26e8290, doc=0x295fb50, closeUrl=true) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/katedocmanager.cpp:366
#22 0x00007f2c8767e857 in KateViewManager::slotDocumentClose (this=<value optimized out>, document=0x295fb50) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/kateviewmanager.cpp:205
#23 0x00007f2c87682b31 in KateViewManager::qt_metacall (this=0x298e3c0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff45446eb0)
    at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1_build/kate/app/kateviewmanager.moc:130
#24 0x00007f2c934c4bff in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#25 0x00007f2c92417852 in QAction::triggered(bool) () from /usr/lib64/qt4/libQtGui.so.4
#26 0x00007f2c924198cb in QAction::activate(QAction::ActionEvent) () from /usr/lib64/qt4/libQtGui.so.4
#27 0x00007f2c927b2eaa in ?? () from /usr/lib64/qt4/libQtGui.so.4
#28 0x00007f2c927b315c in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#29 0x00007f2c9287f0ea in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#30 0x00007f2c92473d02 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#31 0x00007f2c9241d95c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#32 0x00007f2c9242471b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#33 0x00007f2c93c66b96 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#34 0x00007f2c934b1ebc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#35 0x00007f2c924238f6 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/qt4/libQtGui.so.4
#36 0x00007f2c924a331b in ?? () from /usr/lib64/qt4/libQtGui.so.4
#37 0x00007f2c924a202a in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#38 0x00007f2c924cc0b2 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#39 0x00007f2c8e87374e in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#40 0x00007f2c8e877108 in ?? () from /usr/lib/libglib-2.0.so.0
#41 0x00007f2c8e877230 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#42 0x00007f2c934db2e3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#43 0x00007f2c924cbcae in ?? () from /usr/lib64/qt4/libQtGui.so.4
#44 0x00007f2c934b07e2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#45 0x00007f2c934b0bbc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#46 0x00007f2c934b48fb in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#47 0x00007f2c878cc16d in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /var/tmp/portage/kde-base/kate-4.4.1/work/kate-4.4.1/kate/app/katemain.cpp:377
#48 0x0000000000407379 in _start ()

This bug may be a duplicate of or related to bug 170282.

Possible duplicates by query: bug 178221.

Reported using DrKonqi
Comment 1 Dominik Haumann 2010-03-12 18:55:03 UTC
related: bug #203774
Comment 2 Radu Benea 2010-03-12 21:39:49 UTC
I have the exactly same versions of kate, kde, qt and don't experience this problem, I tried both with and without kate's tab bar plugin.
Might have something to do with some plugin, can you try narrowing it down to what causes the issue?
Comment 3 Michiel Helvensteijn 2010-03-12 22:32:26 UTC
Update:

First of all, I am using zero plugins or extensions.

The bug is not quite as predictable as I first described. After several experiments I determined it is not always the first auto-selected file that causes the crash. It can on occasion be the second (close close-crash) or third (close close close-crash). It has something to do with the file that is auto-selected on startup (not always the last). But I am unable to find a pattern.

I have now compiled Kate with -O0, -O1 and -O2, which makes no difference at all.

Try the following, just to make sure you did the same things I did:

1) Open Kate.
2) Turn off all plugins and extensions.
3) Open five text files.
4) Leave the last one selected.
5) Close Kate.
6) Open Kate again. The same five files should be auto-loaded.
7) Click the close button on the toolbar, to close the currently selected file.

This is a crash for me, every time.
Comment 4 Dominik Haumann 2010-03-23 17:13:52 UTC
*** Bug 231899 has been marked as a duplicate of this bug. ***
Comment 5 Dominik Haumann 2010-03-27 10:41:55 UTC
*** Bug 232323 has been marked as a duplicate of this bug. ***
Comment 6 Brice Maron 2010-04-26 11:21:53 UTC
Created attachment 43041 [details]
New crash information added by DrKonqi

I 've loaded a session with some unreachable files.
When i try to close some of those files, kate crashed
from close button or from shortcuts
Comment 7 Dominik Haumann 2010-04-26 21:13:03 UTC
SVN commit 1119178 by cullmann:

jowenn:

    document removal before signal emission
    
    Now the document is removed from the document model before the
    documentDeleted signals are emitted. The signals trigger view updates,
    which access the item list, which again accesses the already deleted
    document and it's members if the order is the other way round.
    
    Added warnings that the pointer must not be dereferences in slots
    connected to the signals, because the document has already been deleted,
    the pointer may only be used for lookup in hashes or maps, as long as
    the hash function does not access the invalid data. The save way is to
    act on the willBeDeleted signals.
    This hopefully fixes BUG: 230426

http://gitorious.org/kate/kate/commit/4dc9a75e550e71f6c654d91bd088d74f14e3783c
Comment 8 Dominik Haumann 2010-05-21 18:08:53 UTC
*** Bug 238369 has been marked as a duplicate of this bug. ***
Comment 9 Dominik Haumann 2010-05-22 23:27:18 UTC
*** Bug 238485 has been marked as a duplicate of this bug. ***
Comment 10 Dominik Haumann 2010-06-17 00:20:31 UTC
*** Bug 241898 has been marked as a duplicate of this bug. ***
Comment 11 Dominik Haumann 2010-06-21 16:58:23 UTC
*** Bug 242355 has been marked as a duplicate of this bug. ***
Comment 12 Christoph Feck 2010-10-23 16:42:08 UTC
*** Bug 254650 has been marked as a duplicate of this bug. ***
Comment 13 Christoph Feck 2010-10-23 16:42:53 UTC
*** Bug 252617 has been marked as a duplicate of this bug. ***
Comment 14 Christoph Feck 2010-10-23 16:43:27 UTC
*** Bug 250468 has been marked as a duplicate of this bug. ***
Comment 15 Christoph Feck 2010-10-23 16:44:27 UTC
*** Bug 250336 has been marked as a duplicate of this bug. ***
Comment 16 Christoph Feck 2010-10-23 16:47:51 UTC
*** Bug 248220 has been marked as a duplicate of this bug. ***
Comment 17 Christoph Feck 2010-10-23 16:48:18 UTC
*** Bug 245331 has been marked as a duplicate of this bug. ***