Bug 157754 - Kate (KDE4) crashes when using code folding and split screen.
Summary: Kate (KDE4) crashes when using code folding and split screen.
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: folding (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: HI crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 177546 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-13 00:54 UTC by Alex Ruddick
Modified: 2010-12-02 22:58 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of imminent crash (102.29 KB, image/png)
2008-02-13 00:55 UTC, Alex Ruddick
Details
Valgrind log for kate crashing on bug #157754 (30.33 KB, text/plain)
2008-02-13 04:55 UTC, Oliver Putz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Ruddick 2008-02-13 00:54:51 UTC
Version:            (using KDE 4.0.1)
Installed from:    Ubuntu Packages

First off, I'm not sure which package to install for a debugging backtrace, since there was is no kate-kde4-dbg and that's the extent of my search. :P  I am running pre-release packages (Ubuntu Hardy), but with all updates installed.  Kate is running in GNOME under Compiz; I have not tried yet in native KDE.

I am able to reproduce this every time.

1) Open a document with indentation that will enable code folding.
2) Split the screen (I used vertically, didn't test horizontally)
3) Scroll the both sides to different positions in the document.  Let's say left is above right (smaller line #)
4) Fold/unfold a few blocks on the left, until a gray bar appears in the right and the view glitches. (see screenshot)
5) Say your prayers.  (In this case, use a scrollwheel while the mouse is over the right pane to avoid the next step)
6) Click in the right pane.  Crash and pick up the pieces.
Comment 1 Alex Ruddick 2008-02-13 00:55:39 UTC
Created attachment 23550 [details]
Screenshot of imminent crash
Comment 2 Oliver Putz 2008-02-13 03:59:56 UTC
I can reproduce this with kdelibs r772899. The backtrace I get is:

Application: Kate (kate), signal SIGABRT
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb5f476d0 (LWP 26874)]
[KCrash handler]
#6  0xffffe410 in __kernel_vsyscall ()
#7  0xb61b01f1 in *__GI_raise (sig=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#8  0xb61b19b8 in *__GI_abort () at abort.c:88
#9  0xb6da5265 in qt_message_output (msgType=QtFatalMsg, 
    buf=0xbfa8548c "ASSERT: \"thisLine.virtualLine() == virtualCursor.line()\" in file /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kate/view/kateviewinternal.cpp, line 1253") at global/qglobal.cpp:2160
#10 0xb6da532a in qFatal (msg=0xb6eac87c "ASSERT: \"%s\" in file %s, line %d")
    at global/qglobal.cpp:2392
#11 0xb6da5555 in qt_assert (
    assertion=0xb4a17474 "thisLine.virtualLine() == virtualCursor.line()", 
    file=0xb4a17380 "/var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kate/view/kateviewinternal.cpp", line=1253) at global/qglobal.cpp:1917
#12 0xb49a6444 in KateViewInternal::viewLineOffset (this=0x8276850, 
    virtualCursor=@0x8276938, offset=0, keepX=false)
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kate/view/kateviewinternal.cpp:1253
#13 0xb49a87a8 in KateViewInternal::makeVisible (this=0x8276850, 
    c=@0x82768f4, endCol=54, force=false, center=false, 
    calledExternally=false)
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kate/view/kateviewinternal.cpp:633
#14 0xb49a8ac3 in KateViewInternal::updateCursor (this=0x8276850, 
    newCursor=@0xbfa8775c, force=false, center=false, calledExternally=false)
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kate/view/kateviewinternal.cpp:1797
#15 0xb49add24 in KateViewInternal::placeCursor (this=0x8276850, 
    p=@0xbfa87e24, keepSelection=false, updateSelection=true)
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kate/view/kateviewinternal.cpp:2038
#16 0xb49af069 in KateViewInternal::mousePressEvent (this=0x8276850, 
    e=0xbfa87e14)
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kate/view/kateviewinternal.cpp:2409
#17 0xb656b9be in QWidget::event (this=0x8276850, event=0xbfa87e14)
    at kernel/qwidget.cpp:6134
#18 0xb6518e8a in QApplicationPrivate::notify_helper (this=0x8058398, 
    receiver=0x8276850, e=0xbfa87e14) at kernel/qapplication.cpp:3556
#19 0xb651aa2c in QApplication::notify (this=0xbfa88694, receiver=0x8276850, 
    e=0xbfa87e14) at kernel/qapplication.cpp:3255
#20 0xb7434763 in KApplication::notify (this=0xbfa88694, receiver=0x8276850, 
    event=0xbfa87e14)
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kdeui/kernel/kapplication.cpp:311
#21 0xb6e77d7b in QCoreApplication::notifyInternal (this=0xbfa88694, 
    receiver=0x8276850, event=0xbfa87e14) at kernel/qcoreapplication.cpp:530
#22 0xb657e628 in QETWidget::translateMouseEvent (this=0x8276850, 
    event=0xbfa881d8)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:203
#23 0xb657ce8e in QApplication::x11ProcessEvent (this=0xbfa88694, 
    event=0xbfa881d8) at kernel/qapplication_x11.cpp:2913
#24 0xb65a2c45 in QEventDispatcherX11::processEvents (this=0x80588e0, 
    flags=@0xbfa882c4) at kernel/qeventdispatcher_x11.cpp:125
#25 0xb6e77191 in QEventLoop::processEvents (this=0xbfa88330, 
    flags=@0xbfa882f8) at kernel/qeventloop.cpp:140
#26 0xb6e7729a in QEventLoop::exec (this=0xbfa88330, flags=@0xbfa88338)
    at kernel/qeventloop.cpp:186
#27 0xb6e79626 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:759
#28 0xb6518487 in QApplication::exec () at kernel/qapplication.cpp:3053
#29 0xb7f28588 in kdemain (argc=2, argv=0xbfa88c14)
    at /var/tmp/portage/kde-base/kdesdk-9999.4/work/kdesdk-9999.4/kate/app/katemain.cpp:256
#30 0x08048842 in main (argc=)
    at /var/tmp/portage/kde-base/kdesdk-9999.4/work/kdesdk_build/kate/app/kate_dummy.cpp:3
#31 0xb619cfdc in __libc_start_main (main=0x8048820 <main>, argc=2, 
    ubp_av=0xbfa88c14, init=0x8048870 <__libc_csu_init>, 
    fini=0x8048860 <__libc_csu_fini>, rtld_fini=0xb7f3b100 <_dl_fini>, 
    stack_end=0xbfa88c0c) at libc-start.c:229
#32 0x08048791 in _start ()
#0  0xffffe410 in __kernel_vsyscall ()

Btw: @Alex: These gray bars are no bugs, but just indicate wrapped lines. The line would go further to the right, but was wrapped because the window is too small (a 61 character line on a 30 character wide screen results in the line being split up in three lines)
Comment 3 Alex Ruddick 2008-02-13 04:32:06 UTC
Thanks for the confirmation and backtrace.

Re: gray bars/ lines
I know that the gray rectangle along the left side are line wraps.  However, I tried to point out the faint dashed line between the first and second line in the screenshot, which doesn't belong.  I guess the arrow wasn't oriented very well.

I just compared the screenshot more carefully to my program, and discovered that in the right view a line of code is missing (where the dashed gray line appeared).  I'm guessing this is what causes the crash, as thisLine.virtualLine() is now going to be one off drom thisLine.virtualLine() == virtualCursor.line().
Comment 4 Oliver Putz 2008-02-13 04:55:36 UTC
Created attachment 23552 [details]
Valgrind log for kate crashing on bug #157754
Comment 5 Dominik Haumann 2008-04-08 23:54:10 UTC
Can reproduce. This is tricky.
Comment 6 Dario Andres 2008-12-13 14:48:47 UTC
Can bug 177546 be related to this ? (KDE4.1.3)
Comment 7 Dominik Haumann 2008-12-15 12:33:39 UTC
Cannot reproduce anymore. In April I still could. Maybe this was fixed silently? Can other please try to reproduce? I'm not able to get the grey bar anymore.
Please try with upcoming trunk, KDE4.2 or a beta version.
Comment 8 Burkhard Lück 2008-12-15 14:12:36 UTC
Checked with kdelibs 897044 and kate 896752.
I can't reproduce this bug, no dashed gray line, no crash.
Comment 9 Oliver Putz 2008-12-15 14:16:21 UTC
Hi, I seem to be able to -- more or less -- still reproduce it:

My new steps to reproduce this bug are as follows:

1) Open a long document with code folding
2) Split vertically
3) Go to bottom of page in right view
4) Click with left mouse button in right view
5) Fold some stuff on the right side (view on right side gets updated accordingly)
6) Right click in right view

However, as the backtrace I get with KDE-4.1.82 is completely different from the backtrace I got back in February, I opened a new bug, namely bug #177852. (I also posted the new backtrace there)

So I suggest we either close this one as WORKSFORME (indeed, it does not crash for me unless I am -- due to folding -- "below the actual document" in the right view) or close my new report as a duplicate of this bug...
Comment 10 Dario Andres 2009-01-16 12:01:57 UTC
*** Bug 177546 has been marked as a duplicate of this bug. ***
Comment 11 Milian Wolff 2010-12-01 23:09:01 UTC
can reproduce when "scroll past end of document" is enabled, will try to fix it.
Comment 12 Christoph Cullmann 2010-12-02 20:50:09 UTC
SVN commit 1202930 by cullmann:

mwolff:

    Don't crash during code folding when "scroll past end of document" is enabled.
    Generally don't try to pass a zero-offset to viewLineOffset as this will always
    lead to an assert if "dynamic word wrap" is enabled.
    
    Btw.: What m_minLinesVisible should have to do with scrollPastEnd
    is hidden to me - probably a bug and someone wanted to check against
    autoCenterLines but even then m_minLInesVisible is something different.
    
    Add testcase for various configurations, showing that it works fine now.
    
BUG: 157754


 M  +4 -1      kateviewinternal.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1202930
Comment 13 Pascal Létourneau 2010-12-02 22:58:17 UTC
SVN commit 1202961 by pletourn:

Revert commit 1202930 
Instead clear the cache earlier

CCBUG:157754


 M  +3 -6      kateviewinternal.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1202961