Bug 392869

Summary: Segfault when creating new spray preset
Product: [Applications] krita Reporter: Nicholas LaPointe <nicholaslapointe8>
Component: Brush enginesAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: antti.savo
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Nicholas LaPointe 2018-04-08 10:16:13 UTC
Attempting to create a new spray engine preset using the menu in the bottom-left of the presets popup will cause a segmentation fault.

Tested in:
4.1.0-pre-alpha (git aa81a25)
4.0.0 (git c45c4c5)


Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
KoResource::image (this=0x0) at src/krita/libs/pigment/resources/KoResource.cpp:71
71	    return d->image;
(gdb) bt
#0  KoResource::image (this=0x0) at src/krita/libs/pigment/resources/KoResource.cpp:71
#1  0x00007fb4ccf86415 in KisPresetLivePreviewView::setupAndPaintStroke (this=this@entry=0x9bf0590) at src/krita/libs/ui/widgets/kis_preset_live_preview_view.cpp:214
#2  0x00007fb4ccf873c1 in KisPresetLivePreviewView::updateStroke (this=0x9bf0590) at src/krita/libs/ui/widgets/kis_preset_live_preview_view.cpp:85
#3  0x00007fb4ccf46987 in KisPaintOpPresetsPopup::slotUpdatePresetSettings (this=this@entry=0x9bce3e0) at src/krita/libs/ui/widgets/kis_paintop_presets_popup.cpp:846
#4  0x00007fb4ccf48526 in KisPaintOpPresetsPopup::resourceSelected (this=0x9bce3e0, resource=0xa78efc0) at src/krita/libs/ui/widgets/kis_paintop_presets_popup.cpp:583
#5  0x00007fb4cce27afb in KisPaintopBox::slotCreatePresetFromScratch (this=0x9b39f70, paintop=...) at src/krita/libs/ui/kis_paintop_box.cc:829
#6  0x00007fb4cd10b44f in KisPaintopBox::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at builds/krita_standard/libs/ui/moc_kis_paintop_box.cpp:237
#7  0x00007fb4cb3a2cc9 in QMetaObject::activate(QObject*, int, int, void**) () from /opt/Qt-5.9/lib/libQt5Core.so.5
#8  0x00007fb4cd1033b5 in KisPaintOpPresetsPopup::createPresetFromScratch (this=this@entry=0x9bce3e0, _t1=...)
    at builds/krita_standard/libs/ui/moc_kis_paintop_presets_popup.cpp:432
#9  0x00007fb4ccf461c7 in KisPaintOpPresetsPopup::slotCreateNewBrushPresetEngine (this=0x9bce3e0) at src/krita/libs/ui/widgets/kis_paintop_presets_popup.cpp:762
#10 0x00007fb4cd10424d in KisPaintOpPresetsPopup::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at builds/krita_standard/libs/ui/moc_kis_paintop_presets_popup.cpp:218
#11 0x00007fb4cb3a2cc9 in QMetaObject::activate(QObject*, int, int, void**) () from /opt/Qt-5.9/lib/libQt5Core.so.5
#12 0x00007fb4cbce1f22 in QAction::triggered(bool) () from /opt/Qt-5.9/lib/libQt5Widgets.so.5
#13 0x00007fb4cbce4630 in QAction::activate(QAction::ActionEvent) () from /opt/Qt-5.9/lib/libQt5Widgets.so.5
Comment 1 Antti Savolainen 2018-04-08 17:38:13 UTC
Confirming this https://webmshare.com/LPNgO

Build Date & Platform:

    krita 4.1.0-pre-alpha
    Xubuntu 17.10
    Krita Lime https://launchpad.net/~kritalime/+archive/ubuntu/ppa


Additional Information: Any other useful information. 

     https://webmshare.com/LPNgO Recorded video of said crash

     Couldn't get a personal stacktrace. gdb freezes my desktop.
Comment 2 Halla Rempt 2018-04-09 08:18:21 UTC
Git commit b8e85a372778aced2ecf45b2f3cfe7df601d4cd3 by Boudewijn Rempt.
Committed on 09/04/2018 at 08:18.
Pushed by rempt into branch 'master'.

Fix crash when creating a new spray preset

M  +46   -44   libs/ui/widgets/kis_preset_live_preview_view.cpp

https://commits.kde.org/krita/b8e85a372778aced2ecf45b2f3cfe7df601d4cd3
Comment 3 Halla Rempt 2018-04-09 08:59:23 UTC
Git commit 7c6a7c25ccac211aed9e017a8e7f5f375388cceb by Boudewijn Rempt.
Committed on 09/04/2018 at 08:57.
Pushed by rempt into branch 'krita/4.0'.

Fix crash when creating a new spray preset
(cherry picked from commit b8e85a372778aced2ecf45b2f3cfe7df601d4cd3)

M  +46   -44   libs/ui/widgets/kis_preset_live_preview_view.cpp

https://commits.kde.org/krita/7c6a7c25ccac211aed9e017a8e7f5f375388cceb
Comment 4 Dmitry Kazakov 2018-04-09 13:50:12 UTC
Git commit 5cbd4c8cdfca83c5c3e01c7f081724a3fcb85f10 by Dmitry Kazakov.
Committed on 09/04/2018 at 13:49.
Pushed by dkazakov into branch 'master'.

Fix update of the preset editor GUI when a default preset is created

Summary:
Before the patch, preset editor's GUI was set to the previous
paintop type, which was incorrect. I'm not entirely sure that
this fix is correct, so putting it for review.

Test Plan:
1) Press "New default preset"
2) See that the GUI updated correctly

Questions:
1) Is it really default preset got loaded? Or something else?

Reviewers: #krita, scottpetrovic

Differential Revision: https://phabricator.kde.org/D12065

M  +3    -1    libs/ui/kis_paintop_box.cc

https://commits.kde.org/krita/5cbd4c8cdfca83c5c3e01c7f081724a3fcb85f10
Comment 5 Dmitry Kazakov 2018-05-07 07:55:46 UTC
Git commit 69a4f5f459e76181aff70eab4eb8408d9ba0573a by Dmitry Kazakov.
Committed on 07/05/2018 at 07:47.
Pushed by dkazakov into branch 'krita/4.0'.

Fix update of the preset editor GUI when a default preset is created

Summary:
Before the patch, preset editor's GUI was set to the previous
paintop type, which was incorrect. I'm not entirely sure that
this fix is correct, so putting it for review.

Test Plan:
1) Press "New default preset"
2) See that the GUI updated correctly

Questions:
1) Is it really default preset got loaded? Or something else?

Reviewers: #krita, scottpetrovic

Differential Revision: https://phabricator.kde.org/D12065

M  +3    -1    libs/ui/kis_paintop_box.cc

https://commits.kde.org/krita/69a4f5f459e76181aff70eab4eb8408d9ba0573a