Summary: | 4.0 + flatpak: Crash when painting | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Peter Eszlari <peter.eszlari> |
Component: | General | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexl, dimula73, halla |
Priority: | NOR | ||
Version: | 4.0 | ||
Target Milestone: | --- | ||
Platform: | Flatpak | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/krita/64d4ac69a2f444dd13d9bcfc8dbc880f26f1e374 | Version Fixed In: | |
Sentry Crash Report: |
Description
Peter Eszlari
2018-03-22 19:53:39 UTC
Hi Peter, I'm sorry -- but there isn't much we can do without a lot more information, like a full backtrace. You could also try to use a different style than breeze. (gdb) bt #0 0x000000381fa3304f in raise () at /lib/libc.so.6 #1 0x000000381fa3447a in abort () at /lib/libc.so.6 #2 0x00007fffee50e044 in () at /lib/libQt5Core.so.5 #3 0x00007fffee50ea01 in () at /lib/libQt5Core.so.5 #4 0x00007fffee5095d5 in qt_int_sqrt(unsigned int) () at /lib/libQt5Core.so.5 #5 0x00007fffef062c22 in QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) () at /lib/libQt5Widgets.so.5 #6 0x00007fffef062d90 in QWidget::QWidget(QWidget*, QFlags<Qt::WindowType>) () at /lib/libQt5Widgets.so.5 #7 0x00007fffcca05b1d in () at /app/lib/libkritalibpaintop.so.16 #8 0x00007fffcca03e4b in KisAirbrushOption::KisAirbrushOption(bool, bool) () at /app/lib/libkritalibpaintop.so.16 #9 0x00007fffcb665514 in () at /app/lib/kritaplugins/kritadefaultpaintops.so #10 0x00007fffcb6648e5 in () at /app/lib/kritaplugins/kritadefaultpaintops.so #11 0x00007ffff5f80b61 in KisPaintOpRegistry::paintOp(QString const&, KisPinnedSharedPtr<KisPaintOpSettings>, KisPainter*, KisSharedPtr<KisNode>, KisSharedPtr<KisImage>) const () at /app/lib/libkritaimage.so.16 #12 0x00007ffff5f81036 in KisPaintOpRegistry::paintOp(KisSharedPtr<KisPaintOpPreset>, KisPainter*, KisSharedPtr<KisNode>, KisSharedPtr<KisImage>) const () at /app/lib/libkritaimage.so.16 #13 0x00007ffff5f5689e in KisPainter::setPaintOpPreset(KisSharedPtr<KisPaintOpPreset>, KisSharedPtr<KisNode>, KisSharedPtr<KisImage>) () at /app/lib/libkritaimage.so.16 #14 0x00007ffff76c7b97 in KisResourcesSnapshot::setupPainter(KisPainter*) () at /app/lib/libkritaui.so.16 #15 0x00007ffff76d3c0b in KisPainterBasedStrokeStrategy::initPainters(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisSelection>, bool, QString const&) () at /app/lib/libkritaui.so.16 #16 0x00007ffff76d4a26 in KisPainterBasedStrokeStrategy::initStrokeCallback() () at /app/lib/libkritaui.so.16 #17 0x00007ffff76ce432 in FreehandStrokeStrategy::initStrokeCallback() () at /app/lib/libkritaui.so.16 #18 0x00007ffff6092412 in () at /app/lib/libkritaimage.so.16 #19 0x00007ffff6099ea2 in () at /app/lib/libkritaimage.so.16 #20 0x00007ffff627099a in () at /app/lib/libkritaimage.so.16 #21 0x00007fffee520e82 in () at /lib/libQt5Core.so.5 #22 0x00007fffee52608a in () at /lib/libQt5Core.so.5 #23 0x0000003820207444 in () at /lib/libpthread.so.0 #24 0x000000381fae827f in clone () at /lib/libc.so.6 Any idea, why there are no line numbers in the backtrace? I compiled with -DCMAKE_BUILD_TYPE=Debug. Maybe flatpak strips the debug info? I figured it out, here is a full backtrace: #0 0x000000381fa3304f in __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.24-r0/git/sysdeps/unix/sysv/linux/raise.c:58 #1 0x000000381fa3447a in __GI_abort () at /usr/src/debug/glibc/2.24-r0/git/stdlib/abort.c:89 #2 0x00007fffee50e044 in qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&) (context=..., message=...) at global/qlogging.cpp:1690 #3 0x00007fffee50ea01 in QMessageLogger::fatal(char const*, ...) const (this=this@entry=0x7fff94ff81e0, msg=msg@entry=0x7fffee79b758 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:796 #4 0x00007fffee5095d5 in qt_assert_x(char const*, char const*, char const*, int) (where=where@entry=0x7fffef3f8f50 "QWidget", what=what@entry=0x7fffef3ef270 "Widgets must be created in the GUI thread.", file=file@entry=0x7fffef3f8d26 "kernel/qwidget.cpp", line=line@entry=1142) at global/qglobal.cpp:3088 #5 0x00007fffef062c22 in QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) (this=0x7fff7800ec70, parentWidget=parentWidget@entry=0x0, f=...) at kernel/qwidget.cpp:1141 #6 0x00007fffef062d90 in QWidget::QWidget(QWidget*, QFlags<Qt::WindowType>) (this=0x7fff7800fdb0, parent=0x0, f=...) at kernel/qwidget.cpp:1031 #7 0x00007fffcca01b1d in KisAirbrushWidget::KisAirbrushWidget(QWidget*, bool) (this=0x7fff7800fdb0, parent=0x0, canIgnoreSpacing=true) at /run/build/krita/plugins/paintops/libpaintop/kis_airbrush_option.cpp:38 #8 0x00007fffcc9ffe4b in KisAirbrushOption::KisAirbrushOption(bool, bool) (this=0x7fff7800ae98, enabled=true, canIgnoreSpacing=true) at /run/build/krita/plugins/paintops/libpaintop/kis_airbrush_option.cpp:68 #9 0x00007fffcb661514 in KisBrushOp::KisBrushOp(KisPinnedSharedPtr<KisPaintOpSettings>, KisPainter*, KisSharedPtr<KisNode>, KisSharedPtr<KisImage>) (this=0x7fff7800ad80, settings=..., painter=0xcc166b0, node=..., image=...) at /run/build/krita/plugins/paintops/defaultpaintops/brush/kis_brushop.cpp:67 #10 0x00007fffcb6608e5 in KisSimplePaintOpFactory<KisBrushOp, KisBrushOpSettings, KisBrushOpSettingsWidget>::createOp(KisPinnedSharedPtr<KisPaintOpSettings>, KisPainter*, KisSharedPtr<KisNode>, KisSharedPtr<KisImage>) (this=0x1c49240, settings=..., painter=0xcc166b0, node=..., image=...) at ../plugins/paintops/libpaintop/kis_simple_paintop_factory.h:94 #11 0x00007ffff5f80b61 in KisPaintOpRegistry::paintOp(QString const&, KisPinnedSharedPtr<KisPaintOpSettings>, KisPainter*, KisSharedPtr<KisNode>, KisSharedPtr<KisImage>) const (this=0x7ffff661d280 <(anonymous namespace)::Q_QGS_s_registryInstance::innerFunction()::holder>, id=..., settings=..., painter=0xcc166b0, node=..., image=...) at /run/build/krita/libs/image/brushengine/kis_paintop_registry.cc:104 #12 0x00007ffff5f81036 in KisPaintOpRegistry::paintOp(KisSharedPtr<KisPaintOpPreset>, KisPainter*, KisSharedPtr<KisNode>, KisSharedPtr<KisImage>) const (this=0x7ffff661d280 <(anonymous namespace)::Q_QGS_s_registryInstance::innerFunction()::holder>, preset=..., painter=0xcc166b0, node=..., image=...) at /run/build/krita/libs/image/brushengine/kis_paintop_registry.cc:120 #13 0x00007ffff5f5689e in KisPainter::setPaintOpPreset(KisSharedPtr<KisPaintOpPreset>, KisSharedPtr<KisNode>, KisSharedPtr<KisImage>) (this=0xcc166b0, preset=..., node=..., image=...) at /run/build/krita/libs/image/kis_painter.cc:2627 #14 0x00007ffff76c7b97 in KisResourcesSnapshot::setupPainter(KisPainter*) (this=0xc8cecf0, painter=0xcc166b0) at /run/build/krita/libs/ui/tool/kis_resources_snapshot.cpp:199 #15 0x00007ffff76d3c0b in KisPainterBasedStrokeStrategy::initPainters(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisSelection>, bool, QString const&) (this= 0x8ba1410, targetDevice=..., maskingDevice=..., selection=..., hasIndirectPainting=true, indirectPaintingCompositeOp=...) at /run/build/krita/libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp:175 #16 0x00007ffff76d4a26 in KisPainterBasedStrokeStrategy::initStrokeCallback() (this=0x8ba1410) at /run/build/krita/libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp:288 #17 0x00007ffff76ce432 in FreehandStrokeStrategy::initStrokeCallback() (this=0x8ba1410) at /run/build/krita/libs/ui/tool/strokes/freehand_stroke.cpp:135 #18 0x00007ffff6092412 in SimpleStrokeJobStrategy::run(KisStrokeJobData*) (this=0xc010270, data=0xc93efe0) at /run/build/krita/libs/image/kis_simple_stroke_strategy.cpp:40 #19 0x00007ffff6099ea2 in KisStrokeJob::run() (this=0xcec1050) at /run/build/krita/libs/image/kis_stroke_job.h:44 #20 0x00007ffff627099a in KisUpdateJobItem::run() (this=0xb8397f0) at /run/build/krita/_flatpak_build/libs/image/kritaimage_automoc.dir/../../../../libs/image/kis_update_job_item.h:90 #21 0x00007fffee520e82 in QThreadPoolThread::run() (this=0xcbf4ca0) at thread/qthreadpool.cpp:99 #22 0x00007fffee52608a in QThreadPrivate::start(void*) (arg=0xcbf4ca0) at thread/qthread_unix.cpp:368 #23 0x0000003820207444 in start_thread (arg=0x7fff94ff9700) at /usr/src/debug/glibc/2.24-r0/git/nptl/pthread_create.c:456 #24 0x000000381fae827f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105 Clearly something is lazily initializing something in a thread, which eventually leads to the construction of a KisBrushOp which has a QWidget member which can't be initialized on a thread. So, at some point in this chain of initializers there is something that needs to be explicitly initialized on the main thread. Not knowing anything about krita I have no idea which that would be though. tested against 4.0.1 -> same backtrace I have a feeling that I used to fix something like that recently for the airbrush tool... but since you say it is still in 4.0.1... Maybe it doesn't crash because most versions of Qt aren't built to abort on asserts. We do create widgets in threads all the time in all our brush engines. Well, something changed, because the same build of Qt worked fine with pre-4 krita. I used git bisect to find the faulty commit: 28f16e0f83741e518c0916598cb2a3032b377a07 is the first bad commit commit 28f16e0f83741e518c0916598cb2a3032b377a07 Author: Allen Marshall <allen.marshall.22@gmail.com> Date: Fri Jun 2 15:54:54 2017 -0500 Performance improvement: Airbrushing no longer reads properties from a KisPropertiesConfiguration during painting. :040000 040000 c03a21c961299bdf2406c787dc99713493fee834 4085f375a485d4ebe43e4dc34d2737e506904d91 M plugins Oh, thanks for finding that! Git commit 76e157502d57b79498083176aa296a90a5da9499 by Boudewijn Rempt. Committed on 11/05/2018 at 08:26. Pushed by rempt into branch 'master'. Rename KisAirbrushOption to KisAirbrushOptionWidget This makes clear that this class is a widget and cannot be created during painting. Now we'll have to split the widget part and the settings part up. We probably should rename all classes that inherit KisPaintOpOption like this, to make the difference clear between the KisPaintOpOption hierarchy. the KisBaseOption hierarchy and the KisCurveOption hierarchy. CCMAIL:allen.marshall.22@gmail.com M +1 -1 plugins/paintops/colorsmudge/kis_colorsmudgeop_settings_widget.cpp M +4 -4 plugins/paintops/defaultpaintops/brush/kis_brushop.cpp M +2 -2 plugins/paintops/defaultpaintops/brush/kis_brushop.h M +2 -2 plugins/paintops/defaultpaintops/brush/kis_brushop_settings_widget.cpp M +3 -3 plugins/paintops/deform/kis_deform_paintop.cpp M +2 -2 plugins/paintops/deform/kis_deform_paintop.h M +1 -1 plugins/paintops/deform/kis_deform_paintop_settings.cpp M +2 -2 plugins/paintops/deform/kis_deform_paintop_settings_widget.cpp M +1 -1 plugins/paintops/libpaintop/CMakeLists.txt R +12 -12 plugins/paintops/libpaintop/kis_airbrush_option_widget.cpp [from: plugins/paintops/libpaintop/kis_airbrush_option.cpp - 084% similarity] R +3 -3 plugins/paintops/libpaintop/kis_airbrush_option_widget.h [from: plugins/paintops/libpaintop/kis_airbrush_option.h - 091% similarity] M +1 -1 plugins/paintops/libpaintop/kis_brush_based_paintop.cpp M +2 -2 plugins/paintops/libpaintop/kis_brush_based_paintop.h M +1 -1 plugins/paintops/libpaintop/kis_brush_based_paintop_settings.cpp M +3 -3 plugins/paintops/libpaintop/kis_paintop_plugin_utils.h M +3 -3 plugins/paintops/particle/kis_particle_paintop.cpp M +2 -2 plugins/paintops/particle/kis_particle_paintop.h M +1 -1 plugins/paintops/particle/kis_particle_paintop_settings.cpp M +2 -2 plugins/paintops/particle/kis_particle_paintop_settings_widget.cpp M +3 -3 plugins/paintops/sketch/kis_sketch_paintop.cpp M +2 -2 plugins/paintops/sketch/kis_sketch_paintop.h M +1 -1 plugins/paintops/sketch/kis_sketch_paintop_settings.cpp M +2 -2 plugins/paintops/sketch/kis_sketch_paintop_settings_widget.cpp M +3 -3 plugins/paintops/spray/kis_spray_paintop.cpp M +2 -2 plugins/paintops/spray/kis_spray_paintop.h M +1 -1 plugins/paintops/spray/kis_spray_paintop_settings.cpp M +2 -2 plugins/paintops/spray/kis_spray_paintop_settings_widget.cpp M +3 -3 plugins/paintops/tangentnormal/kis_tangent_normal_paintop.cpp M +2 -2 plugins/paintops/tangentnormal/kis_tangent_normal_paintop.h M +2 -2 plugins/paintops/tangentnormal/kis_tangent_normal_paintop_settings_widget.cpp https://commits.kde.org/krita/76e157502d57b79498083176aa296a90a5da9499 Git commit 39e5b30dac0db2108e87196d45e0703bf3a7cdeb by Boudewijn Rempt. Committed on 15/05/2018 at 13:34. Pushed by rempt into branch 'rempt/bug-392190'. Use KisAirbrushOptionProperties instead of KisAirbrushOptionWidget A KisPaintOp cannot create QWidget based objects because it doesn't run in the gui thread. Special thanks to Peter Eszlari for finding the commit that introduced the bug! M +0 -1 libs/ui/KisPaintopPropertiesBase.cpp M +4 -4 plugins/paintops/defaultpaintops/brush/kis_brushop.cpp M +1 -1 plugins/paintops/defaultpaintops/brush/kis_brushop.h M +3 -3 plugins/paintops/deform/kis_deform_paintop.cpp M +1 -1 plugins/paintops/deform/kis_deform_paintop.h M +1 -1 plugins/paintops/libpaintop/kis_airbrush_option_widget.cpp M +5 -4 plugins/paintops/libpaintop/kis_airbrush_option_widget.h M +1 -1 plugins/paintops/libpaintop/kis_brush_based_paintop.cpp M +1 -1 plugins/paintops/libpaintop/kis_brush_based_paintop.h M +6 -6 plugins/paintops/libpaintop/kis_paintop_plugin_utils.h M +3 -3 plugins/paintops/particle/kis_particle_paintop.cpp M +1 -1 plugins/paintops/particle/kis_particle_paintop.h M +4 -4 plugins/paintops/sketch/kis_sketch_paintop.cpp M +1 -1 plugins/paintops/sketch/kis_sketch_paintop.h M +3 -3 plugins/paintops/spray/kis_spray_paintop.cpp M +1 -1 plugins/paintops/spray/kis_spray_paintop.h M +3 -3 plugins/paintops/tangentnormal/kis_tangent_normal_paintop.cpp M +1 -1 plugins/paintops/tangentnormal/kis_tangent_normal_paintop.h https://commits.kde.org/krita/39e5b30dac0db2108e87196d45e0703bf3a7cdeb I tested it and can confirm the fix. Any release date for 4.0.4? I would really like to update Krita on Flathub from 3.3 to 4.0! Earliest will be next week, since we've got a development sprint starting on Thursday. I could also update from the 4.0 branch, if you merge the fix. Git commit 1b1da7f7ce97fdb30cd40332ee267ef58a4a745c by Boudewijn Rempt. Committed on 16/05/2018 at 18:25. Pushed by rempt into branch 'krita/4.0'. Rename KisAirbrushOption to KisAirbrushOptionWidget This makes clear that this class is a widget and cannot be created during painting. Now we'll have to split the widget part and the settings part up. We probably should rename all classes that inherit KisPaintOpOption like this, to make the difference clear between the KisPaintOpOption hierarchy. the KisBaseOption hierarchy and the KisCurveOption hierarchy. CCMAIL:allen.marshall.22@gmail.com (cherry picked from commit 76e157502d57b79498083176aa296a90a5da9499) M +1 -1 plugins/paintops/colorsmudge/kis_colorsmudgeop_settings_widget.cpp M +4 -4 plugins/paintops/defaultpaintops/brush/kis_brushop.cpp M +2 -2 plugins/paintops/defaultpaintops/brush/kis_brushop.h M +2 -2 plugins/paintops/defaultpaintops/brush/kis_brushop_settings_widget.cpp M +3 -3 plugins/paintops/deform/kis_deform_paintop.cpp M +2 -2 plugins/paintops/deform/kis_deform_paintop.h M +1 -1 plugins/paintops/deform/kis_deform_paintop_settings.cpp M +2 -2 plugins/paintops/deform/kis_deform_paintop_settings_widget.cpp M +1 -1 plugins/paintops/libpaintop/CMakeLists.txt R +12 -12 plugins/paintops/libpaintop/kis_airbrush_option_widget.cpp [from: plugins/paintops/libpaintop/kis_airbrush_option.cpp - 084% similarity] R +3 -3 plugins/paintops/libpaintop/kis_airbrush_option_widget.h [from: plugins/paintops/libpaintop/kis_airbrush_option.h - 091% similarity] M +1 -1 plugins/paintops/libpaintop/kis_brush_based_paintop.cpp M +2 -2 plugins/paintops/libpaintop/kis_brush_based_paintop.h M +1 -1 plugins/paintops/libpaintop/kis_brush_based_paintop_settings.cpp M +3 -3 plugins/paintops/libpaintop/kis_paintop_plugin_utils.h M +3 -3 plugins/paintops/particle/kis_particle_paintop.cpp M +2 -2 plugins/paintops/particle/kis_particle_paintop.h M +1 -1 plugins/paintops/particle/kis_particle_paintop_settings.cpp M +2 -2 plugins/paintops/particle/kis_particle_paintop_settings_widget.cpp M +3 -3 plugins/paintops/sketch/kis_sketch_paintop.cpp M +2 -2 plugins/paintops/sketch/kis_sketch_paintop.h M +1 -1 plugins/paintops/sketch/kis_sketch_paintop_settings.cpp M +2 -2 plugins/paintops/sketch/kis_sketch_paintop_settings_widget.cpp M +3 -3 plugins/paintops/spray/kis_spray_paintop.cpp M +2 -2 plugins/paintops/spray/kis_spray_paintop.h M +1 -1 plugins/paintops/spray/kis_spray_paintop_settings.cpp M +2 -2 plugins/paintops/spray/kis_spray_paintop_settings_widget.cpp M +3 -3 plugins/paintops/tangentnormal/kis_tangent_normal_paintop.cpp M +2 -2 plugins/paintops/tangentnormal/kis_tangent_normal_paintop.h M +2 -2 plugins/paintops/tangentnormal/kis_tangent_normal_paintop_settings_widget.cpp https://commits.kde.org/krita/1b1da7f7ce97fdb30cd40332ee267ef58a4a745c Merged! Git commit 64d4ac69a2f444dd13d9bcfc8dbc880f26f1e374 by Boudewijn Rempt. Committed on 16/05/2018 at 18:25. Pushed by rempt into branch 'krita/4.0'. Use KisAirbrushOptionProperties instead of KisAirbrushOptionWidget A KisPaintOp cannot create QWidget based objects because it doesn't run in the gui thread. Special thanks to Peter Eszlari for finding the commit that introduced the bug! (cherry picked from commit 39e5b30dac0db2108e87196d45e0703bf3a7cdeb) M +0 -1 libs/ui/KisPaintopPropertiesBase.cpp M +4 -4 plugins/paintops/defaultpaintops/brush/kis_brushop.cpp M +1 -1 plugins/paintops/defaultpaintops/brush/kis_brushop.h M +3 -3 plugins/paintops/deform/kis_deform_paintop.cpp M +1 -1 plugins/paintops/deform/kis_deform_paintop.h M +1 -1 plugins/paintops/libpaintop/kis_airbrush_option_widget.cpp M +5 -4 plugins/paintops/libpaintop/kis_airbrush_option_widget.h M +1 -1 plugins/paintops/libpaintop/kis_brush_based_paintop.cpp M +1 -1 plugins/paintops/libpaintop/kis_brush_based_paintop.h M +6 -6 plugins/paintops/libpaintop/kis_paintop_plugin_utils.h M +3 -3 plugins/paintops/particle/kis_particle_paintop.cpp M +1 -1 plugins/paintops/particle/kis_particle_paintop.h M +4 -4 plugins/paintops/sketch/kis_sketch_paintop.cpp M +1 -1 plugins/paintops/sketch/kis_sketch_paintop.h M +3 -3 plugins/paintops/spray/kis_spray_paintop.cpp M +1 -1 plugins/paintops/spray/kis_spray_paintop.h M +3 -3 plugins/paintops/tangentnormal/kis_tangent_normal_paintop.cpp M +1 -1 plugins/paintops/tangentnormal/kis_tangent_normal_paintop.h https://commits.kde.org/krita/64d4ac69a2f444dd13d9bcfc8dbc880f26f1e374 |