Bug 177905 - Crash after switching from block selection to line selection and moving cursor with arrows
Summary: Crash after switching from block selection to line selection and moving curso...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 174176 178474 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-16 15:35 UTC by Albert Deuzeman
Modified: 2008-12-28 20:28 UTC (History)
2 users (show)

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 Albert Deuzeman 2008-12-16 15:35:15 UTC
Version:            (using KDE 4.1.3)
OS:                Linux
Installed from:    Ubuntu Packages

To reproduce this bug, switch to block selection mode and put the cursor in any position that would be 'unreachable' in line selection mode. Now switch back to line selection and attempt to move the cursor using the arrow keys. On my system, this will invariably crash Kate.

/***/

Application: Kate (kate), signal SIGABRT
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0x7f9b422c66f0 (LWP 29483)]
[KCrash handler]
#5  0x00007f9b41b94fd5 in raise () from /lib/libc.so.6
#6  0x00007f9b41b96b43 in abort () from /lib/libc.so.6
#7  0x00007f9b4054d6b5 in qt_message_output () from /usr/lib/libQtCore.so.4
#8  0x00007f9b4054d7fd in qFatal () from /usr/lib/libQtCore.so.4
#9  0x00007f9b371adc20 in KateViewInternal::moveChar (this=0xf839d0, 
    bias=KateViewInternal::left, sel=false)
    at /build/buildd/kde4libs-4.1.3/kate/view/kateviewinternal.cpp:792
#10 0x00007f9b37196165 in KateView::qt_metacall (this=0xd71740, 
    _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, 
    _a=0x7fff4a2f5e80)
    at /build/buildd/kde4libs-4.1.3/obj-x86_64-linux-gnu/kate/kateview.moc:334
#11 0x00007f9b40652134 in QMetaObject::activate ()
   from /usr/lib/libQtCore.so.4
#12 0x00007f9b40f41f57 in QAction::triggered () from /usr/lib/libQtGui.so.4
#13 0x00007f9b40f42720 in QAction::activate () from /usr/lib/libQtGui.so.4
#14 0x00007f9b40f45d17 in QAction::event () from /usr/lib/libQtGui.so.4
#15 0x00007f9b40f9eb63 in QWidgetAction::event () from /usr/lib/libQtGui.so.4
#16 0x00007f9b40f47c3d in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#17 0x00007f9b40f4f9ba in QApplication::notify () from /usr/lib/libQtGui.so.4
#18 0x00007f9b3ed1bfcb in KApplication::notify (this=0x7fff4a2f7a10, 
    receiver=0x10e93c0, event=0x7fff4a2f63a0)
    at /build/buildd/kde4libs-4.1.3/kdeui/kernel/kapplication.cpp:311
#19 0x00007f9b4063dd61 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#20 0x00007f9b40f7d20d in ?? () from /usr/lib/libQtGui.so.4
#21 0x00007f9b40f7eb3c in ?? () from /usr/lib/libQtGui.so.4
#22 0x00007f9b40f509e2 in QApplication::notify () from /usr/lib/libQtGui.so.4
#23 0x00007f9b3ed1bfcb in KApplication::notify (this=0x7fff4a2f7a10, 
    receiver=0xf839d0, event=0x7fff4a2f68a0)
    at /build/buildd/kde4libs-4.1.3/kdeui/kernel/kapplication.cpp:311
#24 0x00007f9b4063dd61 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#25 0x00007f9b40fd65c4 in ?? () from /usr/lib/libQtGui.so.4
#26 0x00007f9b40fd88a7 in ?? () from /usr/lib/libQtGui.so.4
#27 0x00007f9b40fb2390 in QApplication::x11ProcessEvent ()
   from /usr/lib/libQtGui.so.4
#28 0x00007f9b40fda2c4 in ?? () from /usr/lib/libQtGui.so.4
#29 0x00007f9b3dbb0d3b in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
#30 0x00007f9b3dbb450d in ?? () from /usr/lib/libglib-2.0.so.0
#31 0x00007f9b3dbb46cb in g_main_context_iteration ()
   from /usr/lib/libglib-2.0.so.0
#32 0x00007f9b4066615f in QEventDispatcherGlib::processEvents ()
   from /usr/lib/libQtCore.so.4
#33 0x00007f9b40fd9a6f in ?? () from /usr/lib/libQtGui.so.4
#34 0x00007f9b4063c682 in QEventLoop::processEvents ()
   from /usr/lib/libQtCore.so.4
#35 0x00007f9b4063c80d in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#36 0x00007f9b4063ecbd in QCoreApplication::exec ()
   from /usr/lib/libQtCore.so.4
#37 0x00007f9b41ed8d15 in kdemain () from /usr/lib/libkdeinit4_kate.so
#38 0x00007f9b41b80466 in __libc_start_main () from /lib/libc.so.6
#39 0x0000000000400659 in _start ()
#0  0x00007f9b41c0a5f0 in __nanosleep_nocancel () from /lib/libc.so.6
Comment 1 Erlend Hamberg 2008-12-16 15:54:51 UTC
I can confirm this. The problem seems to be in view/kateview.cpp in the method KateView::setBlockSelectionMode, line 2099:

if(!blockSelectionMode() && !m_viewInternal->getCursor().isValid())

m_viewInternal->getCursor().isValid() returns true, even if the cursor is at an "invalid" position. Does anyone know why?
Comment 2 Erlend Hamberg 2008-12-16 16:23:22 UTC
oh, isValid() just checks that line and coumns is >= 0. makes sense.
so i guess that the cursor should be moved to the last column of the current line when leaving block selection mode. i'll fix that.
Comment 3 Erlend Hamberg 2008-12-16 16:25:54 UTC
SVN commit 897671 by ehamberg:

Fix crash when leaving block select mode

BUG: 177905

 M  +8 -4      kateview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=897671
Comment 4 Erlend Hamberg 2008-12-16 16:50:12 UTC
SVN commit 897682 by ehamberg:

Fix crash when leaving block select mode

BUG: 177905



 M  +8 -4      kateview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=897682
Comment 5 Dominik Haumann 2008-12-16 19:12:59 UTC
*** Bug 174176 has been marked as a duplicate of this bug. ***
Comment 6 Dario Andres 2008-12-22 23:01:17 UTC
*** Bug 178474 has been marked as a duplicate of this bug. ***