Bug 271250

Summary: Kwrite discard funtion leaves the first line on the screen (the text is correctly discarded)
Product: [Applications] kate Reporter: Reartes Guillermo <rtguille>
Component: kwriteAssignee: KWrite Developers <kwrite-bugs-null>
Status: VERIFIED FIXED    
Severity: crash CC: cfeck
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 4.6.3
Sentry Crash Report:

Description Reartes Guillermo 2011-04-18 23:12:42 UTC
Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

This does not affect kate.

It is a minor bug, since it apears to be a missing refresh for the first line when discarding the text in kwrite. (the text is effectively discarded)

Reproducible: Always

Steps to Reproduce:
open kwrite and put these 2 lines:
 1
1
(one 1 per line) then hit 'close' and select discard.
the text is discarded, but the first line remains on screen.
there is nothing, so saving reveals it.
start typing text and the remaining text disapears.


Actual Results:  
minor issue

Expected Results:  
all the text must be cleared from the kwrite area.

kdebase.x86_64                      6:4.6.2-1.fc15 @updates-testing          
kdebase-debuginfo.x86_64            6:4.6.2-1.fc15 @updates-testing-debuginfo
kdebase-libs.x86_64                 6:4.6.2-1.fc15 @updates-testing          
kdebase-runtime.x86_64              4.6.2-1.fc15 @updates-testing          
kdebase-runtime-debuginfo.x86_64    4.6.2-1.fc15 @updates-testing-debuginfo
kdebase-runtime-flags.noarch        4.6.2-1.fc15 @updates-testing          
kdebase-runtime-libs.x86_64         4.6.2-1.fc15 @updates-testing          
kdebase-workspace.x86_64            4.6.2-2.fc15 @updates-testing          
kdebase-workspace-debuginfo.x86_64  4.6.2-2.fc15 @updates-testing-debuginfo
kdebase-workspace-libs.x86_64       4.6.2-2.fc15 @updates-testing
Comment 1 Christoph Feck 2011-04-23 19:21:34 UTC
It is worse. It causes a crash if you press "Left" on the "remaining" line.

Application: KWrite (kwrite), signal: Aborted
[Current thread is 1 (Thread 0xb4b0c710 (LWP 27297))]

Thread 2 (Thread 0xb322ab70 (LWP 27298)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb59f9105 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:122
#2  0xb36c6d9a in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0xb383b780) at /local/git/Qt/qt/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#3  0xb36c64e1 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=0xb383b780) at /local/git/Qt/qt/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#4  0xb59f4b05 in start_thread (arg=0xb322ab70) at pthread_create.c:297
#5  0xb56a5d5e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 1 (Thread 0xb4b0c710 (LWP 27297)):
[KCrash Handler]
#7  0xffffe424 in __kernel_vsyscall ()
#8  0xb55fd8df in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#9  0xb55ff220 in abort () at abort.c:92
#10 0xb5a899d3 in qt_message_output (msgType=QtFatalMsg, buf=0x83cabf8 "ASSERT: \"valid()\" in file /local/git/KDE/base/kate/part/view/kateviewinternal.cpp, line 1031") at /local/git/Qt/qt/src/corelib/global/qglobal.cpp:2282
#11 0xb5a89b3e in qt_message (msgType=QtFatalMsg, msg=0xb5c16414 "ASSERT: \"%s\" in file %s, line %d", ap=0xbfa6bfa4 "o\334L\263\250\333L\263\a\004") at /local/git/Qt/qt/src/corelib/global/qglobal.cpp:2328
#12 0xb5a89f6a in qFatal (msg=0xb5c16414 "ASSERT: \"%s\" in file %s, line %d") at /local/git/Qt/qt/src/corelib/global/qglobal.cpp:2511
#13 0xb5a89578 in qt_assert (assertion=0xb34cdc6f "valid()", file=0xb34cdba8 "/local/git/KDE/base/kate/part/view/kateviewinternal.cpp", line=1031) at /local/git/Qt/qt/src/corelib/global/qglobal.cpp:2027
#14 0xb341e1df in WrappingCursor::operator+= (this=0xbfa6c088, n=1) at /local/git/KDE/base/kate/part/view/kateviewinternal.cpp:1031
#15 0xb34102d6 in KateViewInternal::moveChar (this=0x8286778, bias=KateViewInternal::right, sel=false) at /local/git/KDE/base/kate/part/view/kateviewinternal.cpp:1043
#16 0xb3410457 in KateViewInternal::cursorRight (this=0x8286778, sel=false) at /local/git/KDE/base/kate/part/view/kateviewinternal.cpp:1062
#17 0xb34089c1 in KateView::cursorRight (this=0x82824d8) at /local/git/KDE/base/kate/part/view/kateview.cpp:2297
#18 0xb33f87e4 in KateView::qt_metacall (this=0x82824d8, _c=QMetaObject::InvokeMetaMethod, _id=56, _a=0xbfa6c248) at /local/build/KDE/base/kate/part/kateview.moc:381
#19 0xb5ba743a in QMetaObject::metacall (object=0x82824d8, cl=QMetaObject::InvokeMetaMethod, idx=95, argv=0xbfa6c248) at /local/git/Qt/qt/src/corelib/kernel/qmetaobject.cpp:237
#20 0xb5bba5bf in QMetaObject::activate (sender=0x82e4f60, m=0xb6cc1578, local_signal_index=1, argv=0xbfa6c248) at /local/git/Qt/qt/src/corelib/kernel/qobject.cpp:3278
#21 0xb61ebf92 in QAction::triggered (this=0x82e4f60, _t1=false) at .moc/debug-shared/moc_qaction.cpp:263
#22 0xb61eb481 in QAction::activate (this=0x82e4f60, event=QAction::Trigger) at /local/git/Qt/qt/src/gui/kernel/qaction.cpp:1257
#23 0xb61eb200 in QAction::event (this=0x82e4f60, e=0xbfa6c7b0) at /local/git/Qt/qt/src/gui/kernel/qaction.cpp:1183
#24 0xb6dea3db in KAction::event (this=0x82e4f60, event=0xbfa6c7b0) at /local/git/KDE/libs/kdelibs/kdeui/actions/kaction.cpp:131
#25 0xb61fa8ae in QApplicationPrivate::notify_helper (this=0x806cb08, receiver=0x82e4f60, e=0xbfa6c7b0) at /local/git/Qt/qt/src/gui/kernel/qapplication.cpp:4462
#26 0xb61f81aa in QApplication::notify (this=0xbfa6d748, receiver=0x82e4f60, e=0xbfa6c7b0) at /local/git/Qt/qt/src/gui/kernel/qapplication.cpp:3862
#27 0xb6edba22 in KApplication::notify (this=0xbfa6d748, receiver=0x82e4f60, event=0xbfa6c7b0) at /local/git/KDE/libs/kdelibs/kdeui/kernel/kapplication.cpp:311
#28 0xb5b9fd8f in QCoreApplication::notifyInternal (this=0xbfa6d748, receiver=0x82e4f60, event=0xbfa6c7b0) at /local/git/Qt/qt/src/corelib/kernel/qcoreapplication.cpp:787
#29 0xb61ec4d9 in QCoreApplication::sendEvent (receiver=0x82e4f60, event=0xbfa6c7b0) at ../../include/QtCore/../../../../git/Qt/qt/src/corelib/kernel/qcoreapplication.h:215
#30 0xb62370ae in QShortcutMap::dispatchEvent (this=0x806cbb4, e=0xbfa6ccfc) at /local/git/Qt/qt/src/gui/kernel/qshortcutmap.cpp:879
#31 0xb623596e in QShortcutMap::tryShortcutEvent (this=0x806cbb4, o=0x8286778, e=0xbfa6ccfc) at /local/git/Qt/qt/src/gui/kernel/qshortcutmap.cpp:364
#32 0xb61f83e2 in QApplication::notify (this=0xbfa6d748, receiver=0x8286778, e=0xbfa6ccfc) at /local/git/Qt/qt/src/gui/kernel/qapplication.cpp:3904
#33 0xb6edba22 in KApplication::notify (this=0xbfa6d748, receiver=0x8286778, event=0xbfa6ccfc) at /local/git/KDE/libs/kdelibs/kdeui/kernel/kapplication.cpp:311
#34 0xb5b9fd8f in QCoreApplication::notifyInternal (this=0xbfa6d748, receiver=0x8286778, event=0xbfa6ccfc) at /local/git/Qt/qt/src/corelib/kernel/qcoreapplication.cpp:787
#35 0xb61fd1c9 in QCoreApplication::sendSpontaneousEvent (receiver=0x8286778, event=0xbfa6ccfc) at ../../include/QtCore/../../../../git/Qt/qt/src/corelib/kernel/qcoreapplication.h:218
#36 0xb61fac11 in qt_sendSpontaneousEvent (receiver=0x8286778, event=0xbfa6ccfc) at /local/git/Qt/qt/src/gui/kernel/qapplication.cpp:5456
#37 0xb62c19f4 in QKeyMapper::sendKeyEvent (keyWidget=0x8286778, grab=false, type=QEvent::KeyPress, code=16777236, modifiers=..., text=..., autorepeat=false, count=1, nativeScanCode=114, nativeVirtualKey=65363, nativeModifiers=0) at /local/git/Qt/qt/src/gui/kernel/qkeymapper_x11.cpp:1866
#38 0xb62c171a in QKeyMapperPrivate::translateKeyEvent (this=0x809d318, keyWidget=0x8286778, event=0xbfa6d430, grab=false) at /local/git/Qt/qt/src/gui/kernel/qkeymapper_x11.cpp:1836
#39 0xb628e1b2 in QApplication::x11ProcessEvent (this=0xbfa6d748, event=0xbfa6d430) at /local/git/Qt/qt/src/gui/kernel/qapplication_x11.cpp:3480
#40 0xb62c3742 in x11EventSourceDispatch (s=0x806f8a8, callback=0, user_data=0x0) at /local/git/Qt/qt/src/gui/kernel/qguieventdispatcher_glib.cpp:146
#41 0xb4edb509 in g_main_dispatch (context=0x806ec78) at gmain.c:2440
#42 g_main_context_dispatch (context=0x806ec78) at gmain.c:3013
#43 0xb4edbd10 in g_main_context_iterate (context=0x806ec78, block=1, dispatch=1, self=0x806c9a0) at gmain.c:3091
#44 0xb4edbfce in g_main_context_iteration (context=0x806ec78, may_block=1) at gmain.c:3154
#45 0xb5bd4548 in QEventDispatcherGlib::processEvents (this=0x806b738, flags=...) at /local/git/Qt/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:422
#46 0xb62c3a98 in QGuiEventDispatcherGlib::processEvents (this=0x806b738, flags=...) at /local/git/Qt/qt/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#47 0xb5b9daed in QEventLoop::processEvents (this=0xbfa6d6cc, flags=...) at /local/git/Qt/qt/src/corelib/kernel/qeventloop.cpp:149
#48 0xb5b9dc31 in QEventLoop::exec (this=0xbfa6d6cc, flags=...) at /local/git/Qt/qt/src/corelib/kernel/qeventloop.cpp:201
#49 0xb5ba047a in QCoreApplication::exec () at /local/git/Qt/qt/src/corelib/kernel/qcoreapplication.cpp:1064
#50 0xb61f7ddc in QApplication::exec () at /local/git/Qt/qt/src/gui/kernel/qapplication.cpp:3736
#51 0xb77b7508 in kdemain (argc=1, argv=0xbfa6da94) at /local/git/KDE/base/kate/kwrite/kwritemain.cpp:680
#52 0x08048749 in main (argc=1, argv=0xbfa6da94) at /local/build/KDE/base/kate/kwrite/kwrite_dummy.cpp:3
Comment 2 Christoph Feck 2011-04-23 19:23:40 UTC
Sorry, I meant cursor key "Right" ...
Comment 3 Dominik Haumann 2011-04-25 11:39:59 UTC
I can reproduce the redraw-bug, but not the crash. More info?
Comment 4 Christoph Feck 2011-04-25 12:12:37 UTC
Reproducible on today's trunk, with:
* delete kwriterc
* start kwrite
* type: 1 Enter 1 Enter
* click "Close"
* click "Discard"
* hit "Right" cursor key
=> assert
Comment 5 Dominik Haumann 2011-04-25 15:26:35 UTC
Git commit 0c521c11fa9e10c7e1f424755d6e682369d576cc by Dominik Haumann.
Committed on 25/04/2011 at 15:34.
Pushed by dhaumann into branch 'master'.

clear layout cache when closing a document

BUG: 271250

M  +1    -0    part/view/kateviewinternal.cpp     

http://commits.kde.org/kate/0c521c11fa9e10c7e1f424755d6e682369d576cc
Comment 6 Dominik Haumann 2011-04-25 15:30:04 UTC
Git commit 06d0f719e8d7d270317ce06e368c9818f0b718a4 by Dominik Haumann.
Committed on 25/04/2011 at 15:38.
Pushed by dhaumann into branch 'KDE/4.6'.

clear layout cache after document close

CCBUG: 271250

M  +1    -0    kate/view/kateviewinternal.cpp     

http://commits.kde.org/kdelibs/06d0f719e8d7d270317ce06e368c9818f0b718a4
Comment 7 Dominik Haumann 2011-04-25 15:30:49 UTC
Christoph, can you retest? It should not crash anymore, and the layout bug should be fixed.
Comment 8 Christoph Feck 2011-04-25 15:43:17 UTC
Verified on master branch.