Bug 520581 - Crash on Canvas Input -> Rotate Canvas -> Key Combination for Rotate Mode
Summary: Crash on Canvas Input -> Rotate Canvas -> Key Combination for Rotate Mode
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Shortcuts and Canvas Input Settings (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Tiar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-05-23 22:01 UTC by Tiar
Modified: 2026-06-20 18:54 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2026-05-23 22:01:01 UTC
DESCRIPTION
Krita crashes on null pointer when trying to get the posF() of the event that apparently doesn't exist.

STEPS TO REPRODUCE
1. Go to Canvas Input Settings -> Rotate Canvas
2. Add Key Combination -> Ctrl + R
3. Use it on the canvas

OBSERVED RESULT
Crash (segfault on null pointer)

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
KisAbstractInputAction::eventPosF (this=0x555557d645c0, event=0x0) at /home/appimage/persistent/krita/libs/ui/input/kis_abstract_input_action.cpp:217
217	    switch (event->type()) {
(gdb) bt
#0  KisAbstractInputAction::eventPosF (this=0x555557d645c0, event=0x0) at /home/appimage/persistent/krita/libs/ui/input/kis_abstract_input_action.cpp:217
#1  0x00007ffff7ab00a6 in KisRotateCanvasAction::begin (this=0x555557d645c0, shortcut=<optimized out>, event=0x0) at /home/appimage/persistent/krita/libs/ui/input/kis_rotate_canvas_action.cpp:103
#2  0x00007ffff7ac001c in KisShortcutMatcher::tryRunSingleActionShortcutImpl<Qt::Key, QEvent> (this=this@entry=0x555556bf1580, param=param@entry=Qt::Key_R, event=event@entry=0x0, keysState=..., keyboard=keyboard@entry=true) at /home/appimage/persistent/krita/libs/ui/input/kis_shortcut_matcher.cpp:834
#3  0x00007ffff7abe3a8 in KisShortcutMatcher::keyPressed (this=0x555556bf1580, key=key@entry=Qt::Key_R) at /home/appimage/persistent/krita/libs/ui/input/kis_shortcut_matcher.cpp:217
#4  0x00007ffff7a986cb in KisInputManager::eventFilterImpl (this=0x555557d5e998, event=<optimized out>) at /home/appimage/persistent/krita/libs/ui/input/kis_input_manager.cpp:451
#5  0x00007ffff54f1caa in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Core.so.5
#6  0x00007ffff61177d2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Widgets.so.5
#7  0x00007ffff611f5a6 in QApplication::notify(QObject*, QEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Widgets.so.5
#8  0x00007ffff7b7cc95 in KisApplication::notify (this=0x7fffffffe730, receiver=0x555557c772b0, event=0x7fffffffdfb0) at /home/appimage/persistent/krita/libs/ui/KisApplication.cpp:920
#9  0x00007ffff54f1f4a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Core.so.5
#10 0x00007ffff6177abf in ?? () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Widgets.so.5
#11 0x00007ffff61177e3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Widgets.so.5
#12 0x00007ffff7b7cc95 in KisApplication::notify (this=0x7fffffffe730, receiver=0x555557df5010, event=0x7fffffffdfb0) at /home/appimage/persistent/krita/libs/ui/KisApplication.cpp:920
#13 0x00007ffff54f1f4a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Core.so.5
#14 0x00007ffff59239aa in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Gui.so.5
#15 0x00007ffff58fbd25 in bool QWindowSystemInterfacePrivate::handleWindowSystemEvent<QWindowSystemInterface::SynchronousDelivery>(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Gui.so.5
#16 0x00007ffff58fece6 in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Gui.so.5
#17 0x00007ffff59238cf in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Gui.so.5
#18 0x00007ffff58fb82c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Gui.so.5
#19 0x00007ffff00a53ee in ?? () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5XcbQpa.so.5
#20 0x00007ffff268d17d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007ffff268d400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffff268d4a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007ffff554ba58 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Core.so.5
#24 0x00007ffff54f085b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Core.so.5
#25 0x00007ffff54f8e14 in QCoreApplication::exec() () from /home/appimage/appimage-workspace/deps/usr/lib/libQt5Core.so.5
#26 0x000055555555e6bd in main (argc=<optimized out>, argv=<optimized out>) at /home/appimage/persistent/krita/krita/main.cc:874
Comment 1 Bug Janitor Service 2026-05-23 22:41:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2793
Comment 2 Dmitry Kazakov 2026-06-15 13:43:35 UTC
Git commit afff1cf7c09f8ed14ddeebd629030122d04cbf9e by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 15/06/2026 at 13:42.
Pushed by dkazakov into branch 'master'.

Fix crash on null event pointer in Abstract Input Action

The check in kis_abstract_input_action.cpp is for sure valid
because it happens within
KisShortcutMatcher::tryRunSingleActionShortcutImpl,
and it has a warning that the event can be null.
This commit also includes some more sanity checks that
might be upgraded into KIS_SAFE_ASSERT if needed.

M  +4    -0    libs/ui/input/kis_abstract_input_action.cpp
M  +7    -0    libs/ui/input/kis_pan_action.cpp
M  +4    -0    libs/ui/input/kis_rotate_canvas_action.cpp
M  +3    -0    libs/ui/input/kis_zoom_action.cpp

https://invent.kde.org/graphics/krita/-/commit/afff1cf7c09f8ed14ddeebd629030122d04cbf9e
Comment 3 Dmitry Kazakov 2026-06-15 13:44:40 UTC
Git commit e28a2a8dc2e9925f21d9a1a46a827b6663db0143 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 15/06/2026 at 13:44.
Pushed by dkazakov into branch 'krita/6.0'.

Fix crash on null event pointer in Abstract Input Action

The check in kis_abstract_input_action.cpp is for sure valid
because it happens within
KisShortcutMatcher::tryRunSingleActionShortcutImpl,
and it has a warning that the event can be null.
This commit also includes some more sanity checks that
might be upgraded into KIS_SAFE_ASSERT if needed.

M  +4    -0    libs/ui/input/kis_abstract_input_action.cpp
M  +7    -0    libs/ui/input/kis_pan_action.cpp
M  +4    -0    libs/ui/input/kis_rotate_canvas_action.cpp
M  +3    -0    libs/ui/input/kis_zoom_action.cpp

https://invent.kde.org/graphics/krita/-/commit/e28a2a8dc2e9925f21d9a1a46a827b6663db0143