[konsole] [Bug 474961] [PATCH] Crash while selecting scrolling text

Charles Samuels bugzilla_noreply at kde.org
Fri Sep 29 17:26:47 BST 2023


https://bugs.kde.org/show_bug.cgi?id=474961

Charles Samuels <charles at derkarl.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Crash while selecting       |[PATCH] Crash while
                   |scrolling text              |selecting scrolling text

--- Comment #1 from Charles Samuels <charles at derkarl.org> ---
Backtrace with debug information:

```
#7  0x00000000061ea0d8 in __cxa_throw () from
/lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00000000061e126d in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x00000000049784b3 in std::vector<QVector<Konsole::Character>,
std::allocator<QVector<Konsole::Character> > >::_M_range_check (this=0xd830870,
__n=37) at /usr/include/c++/12/bits/stl_vector.h:1153
#10 0x0000000004975109 in std::vector<QVector<Konsole::Character>,
std::allocator<QVector<Konsole::Character> > >::at (
    this=0xd830870, __n=37) at /usr/include/c++/12/bits/stl_vector.h:1175
#11 0x000000000496f6d6 in Konsole::Screen::setSelectionEnd (this=0xd830860,
x=50, y=10036, trimTrailingWhitespace=false)
    at /home/charles/tmp/konsole-22.12.3/src/Screen.cpp:1815
#12 0x00000000049816b6 in Konsole::ScreenWindow::setSelectionEnd
(this=0x1d198b00, column=50, line=35, 
    trimTrailingWhitespace=false) at
/home/charles/tmp/konsole-22.12.3/src/ScreenWindow.cpp:145
#13 0x0000000004a0f77b in Konsole::TerminalDisplay::extendSelection
(this=0x1cf8f5c0, position=...)
    at
/home/charles/tmp/konsole-22.12.3/src/terminalDisplay/TerminalDisplay.cpp:1469
#14 0x0000000004a0e91e in Konsole::TerminalDisplay::mouseMoveEvent
(this=0x1cf8f5c0, ev=0x1ffefff180)
    at
/home/charles/tmp/konsole-22.12.3/src/terminalDisplay/TerminalDisplay.cpp:1306
#15 0x0000000004f45db8 in QWidget::event(QEvent*) () from
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x0000000004a16641 in Konsole::TerminalDisplay::event (this=0x1cf8f5c0,
event=0x1ffefff180)
    at
/home/charles/tmp/konsole-22.12.3/src/terminalDisplay/TerminalDisplay.cpp:2877
#17 0x0000000004f03fae in QApplicationPrivate::notify_helper(QObject*, QEvent*)
()
   from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x0000000004f0c552 in QApplication::notify(QObject*, QEvent*) () from
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x0000000005e9f6f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
()
   from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x0000000004f0a65e in QApplicationPrivate::sendMouseEvent(QWidget*,
QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) ()
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x0000000004f5ebd8 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x0000000004f61f60 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
```

Fix:
```
--- Screen.cpp.old      2023-09-29 09:26:08.557129473 -0700
+++ Screen.cpp  2023-09-29 09:26:12.257118245 -0700
@@ -1809,7 +1809,7 @@
         }

         // HACK: do not crash.
-        if (_screenLines.size() < line) {
+        if (_screenLines.size() <= line) {
             line = _screenLines.size() - 1;
         }
         const int length = _screenLines.at(line).count();
```

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list