Bug 53100 - wrap cursor deactivated causes hangs
Summary: wrap cursor deactivated causes hangs
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 2.1
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-17 08:40 UTC by Andreas Klauer
Modified: 2003-01-20 04:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Klauer 2003-01-17 08:40:52 UTC
Version:           2.1 (using KDE 3.1.0)
Installed from:     (3.0)
Compiler:          gcc version 2.95.4 20011002 (Debian prerelease)
OS:          Linux (i686) release 2.4.20

Open a file with some text in it. It should have some long and some short lines, therefore some kind of source code is best to reproduce this error.

Move the cursor to the end of a pretty long line which should be somewhere in the middle of the file. Now, turn off the 'wrap cursor' feature. In earlier versions of kate, this had the effect that the current column was not changed when hitting the up/down keys, no matter how long the lines were.

Now, there seems to be a counting error when moving the cursor via the up/down keys. Hit the <up>-Key two or three times and you'll notice (if the lines above the current one are shorter) that the cursor moved several colums to the right. Hit the <up> key ten more times and your cursor will somewhere in column 1000000 or so.

Took me pretty long to figure this out, since I usually use the <up> key for scrolling and therefore don't release it that fast. If you do that, kate will hang and crash.
Comment 1 Hamish Rodda 2003-01-17 15:05:00 UTC
I though the wrap cursor off option affected the behaviour of left and right 
keys, not up and down? 
 
Do you use dynamic word wrapping? 
 
Can you get a backtrace?  Use KSystemGuard to send the process a 
SIGABRT if it just goes to 100% cpu. 
Comment 2 Andreas Klauer 2003-01-19 23:45:31 UTC
Subject: Re:  wrap cursor deactivated causes hangs

Am Freitag, 17. Januar 2003 15:05 schrieben Sie:

> 15:05 ------- I though the wrap cursor off option affected the behaviour of
> left and right keys, not up and down?

Well. In earlier versions of kate, I loved the editor because it ignored the 
actual length of lines. You could just move the cursor anywhere, when 
pressing the up/down keys it stayed in the same column. I think this feature 
is called "wrap cursor off". When inserting text after the (actual) end of 
the current line, it was automagically filled up with spaces. This is nice 
when doing ascii art :-)

With "wrap cursor on" instead, when pressing up / down key and the line 
above/under the current line was shorter, the cursor hops to the last 
character in this line. If you want to place text on the right side of the 
document, you have to fill up the line with tabs/spaces first.


> Do you use dynamic word wrapping?

Word wrap is deactivated.
Dynamic word wrapping is deactivated, too.

To reproduce the error, deactivate the 'wrap cursor' option, open up a fairly 
large document (eg. 2000 line of source code), place the cursor in line 1000, 
column 100 and press the up/down keys several times... this is 100% 
reproducible here.


> Can you get a backtrace?  Use KSystemGuard to send the process a
> SIGABRT if it just goes to 100% cpu.

This bug seems to eat my RAM, too, because my whole X System gets screwed 
everytime I try it... didn't manage to get a backtrace, yet. Hopefully, you 
can just reproduce the error. Happens in kwrite as well.


Regards
Andreas Klauer

Comment 3 Andreas Klauer 2003-01-20 00:16:26 UTC
Subject: Re:  wrap cursor deactivated causes hangs

Am Sonntag, 19. Januar 2003 23:45 schrieben Sie:

> > Can you get a backtrace?  Use KSystemGuard to send the process a
> > SIGABRT if it just goes to 100% cpu.
>
> This bug seems to eat my RAM, too, because my whole X System gets screwed
> everytime I try it... didn't manage to get a backtrace, yet. Hopefully, you
> can just reproduce the error. Happens in kwrite as well.

Well, got something, but doesn't look that helpful to me.
I'd have to try this on an LFS system to get those debug symbols right ;-) 
Currently I'm just using the debian packages from 
http://ktown.kde.org/~nolden/kde/woody/i386

(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...[New Thread 1024 
(LWP 3903)]

(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...0x40f66609 in wait4 () from /lib/libc.so.6
#0  0x40f66609 in wait4 () from /lib/libc.so.6
#1  0x40fdbdd0 in __check_rhosts_file () from /lib/libc.so.6
#2  0x40e32eeb in waitpid () from /lib/libpthread.so.0
#3  0x4061c01a in KCrash::defaultCrashHandler () from /usr/lib/libkdecore.so.4
#4  0x40e30a44 in pthread_sighandler () from /lib/libpthread.so.0
#5  0x40eef518 in sigaction () from /lib/libc.so.6
#6  0x4186af52 in KateViewInternal::cursorDown ()
   from /usr/lib/kde3/libkatepart.so
#7  0x4187d74e in KateView::down () from /usr/lib/kde3/libkatepart.so
#8  0x4186c748 in KateViewInternal::keyPressEvent ()
   from /usr/lib/kde3/libkatepart.so
#9  0x4186c536 in KateViewInternal::eventFilter ()
   from /usr/lib/kde3/libkatepart.so
#10 0x4094ef50 in QObject::activate_filters () from /usr/lib/libqt-mt.so.3
#11 0x4094ee31 in QObject::event () from /usr/lib/libqt-mt.so.3
#12 0x4097b5b5 in QWidget::event () from /usr/lib/libqt-mt.so.3
#13 0x408feb53 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#14 0x408fe4c9 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#15 0x405bd77a in KApplication::notify () from /usr/lib/libkdecore.so.4
#16 0x408b4e06 in QETWidget::translateKeyEvent () from /usr/lib/libqt-mt.so.3
#17 0x408b176b in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#18 0x408c2e42 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#19 0x4091031e in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#20 0x4091027b in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#21 0x408fecaa in QApplication::exec () from /usr/lib/libqt-mt.so.3
#22 0x40020544 in main () from /usr/lib/kate.so
#23 0x40edf0bf in __libc_start_main () from /lib/libc.so.6

Comment 4 Hamish Rodda 2003-01-20 02:05:16 UTC
Ok, thanks, now I understand... I'll take a look. 
Comment 5 Hamish Rodda 2003-01-20 04:22:23 UTC
Subject: kdelibs/kate/part

CVS commit by rodda: 

Fix for bug #53100 (100% cpu/incorrect behaviour). Needs a backport after testing.

CCMAIL:53100-done@bugs.kde.org


  M +19 -10    katedocument.cpp   1.415
  M +1 -1      katedocument.h   1.166
  M +14 -9     kateviewinternal.cpp   1.166