Bug 418587 - Assert when using the 'end' key while the zoom widget is focussed.
Summary: Assert when using the 'end' key while the zoom widget is focussed.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Shortcuts and Canvas Input Settings (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: wolthera
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-07 18:04 UTC by wolthera
Modified: 2020-03-23 13:31 UTC (History)
1 user (show)

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 wolthera 2020-03-07 18:04:34 UTC
SUMMARY
I got this while I tried to press metakey+right, but instead pressed fn+right, meaning the 'end' keycode was invoked. The zoom widget happened to be in focus.

This is in the resource branch, btw, but we must be doing something funny here.

STEPS TO REPRODUCE
1. focus zoom widget in the statusbar
2. press 'end'
3. get assert.


GDB Backtrace
=================================================
Thread 1 (Thread 0x7ffff7f88800 (LWP 10980)):
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff26e2801 in __GI_abort () at abort.c:79
#2  0x00007ffff30bacbb in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff30ba50b in qt_assert_x(char const*, char const*, char const*, int) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff0da925b in QList<double>::operator[] (this=0x555560ac6a00, i=21)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:568
#5  0x00007ffff0da7d54 in KoZoomAction::sliderValueChanged (this=0x555562ff7830, value=21)
    at /home/wolthera/krita/src/libs/widgets/KoZoomAction.cpp:224
#6  0x00007ffff0e38a42 in KoZoomAction::qt_static_metacall (_o=0x555562ff7830, _c=QMetaObject::InvokeMetaMethod, _id=17, 
    _a=0x7fffffffd2f0) at /home/wolthera/krita/build/libs/widgets/kritawidgets_autogen/EWIEGA46WW/moc_KoZoomAction.cpp:173
#7  0x00007ffff32f4805 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff0e3991d in KoZoomWidget::sliderValueChanged (this=0x55556334fc00, _t1=21)
    at /home/wolthera/krita/build/libs/widgets/kritawidgets_autogen/EWIEGA46WW/moc_KoZoomWidget.cpp:204
#9  0x00007ffff0e394b3 in KoZoomWidget::qt_static_metacall (_o=0x55556334fc00, _c=QMetaObject::InvokeMetaMethod, _id=0, 
    _a=0x7fffffffd4a0) at /home/wolthera/krita/build/libs/widgets/kritawidgets_autogen/EWIEGA46WW/moc_KoZoomWidget.cpp:109
#10 0x00007ffff32f4805 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff41b655e in QAbstractSlider::valueChanged(int) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007ffff41b6bdb in QAbstractSlider::setValue(int) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007ffff410a4e7 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ffff425fcda in QSlider::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff40c8eac in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff40d1562 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff6b79279 in KisApplication::notify (this=0x7fffffffe120, receiver=0x55555f53d090, event=0x7fffffffdca0)
    at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:705
#18 0x00007ffff32c3e38 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007ffff4127635 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007ffff40c8eac in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff40d04b0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff6b79279 in KisApplication::notify (this=0x7fffffffe120, receiver=0x55555dc4b470, event=0x7fffffffdca0)
    at /home/wolthera/krita/src/libs/ui/KisApplication.cpp:705
#23 0x00007ffff32c3e38 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007ffff3893c5b in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#25 0x00007ffff38985c5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#26 0x00007ffff387279b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#27 0x00007fffe2d1cdda in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#28 0x00007fffe9f6f417 in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007fffe9f6f650 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007fffe9f6f6dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
Comment 1 Halla Rempt 2020-03-08 10:54:58 UTC
That's

    setZoom(d->sliderLookup[value]);

in KoZoomAction

Best would be to just check whether value is in the sliderLookup list before accessing it (and checking other places where this is done).

I'm assigning the bug to you :)
Comment 2 Halla Rempt 2020-03-17 10:46:25 UTC
Git commit e7cd22e0c3067009a1292e8b336c53aac589124b by Boudewijn Rempt.
Committed on 17/03/2020 at 10:42.
Pushed by rempt into branch 'master'.

Fix a crash in the zoomn slider

Don't access a list out of bounds

M  +4    -3    libs/widgets/KoZoomAction.cpp

https://invent.kde.org/kde/krita/commit/e7cd22e0c3067009a1292e8b336c53aac589124b
Comment 3 Halla Rempt 2020-03-17 10:53:19 UTC
Git commit f71d208167fc742284f3d65d96eb810979a56724 by Boudewijn Rempt.
Committed on 17/03/2020 at 10:52.
Pushed by rempt into branch 'master'.

Fix the crash in the zoom slider correctly

M  +1    -1    libs/widgets/KoZoomAction.cpp

https://invent.kde.org/kde/krita/commit/f71d208167fc742284f3d65d96eb810979a56724
Comment 4 Halla Rempt 2020-03-23 13:31:57 UTC
Git commit e4035670e5916e0c6ad4fc561b18a9f6d9c970ed by Boudewijn Rempt.
Committed on 23/03/2020 at 13:04.
Pushed by rempt into branch 'krita/4.2'.

Fix a crash in the zoomn slider

Don't access a list out of bounds

(cherry picked from commit e7cd22e0c3067009a1292e8b336c53aac589124b)

M  +4    -3    libs/widgets/KoZoomAction.cpp

https://invent.kde.org/kde/krita/commit/e4035670e5916e0c6ad4fc561b18a9f6d9c970ed
Comment 5 Halla Rempt 2020-03-23 13:31:57 UTC
Git commit 6164db0cfff1a9b2d068c8299eacd6cf53725193 by Boudewijn Rempt.
Committed on 23/03/2020 at 13:04.
Pushed by rempt into branch 'krita/4.2'.

Fix the crash in the zoom slider correctly
(cherry picked from commit f71d208167fc742284f3d65d96eb810979a56724)

M  +1    -1    libs/widgets/KoZoomAction.cpp

https://invent.kde.org/kde/krita/commit/6164db0cfff1a9b2d068c8299eacd6cf53725193