Please enter some Reproducible: Always Steps to Reproduce: 1. Open some files contained in a git repo 2. Switch branches 3. Go to a file that is shorter in the new branch (maybe 2 pages of code instead of 2.5 or 3) 4. Click on the scrollbar slider and drag it down 5. kate crashes This has been a problem for a long time, at least since 4.7.2, most likely older.
Created attachment 80348 [details] Saved backtrace from crash dialog
> #8 0xb2b04b87 in ?? () from /usr/lib/libkatepartinterfaces.so.4 Please install debug symbols and try to provide a better backtrace.
Created attachment 80349 [details] with debug infos
Always paste the backtrace, relevant parts: Thread 1 (Thread 0xb5565a40 (LWP 866)): [KCrash Handler] #7 KateLineLayout::viewLineCount (this=0x0) at ../../part/render/katelinelayout.cpp:173 #8 0xb2b04b27 in KateLayoutCache::lastViewLine (this=0x84fefd0, realLine=-1) at ../../part/render/katelayoutcache.cpp:465 #9 0xb2b5cfc6 in KateViewInternal::viewLineOffset (this=this@entry=0x85014d0, virtualCursor=..., offset=offset@entry=45, keepX=keepX@entry=false) at ../../part/view/kateviewinternal.cpp:1313 #10 0xb2b5faa2 in KateViewInternal::scrollViewLines (this=this@entry=0x85014d0, offset=45) at ../../part/view/kateviewinternal.cpp:360 #11 0xb2b5fbd8 in KateViewInternal::scrollNextPage (this=0x85014d0) at ../../part/view/kateviewinternal.cpp:399 #12 0xb69934b2 in QMetaObject::activate (sender=sender@entry=0x8501f40, m=m@entry=0xb7deba40 <QAbstractSlider::staticMetaObject>, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0xbfffe968) at kernel/qobject.cpp:3539 #13 0xb7b7de65 in QAbstractSlider::actionTriggered (this=this@entry=0x8501f40, _t1=_t1@entry=3) at .moc/release-shared/moc_qabstractslider.cpp:229 #14 0xb78843f7 in QAbstractSlider::triggerAction (this=0x8501f40, action=action@entry=QAbstractSlider::SliderPageStepAdd) at widgets/qabstractslider.cpp:630 #15 0xb7925024 in QScrollBarPrivate::activateControl (this=0x8501ff0, control=4, threshold=500) at widgets/qscrollbar.cpp:279 #16 0xb7926681 in QScrollBar::mousePressEvent (this=0x8501f40, e=0xbffff1e4) at widgets/qscrollbar.cpp:616 #17 0xb2b6cb2c in KateScrollBar::mousePressEvent (this=0x8501f40, e=0xbffff1e4) at ../../part/view/kateviewhelpers.cpp:196 #18 0xb74b80a6 in QWidget::event (this=0x8501f40, event=0xbffff1e4) at kernel/qwidget.cpp:8371 #19 0xb7884cd3 in QAbstractSlider::event (this=this@entry=0x8501f40, e=e@entry=0xbffff1e4) at widgets/qabstractslider.cpp:952
I cannot reproduce. Can you reproduce this please by running it in valgrind? First build kate from sources ( http://kate-editor.org/get-it/ ), then call ./run.sh valgrind kate and reproduce.
kate(20005)/kate-filetree KateFileTreePluginView::viewChanged: END! ASSERT: "visibleLine >= 0" in file /tmp/kate/kate/part/buffer/katetextfolding.cpp, line 427 KCrash: Application 'kate' crashing... KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit ==20005== Invalid read of size 4 ==20005== at 0x48CA7EF: ??? (in /usr/lib/libkdeui.so.5.10.5) ==20005== by 0x48CB1C0: ??? (in /usr/lib/libkdeui.so.5.10.5) ==20005== by 0x48CBD58: KCrash::defaultCrashHandler(int) (in /usr/lib/libkdeui.so.5.10.5) ==20005== by 0x5E578C7: ??? (in /lib/i386-linux-gnu/i686/cmov/libc-2.17.so) ==20005== Address 0x15b7f650 is 0 bytes inside a block of size 3 alloc'd ==20005== at 0x402B468: malloc (vg_replace_malloc.c:270) ==20005== by 0x48CA776: ??? (in /usr/lib/libkdeui.so.5.10.5) ==20005== by 0x48CB1C0: ??? (in /usr/lib/libkdeui.so.5.10.5) ==20005== by 0x48CBD58: KCrash::defaultCrashHandler(int) (in /usr/lib/libkdeui.so.5.10.5) ==20005== by 0x5E578C7: ??? (in /lib/i386-linux-gnu/i686/cmov/libc-2.17.so) ==20005==
By the way, this is pretty hard to reproduce. It appears you shouldn't have a view of the file opened, but it should still be opened in the background (i.e. it's on your list of opened files, but there is no window that shows the file contents). Then switch the branches two times: once to the version where the file is longer, then back to the version where it's shorter. Then use the mouse and drag the scroll bar and pull it down, in a way that would scroll past the end of the file if it were possible.
Hm, can you again provide a normal backtrace with the self-built Kate? Because the initial backtrace is missing the assert in katetextfolding.cpp, so we don't have any concrete code path.
Do you still experience this problem?
I haven't experienced it in a while (though might be due to effective avoidance), and I couldn't reproduce it when I tested just now. Currently I'm on 3.14.0. >Hm, can you again provide a normal backtrace with the self-built Kate? Because the initial backtrace is missing the assert in katetextfolding.cpp, so we don't have any concrete code path. Sorry, must have missed this mail.