Bug 501191 - Konsole crash when double clicking on vertical scroll bar
Summary: Konsole crash when double clicking on vertical scroll bar
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (other bugs)
Version First Reported In: master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-07 15:29 UTC by Jonathan Marten
Modified: 2025-03-07 20:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Marten 2025-03-07 15:29:15 UTC
SUMMARY

Double clicking anywhere on the Konsole scroll bar causes a crash.  This does not seem to be related to the scrollbar position or how much text is displayed, the same happens in an empty window.  DrKonqi does not start, but the backtrace from gdb is:

Thread 1 "konsole" received signal SIGSEGV, Segmentation fault.
#0  0x00007ffff52c8028 in QRasterPaintEngine::opacityChanged() [clone .cold] ()
   from /usr/lib64/libQt6Gui.so.6
#1  0x00007ffff7e0ae30 in Konsole::TerminalScrollBar::paintEvent (this=0x555555f14840, 
    event=0x7fffffffc430)
    at konsole/src/terminalDisplay/TerminalScrollBar.cpp:291
#2  0x00007ffff5ee60f2 in QWidget::event(QEvent*) () from /usr/lib64/libQt6Widgets.so.6
#3  0x00007ffff5ed6625 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib64/libQt6Widgets.so.6
#4  0x00007ffff4d00012 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib64/libQt6Core.so.6
#5  0x00007ffff5eb4a79 in QWidgetPrivate::sendPaintEvent(QRegion const&) ()
   from /usr/lib64/libQt6Widgets.so.6
#6  0x00007ffff5ebbade in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /usr/lib64/libQt6Widgets.so.6
#7  0x00007ffff5ebd62e in QWidgetRepaintManager::paintAndFlush() () from /usr/lib64/libQt6Widgets.so.6
#8  0x00007ffff5ee5906 in QWidget::event(QEvent*) () from /usr/lib64/libQt6Widgets.so.6
#9  0x00007ffff72ca0ae in KXmlGuiWindow::event (this=0x7fffe80090c0, ev=0x555555dcd200)
    at kxmlgui/src/kxmlguiwindow.cpp:253
#10 0x00007ffff5ed6625 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib64/libQt6Widgets.so.6
#11 0x00007ffff4d00012 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib64/libQt6Core.so.6
#12 0x00007ffff4d27dd0 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib64/libQt6Core.so.6
#13 0x00007ffff4ac2ef7 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) ()
   from /usr/lib64/libQt6Core.so.6
#14 0x00007fffef5723dc in g_main_dispatch () from /usr/lib64/libglib-2.0.so.0
#15 0x00007fffef575767 in g_main_context_iterate_unlocked.isra () from /usr/lib64/libglib-2.0.so.0
#16 0x00007fffef575dd0 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#17 0x00007ffff4ab8510 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/libQt6Core.so.6
#18 0x00007ffff4d28b9a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/libQt6Core.so.6
#19 0x00007ffff4d28eb7 in QCoreApplication::exec() () from /usr/lib64/libQt6Core.so.6
#20 0x000055555555958a in main (argc=<optimized out>, argv=<optimized out>)
    at konsole/src/main.cpp:260

The code line in frame #1 is 
        p.setOpacity(0.75);

STEPS TO REPRODUCE

1.   Open a new Konsole window
2.   Double click anywhere on the vertical scroll bar.

SOFTWARE/OS VERSIONS

Operating System: Gentoo 2.17
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.1
Kernel Version: 6.6.47-gentoo-x86_64 (64-bit)
Graphics Platform: X11
Processors: 3 × AMD Phenom(tm) II X3 705e Processor
Memory: 15.6 GiB of RAM

ADDITIONAL INFORMATION

Git bisection identifies the problem commit as e389807d, "Implement scrollbar highlighting for search results"

Settings in Edit Profile - Scrolling are:
Scrollback    Fixed size 10000 lines
Page Up/Down: Half screen height
Position: Right side
Highlighting: on
Reflow Lines: on
Colour of markers: default (#ff0000)
Size of marker: default (2%)
Colour of search highlights: default (#ffff00)
Search highlighting opacity: default (halfway along slider)
Comment 1 Bug Janitor Service 2025-03-07 19:43:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/1081
Comment 2 Jonathan Marten 2025-03-07 20:07:03 UTC
Git commit 58d5c687fb5e499c720b1b4e15544c4d0c7281bd by Jonathan Marten.
Committed on 07/03/2025 at 19:15.
Pushed by hindenburg into branch 'master'.

Fix crash when double clicking on terminal scroll bar

Only one QPainter can be active at a time, and QScrollBar's paint event
will use its own internally.  So call the base class before doing any of
our own painting.  As a side effect, this means that the search markers
(originally painted first) are not overwritten by the main scroll bar,
and both those and position markers are shown.

M  +3    -4    src/terminalDisplay/TerminalScrollBar.cpp

https://invent.kde.org/utilities/konsole/-/commit/58d5c687fb5e499c720b1b4e15544c4d0c7281bd