Bug 385864 - Crash when changing foreground color after creating new document
Summary: Crash when changing foreground color after creating new document
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Color Selectors (show other bugs)
Version: 3.3.1
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 386208 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-10-17 14:41 UTC by Amir Adar
Modified: 2017-11-09 16:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Memcheck log (577.21 KB, text/plain)
2017-11-09 14:57 UTC, Halla Rempt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amir Adar 2017-10-17 14:41:23 UTC
Steps to reproduce:

1. Make sure that the foreground and background color are set to default (black/white).

2. Close and reopen Krita.

3. Create a new file.

4. Click on the foreground color.

5. Try to modify the number in the red/green/blue fields. The program crashes.
Comment 1 Halla Rempt 2017-11-09 14:48:22 UTC
Yes, I can reproduce:

Thread 1 (Thread 0x7fe6e1a13940 (LWP 8562)):
[KCrash Handler]
#6  0x00007fe6d836e9fa in QWidget::testAttribute_helper(Qt::WidgetAttribute) const () from /usr/lib64/libQt5Widgets.so.5
#7  0x00007fe6d837a7f9 in QWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection) () from /usr/lib64/libQt5Widgets.so.5
#8  0x00007fe6d8481e35 in QLineEdit::keyPressEvent(QKeyEvent*) () from /usr/lib64/libQt5Widgets.so.5
#9  0x00007fe6d838407a in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#10 0x00007fe6d8487615 in QLineEdit::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#11 0x00007fe6d84d7118 in QAbstractSpinBox::keyPressEvent(QKeyEvent*) () from /usr/lib64/libQt5Widgets.so.5
#12 0x00007fe6d838407a in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#13 0x00007fe6d84d9f8d in QAbstractSpinBox::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#14 0x00007fe6d8348cbc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#15 0x00007fe6d834f94c in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#16 0x00007fe6e1341e07 in KisApplication::notify (this=<optimized out>, receiver=0x80a6ca0, event=0x7ffdd41e95d0) at /home/boud/dev/3.3/libs/ui/KisApplication.cpp:573
#17 0x00007fe6d740cd25 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#18 0x00007fe6d839f26b in QWidgetWindow::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#19 0x00007fe6d8348cbc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#20 0x00007fe6d834fa10 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#21 0x00007fe6e1341e07 in KisApplication::notify (this=<optimized out>, receiver=0x17ab1030, event=0x7ffdd41e95d0) at /home/boud/dev/3.3/libs/ui/KisApplication.cpp:573
#22 0x00007fe6d740cd25 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#23 0x00007fe6d79cd9d0 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /usr/lib64/libQt5Gui.so.5
#24 0x00007fe6d79d23a5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib64/libQt5Gui.so.5
#25 0x00007fe6d79b08ab in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Gui.so.5
#26 0x00007fe6cb88a5b0 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib64/libQt5XcbQpa.so.5
#27 0x00007fe6d2800134 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#28 0x00007fe6d2800388 in ?? () from /usr/lib64/libglib-2.0.so.0
#29 0x00007fe6d280042c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#30 0x00007fe6d745ddbc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#31 0x00007fe6d740b01b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#32 0x00007fe6d74135e4 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#33 0x000000000040582b in main (argc=1, argv=<optimized out>) at /home/boud/dev/3.3/krita/main.cc:302
Comment 2 Halla Rempt 2017-11-09 14:48:32 UTC
*** Bug 386208 has been marked as a duplicate of this bug. ***
Comment 3 Halla Rempt 2017-11-09 14:57:55 UTC
Created attachment 108762 [details]
Memcheck log
Comment 4 Halla Rempt 2017-11-09 16:04:25 UTC
Git commit a0d408f601d04e7e35e0d6fe8076da48661549bb by Boudewijn Rempt.
Committed on 09/11/2017 at 16:01.
Pushed by rempt into branch 'krita/3.3'.

Update the color selector dialog on showing it

If the fg or bg color hasn't been set at least once, the color
selector dialog would use the dummy internal KoColor and its
colorspace, which is rgb16. Then, on changing the color using
the spinboxes, a the current colorspace would change if the
document wasn't rgb16; the spinbox would be deleted and Krita
would crash.

This change initializes the dialog to the correct colorspace on
showing it, and moves the deletion of the spinboxes to the event
queue, using deleteLater.
Related: bug 386066

M  +6    -0    libs/ui/dialogs/kis_dlg_internal_color_selector.cpp
M  +6    -0    libs/ui/dialogs/kis_dlg_internal_color_selector.h
M  +7    -4    libs/ui/widgets/KoDualColorButton.cpp
M  +32   -18   libs/ui/widgets/kis_spinbox_color_selector.cpp

https://commits.kde.org/krita/a0d408f601d04e7e35e0d6fe8076da48661549bb
Comment 5 Halla Rempt 2017-11-09 16:11:17 UTC
Git commit a208d7d9c6fa060ff0bd09128214daca80bf5637 by Boudewijn Rempt.
Committed on 09/11/2017 at 16:11.
Pushed by rempt into branch 'master'.

Update the color selector dialog on showing it

If the fg or bg color hasn't been set at least once, the color
selector dialog would use the dummy internal KoColor and its
colorspace, which is rgb16. Then, on changing the color using
the spinboxes, a the current colorspace would change if the
document wasn't rgb16; the spinbox would be deleted and Krita
would crash.

This change initializes the dialog to the correct colorspace on
showing it, and moves the deletion of the spinboxes to the event
queue, using deleteLater.
Related: bug 386066

M  +6    -0    libs/ui/dialogs/kis_dlg_internal_color_selector.cpp
M  +6    -0    libs/ui/dialogs/kis_dlg_internal_color_selector.h
M  +7    -4    libs/ui/widgets/KoDualColorButton.cpp
M  +31   -17   libs/ui/widgets/kis_spinbox_color_selector.cpp

https://commits.kde.org/krita/a208d7d9c6fa060ff0bd09128214daca80bf5637