Bug 510082 - Crashes at random in BevelAndEmboss::fetchBevelAndEmboss, after opening the layer style dialog
Summary: Crashes at random in BevelAndEmboss::fetchBevelAndEmboss, after opening the l...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: * Unknown (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-30 04:03 UTC by Ming Chuan
Modified: 2026-01-27 13:54 UTC (History)
1 user (show)

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 Ming Chuan 2025-09-30 04:03:58 UTC
SUMMARY

When adding a layer style to a layer, after the layer style pop up appears, krita crashes randomly

In `BevelAndEmboss::fetchBevelAndEmboss`, `bevelAndEmboss->setTexturePattern(m_texture->ui.patternChooser->currentResource(true).staticCast<KoPattern>());` passed a `QSharedPointer<KoPattern>(nullptr)` into `setTexturePattern`. Perhaps the pointer it's casting from is already null?

The `KisSignalCompressor::slotTimerExpired`/`KisSignalCompressor::timeout` in the stack trace looks suspicious

STEPS TO REPRODUCE
1. Have some kind of complex krita files with multiple clone layers and filters, that already makes krita laggy
2. Add a new layer style to one of the paint layer
3. krita crashes, randomly

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Qt 6.9.2, with recent krita master.

ADDITIONAL INFORMATION

```
#0  0x00007ffff76a0f1a in psd_layer_effects_bevel_emboss::setTexturePattern (this=this@entry=0x7ffbabc37118, value=...) at /home/user/sources/krita/libs/psdutils/psd.h:887
#1  0x00007ffff769a11a in BevelAndEmboss::fetchBevelAndEmboss (this=this@entry=0x7ffba7d44820, bevelAndEmboss=0x7ffbabc37118) at /home/user/sources/krita/libs/ui/dialogs/kis_dlg_layer_style.cpp:869
#2  0x00007ffff769a63d in KisDlgLayerStyle::style (this=0x7ffffffd99c0) at /home/user/sources/krita/libs/ui/dialogs/kis_dlg_layer_style.cpp:506
#3  0x00007ffff77761fb in updateLayerStyles (layer=..., dlg=<optimized out>, canvasResourcesInterface=...) at /home/user/sources/krita/libs/ui/kis_layer_manager.cc:1033
#4  0x00007ffff778196f in std::__invoke_impl<void, void (*&)(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>), KisSharedPtr<KisLayer>&, KisDlgLayerStyle*&, QSharedPointer<KoCanvasResourcesInterface>&> (__f=<optimized out>) at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:61
#5  std::__invoke<void (*&)(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>), KisSharedPtr<KisLayer>&, KisDlgLayerStyle*&, QSharedPointer<KoCanvasResourcesInterface>&> (__fn=<optimized out>) at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:96
#6  std::_Bind<void (*(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>))(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>)>::__call<void, , 0ul, 1ul, 2ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (this=<optimized out>, __args=...) at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/functional:513
#7  std::_Bind<void (*(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>))(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>)>::operator()<, void>() (this=<optimized out>) at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/functional:598
#8  std::__invoke_impl<void, std::_Bind<void (*(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>))(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>)>&>(std::__invoke_other, std::_Bind<void (*(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>))(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>)>&) (__f=...) at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:61
#9  std::__invoke_r<void, std::_Bind<void (*(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>))(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>)>&>(std::_Bind<void (*(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>))(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>)>&) (__fn=...) at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/invoke.h:111
#10 std::_Function_handler<void (), std::_Bind<void (*(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>))(KisSharedPtr<KisLayer>, KisDlgLayerStyle*, QSharedPointer<KoCanvasResourcesInterface>)> >::_M_invoke(std::_Any_data const&) (__functor=...) at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/std_function.h:290
#11 0x00007ffff3025ab8 in doActivate<false> (sender=0x7ffffffd99c0, signal_index=28, argv=0x7ffffffd9058) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4169
#12 0x00007ffff3025ab8 in doActivate<false> (sender=0x7ffed1358f50, signal_index=3, argv=0x7ffffffd9148) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4169
#13 0x00007ffff301b747 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff50c9280 <KisSignalCompressor::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4217
#14 0x00007ffff5057f30 in KisSignalCompressor::timeout (this=<optimized out>) at /home/user/sources/krita/build/libs/global/kritaglobal_autogen/EWIEGA46WW/moc_kis_signal_compressor.cpp:135
#15 0x00007ffff5089bd5 in KisSignalCompressor::tryEmitSignalSafely (this=this@entry=0x7ffed1358f50) at /home/user/sources/krita/libs/global/kis_signal_compressor.cpp:199
#16 0x00007ffff5089cb5 in KisSignalCompressor::tryEmitOnTick (this=this@entry=0x7ffed1358f50, isFromTimer=isFromTimer@entry=true) at /home/user/sources/krita/libs/global/kis_signal_compressor.cpp:176
#17 0x00007ffff5089eea in KisSignalCompressor::slotTimerExpired (this=0x7ffed1358f50) at /home/user/sources/krita/libs/global/kis_signal_compressor.cpp:212
#18 0x00007ffff3025ab8 in doActivate<false> (sender=0x7ffc35c909b0, signal_index=3, argv=0x7ffffffd9330) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4169
#19 0x00007ffff301b747 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff34c18c0 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffffffd9330) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4217
#20 0x00007ffff303617d in QMetaObject::activate<void, QTimer::QPrivateSignal> (sender=<optimized out>, mo=0x7ffff34c18c0 <QTimer::staticMetaObject>, local_signal_index=0, ret=0x0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobjectdefs.h:306
#21 QTimer::timeout (this=<optimized out>, _t1=...) at /build/qtbase-everywhere-src-6.9.2/build/src/corelib/Core_autogen/include/moc_qtimer.cpp:182
#22 0x00007ffff30168d5 in QObject::event (this=0x7ffc35c909b0, e=0x7ffffffd95a0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:1462
#23 0x00007ffff43a1c2d in QApplicationPrivate::notify_helper (this=this@entry=0x7ffffffd95a0, receiver=0x7ffc35c909b0, e=0x7ffffffd95a0, e@entry=0xeb2210) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3300
#24 0x00007ffff43abf77 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0x7ffc35c909b0, e=0xeb2210, e@entry=0x7ffffffd95a0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3061
#25 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0x7ffc35c909b0, event=0x7ffffffd95a0) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#26 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0x7ffc35c909b0, event=0x7ffffffd95a0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#27 0x00007ffff2fb795d in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1546
#28 0x00007ffff31964a9 in QTimerInfoList::activateTimers (this=0x13bdae0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qtimerinfo_unix.cpp:426
#29 0x00007ffff32e5979 in timerSourceDispatch (source=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qeventdispatcher_glib.cpp:152
#30 0x00007ffff2503f2d in g_main_context_dispatch_unlocked () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#31 0x00007ffff2506278 in g_main_context_iterate_unlocked.isra () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#32 0x00007ffff2506b0f in g_main_context_iteration () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#33 0x00007ffff32e5b93 in QEventDispatcherGlib::processEvents (this=0xeea340, flags=...) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#34 0x00007ffff2fc649b in QEventLoop::exec (this=this@entry=0x7ffffffd9880, flags=..., flags@entry=...) at /build/qtbase-everywhere-src-6.9.2/src/corelib/global/qflags.h:77
#35 0x00007ffff465bb9d in QDialog::exec (this=this@entry=0x7ffffffd99c0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/global/qflags.h:77
#36 0x00007ffff7780f90 in KisLayerManager::layerStyle (this=<optimized out>) at /home/user/sources/krita/libs/ui/kis_layer_manager.cc:1073
#37 0x00007ffff3025ab8 in doActivate<false> (sender=0x42a9400, signal_index=7, argv=0x7ffffffd9cb0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4169
#38 0x00007ffff301b747 in QMetaObject::activate (sender=sender@entry=0x42a9400, m=m@entry=0x7ffff3fe4f40 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=4, argv=argv@entry=0x7ffffffd9cb0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4217
#39 0x00007ffff3cc0064 in QMetaObject::activate<void, bool> (sender=0x42a9400, mo=0x7ffff3fe4f40 <QAction::staticMetaObject>, local_signal_index=4, ret=0x0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobjectdefs.h:306
#40 QAction::triggered (this=this@entry=0x42a9400, _t1=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/build/src/gui/Gui_autogen/include/moc_qaction.cpp:372
#41 0x00007ffff3cc356f in QAction::activate (this=0x42a9400, event=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qaction.cpp:1104
#42 0x00007ffff45b2ffc in QMenuPrivate::activateCausedStack (this=0x7ffbdd3b8df0, causedStack=..., action=0x42a9400, action_e=QAction::Trigger, self=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/widgets/widgets/qmenu.cpp:1408
#43 0x00007ffff45bc430 in QMenuPrivate::activateAction (this=0x7ffbdd3b8df0, action=0x42a9400, action_e=QAction::Trigger, self=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/widgets/widgets/qmenu.cpp:1490
#44 0x00007ffff440db08 in QWidget::event (this=0x7ffffffdb710, event=0x7ffffffda370) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidget.cpp:9363
#45 0x00007ffff43a1c2d in QApplicationPrivate::notify_helper (this=this@entry=0xeb2210, receiver=receiver@entry=0x7ffffffdb710, e=e@entry=0x7ffffffda370) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3300
#46 0x00007ffff43acb32 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0x7ffffffdb710, e=e@entry=0x7ffffffda370) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:2777
#47 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0x7ffffffdb710, event=0x7ffffffda370) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#48 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0x7ffffffdb710, event=0x7ffffffda370) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#49 0x00007ffff2fb795d in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1546
#50 0x00007ffff45bd451 in QMenuPrivate::mouseEventTaken (this=this@entry=0x7ffbb035c5f0, e=e@entry=0x7ffffffdaa50) at /build/qtbase-everywhere-src-6.9.2/src/widgets/widgets/qmenu.cpp:1388
#51 0x00007ffff45bd776 in QMenu::mouseReleaseEvent (this=0x7ffbb1f35650, e=0x7ffffffdaa50) at /build/qtbase-everywhere-src-6.9.2/src/widgets/widgets/qmenu.cpp:2921
#52 0x00007ffff440db08 in QWidget::event (this=0x7ffbb1f35650, event=0x7ffffffdaa50) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidget.cpp:9363
#53 0x00007ffff43a1c2d in QApplicationPrivate::notify_helper (this=this@entry=0xeb2210, receiver=receiver@entry=0x7ffbb1f35650, e=e@entry=0x7ffffffdaa50) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3300
#54 0x00007ffff43acb32 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0x7ffbb1f35650, e=e@entry=0x7ffffffdaa50) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:2777
#55 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0x7ffbb1f35650, event=0x7ffffffdaa50) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#56 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0x7ffbb1f35650, event=0x7ffffffdaa50) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#57 0x00007ffff2fb796d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1560
#58 0x00007ffff43ab459 in QApplicationPrivate::sendMouseEvent (receiver=0x7ffbb1f35650, event=event@entry=0x7ffffffdaa50, alienWidget=<optimized out>, nativeWidget=0x7ffbb1f35650, buttonDown=buttonDown@entry=0x7ffff4a109f0 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:2358
#59 0x00007ffff4423807 in QWidgetWindow::handleMouseEvent (this=0x7ffbdc5517b0, event=event@entry=0x7ffbd35ba9d0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidgetwindow.cpp:577
#60 0x00007ffff4425e10 in QWidgetWindow::event (this=0x7ffbdc5517b0, event=0x7ffbd35ba9d0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidgetwindow.cpp:292
#61 0x00007ffff43a1c2d in QApplicationPrivate::notify_helper (this=this@entry=0x0, receiver=0x7ffbdc5517b0, e=0x7ffbd35ba9d0, e@entry=0x7fffd800f7d0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3300
#62 0x00007ffff43abf77 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0x7ffbdc5517b0, e=0x7fffd800f7d0, e@entry=0x7ffbd35ba9d0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3061
#63 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0x7ffbdc5517b0, event=0x7ffbd35ba9d0) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#64 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0x7ffbdc5517b0, event=0x7ffbd35ba9d0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#65 0x00007ffff2fb796d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1560
#66 0x00007ffff386e565 in QWindowPrivate::forwardToPopup (this=<optimized out>, event=event@entry=0x7ffffffdaeb0) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qwindow.cpp:2497
#67 0x00007ffff3807cc6 in QGuiApplicationPrivate::processMouseEvent (e=0x7ffbe47148b0) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qwindow.h:65
#68 0x00007ffff3877174 in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qwindowsysteminterface.cpp:1117
#69 0x00007ffff38773b0 in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qwindowsysteminterface.cpp:1086
#70 0x00007ffff301694a in QObject::event (this=0xe7a5a0, e=0x7fffe00089e0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:1432
#71 0x00007ffff43a1c2d in QApplicationPrivate::notify_helper (this=this@entry=0x13bd930, receiver=0xe7a5a0, e=0x7fffe00089e0, e@entry=0x13bd928) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3300
#72 0x00007ffff43abf77 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0xe7a5a0, e=0x13bd928, e@entry=0x7fffe00089e0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3061
#73 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0xe7a5a0, event=0x7fffe00089e0) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#74 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0xe7a5a0, event=0x7fffe00089e0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#75 0x00007ffff2fb795d in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1546
#76 0x00007ffff2fbb5e8 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0xb92880) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1891
#77 0x00007ffff32e64ff in postEventSourceDispatch (s=0x13b4850) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#78 0x00007ffff2503f2d in g_main_context_dispatch_unlocked () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#79 0x00007ffff2506278 in g_main_context_iterate_unlocked.isra () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#80 0x00007ffff2506b0f in g_main_context_iteration () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#81 0x00007ffff32e5b93 in QEventDispatcherGlib::processEvents (this=0xeea340, flags=...) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#82 0x00007ffff2fc649b in QEventLoop::exec (this=0x7ffffffdb610, flags=..., flags@entry=...) at /build/qtbase-everywhere-src-6.9.2/src/corelib/global/qflags.h:77
#83 0x00007ffff45b9687 in QMenuPrivate::exec (this=0x7ffbdd3b8df0, p=..., action=action@entry=0x0, positionFunction=...) at /build/qtbase-everywhere-src-6.9.2/src/corelib/global/qflags.h:77
#84 0x00007ffff45b97f6 in QMenu::exec (this=this@entry=0x7ffffffdb710, p=..., action=action@entry=0x0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/widgets/qmenu.cpp:2658
#85 0x00007fffbc9b0f72 in LayerBox::slotContextMenuRequested (this=0xedd7770, pos=..., index=...) at /home/user/sources/krita/plugins/dockers/layerdocker/LayerBox.cpp:816
#86 0x00007ffff3025ab8 in doActivate<false> (sender=0x1151e870, signal_index=16, argv=0x7ffffffdb870) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4169
#87 0x00007ffff301b747 in QMetaObject::activate (sender=sender@entry=0x1151e870, m=m@entry=0x7fffbc9e24a0 <NodeView::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffffffdb870) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:4217
#88 0x00007fffbc9c0ed9 in QMetaObject::activate<void, QPoint, QModelIndex> (sender=0x1151e870, mo=0x7fffbc9e24a0 <NodeView::staticMetaObject>, local_signal_index=0, ret=0x0) at /nix/store/dkfr32yi7p8cdxsnll05q1kax19fl7ay-qtbase-6.9.2/include/QtCore/qobjectdefs.h:306
#89 NodeView::contextMenuRequested (this=this@entry=0x1151e870, _t1=..., _t2=...) at /home/user/sources/krita/build/plugins/dockers/layerdocker/kritalayerdocker_static_autogen/EWIEGA46WW/moc_NodeView.cpp:214
#90 0x00007fffbc9be03c in NodeView::showContextMenu (this=<optimized out>, globalPos=..., index=...) at /home/user/sources/krita/plugins/dockers/layerdocker/NodeView.cpp:302
#91 NodeView::contextMenuEvent (this=0x1151e870, e=0x7ffffffdbe40) at /home/user/sources/krita/plugins/dockers/layerdocker/NodeView.cpp:297
#92 0x00007ffff440db08 in QWidget::event (this=this@entry=0x1151e870, event=event@entry=0x7ffffffdbe40) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidget.cpp:9363
#93 0x00007ffff4467c9a in QFrame::event (this=0x1151e870, e=0x7ffffffdbe40) at /build/qtbase-everywhere-src-6.9.2/src/widgets/widgets/qframe.cpp:521
#94 0x00007ffff2fb742e in QCoreApplicationPrivate::sendThroughObjectEventFilters (receiver=receiver@entry=0x115055c0, event=event@entry=0x7ffffffdbe40) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1243
#95 0x00007ffff43a1c1d in QApplicationPrivate::notify_helper (this=this@entry=0xeb2210, receiver=receiver@entry=0x115055c0, e=e@entry=0x7ffffffdbe40) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3294
#96 0x00007ffff43ad9d7 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0x115055c0, e=e@entry=0x7ffffffdbe40) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:2918
#97 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0x115055c0, event=0x7ffffffdbe40) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#98 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0x115055c0, event=0x7ffffffdbe40) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#99 0x00007ffff2fb772a in QCoreApplication::forwardEvent (receiver=<optimized out>, event=<optimized out>, originatingEvent=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1121
#100 0x00007ffff44241dc in QWidgetWindow::handleContextMenuEvent (this=<optimized out>, e=e@entry=0x7ffffffdc120) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidgetwindow.cpp:1235
#101 0x00007ffff4425f10 in QWidgetWindow::event (this=0x430e2e0, event=0x7ffffffdc120) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidgetwindow.cpp:369
#102 0x00007ffff43a1c2d in QApplicationPrivate::notify_helper (this=this@entry=0x7ffff3fd9d00 <vtable for QContextMenuEvent+16>, receiver=0x430e2e0, e=0x7ffffffdc120, e@entry=0x2000000001000052) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3300
#103 0x00007ffff43abf77 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0x430e2e0, e=0x2000000001000052, e@entry=0x7ffffffdc120) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3061
#104 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0x430e2e0, event=0x7ffffffdc120) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#105 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0x430e2e0, event=0x7ffffffdc120) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#106 0x00007ffff2fb772a in QCoreApplication::forwardEvent (receiver=<optimized out>, event=<optimized out>, originatingEvent=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1121
#107 0x00007ffff3872eb9 in QWindowPrivate::maybeSynthesizeContextMenuEvent (this=0x42e0540, event=0x7ffffffdc5e0) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qwindow_p.h:35
#108 QWindowPrivate::maybeSynthesizeContextMenuEvent (this=0x42e0540, event=0x7ffffffdc5e0) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qwindow.cpp:2804
#109 0x00007ffff44233e4 in QWidgetWindow::handleMouseEvent (this=0x430e2e0, event=event@entry=0x7ffffffdc5e0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidgetwindow.cpp:697
#110 0x00007ffff4425e10 in QWidgetWindow::event (this=0x430e2e0, event=0x7ffffffdc5e0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qwidgetwindow.cpp:292
#111 0x00007ffff43a1c2d in QApplicationPrivate::notify_helper (this=this@entry=0x0, receiver=0x430e2e0, e=0x7ffffffdc5e0, e@entry=0x7ffbdd42d1c0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3300
#112 0x00007ffff43abf77 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0x430e2e0, e=0x7ffbdd42d1c0, e@entry=0x7ffffffdc5e0) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3061
#113 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0x430e2e0, event=0x7ffffffdc5e0) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#114 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0x430e2e0, event=0x7ffffffdc5e0) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#115 0x00007ffff2fb796d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1560
#116 0x00007ffff3807586 in QGuiApplicationPrivate::processMouseEvent (e=0x7ffbd5aed570) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qguiapplication.cpp:2476
#117 0x00007ffff3877174 in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qwindowsysteminterface.cpp:1117
#118 0x00007ffff38773b0 in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qwindowsysteminterface.cpp:1086
#119 0x00007ffff301694a in QObject::event (this=0xe7a5a0, e=0x7fffe0004370) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qobject.cpp:1432
#120 0x00007ffff43a1c2d in QApplicationPrivate::notify_helper (this=this@entry=0x13bd930, receiver=0xe7a5a0, e=0x7fffe0004370, e@entry=0x13bd928) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3300
#121 0x00007ffff43abf77 in QApplication::notify (this=this@entry=0x7ffffffdd0f0, receiver=receiver@entry=0xe7a5a0, e=0x13bd928, e@entry=0x7fffe0004370) at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:3061
#122 0x00007ffff7b11dae in KisApplication::notify (this=0x7ffffffdd0f0, receiver=0xe7a5a0, event=0x7fffe0004370) at /home/user/sources/krita/libs/ui/KisApplication.cpp:864
#123 0x00007ffff2fb76f8 in QCoreApplication::notifyInternal2 (receiver=0xe7a5a0, event=0x7fffe0004370) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1106
#124 0x00007ffff2fb795d in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1546
#125 0x00007ffff2fbb5e8 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0xb92880) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:1891
#126 0x00007ffff32e64ff in postEventSourceDispatch (s=0x13b4850) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#127 0x00007ffff2503f2d in g_main_context_dispatch_unlocked () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#128 0x00007ffff2506278 in g_main_context_iterate_unlocked.isra () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#129 0x00007ffff2506b0f in g_main_context_iteration () from /nix/store/qfm3kqdbpd289nnmdhd4dis4svd2nzwv-glib-2.84.4/lib/libglib-2.0.so.0
#130 0x00007ffff32e5b93 in QEventDispatcherGlib::processEvents (this=0xeea340, flags=...) at /build/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#131 0x00007ffff2fc649b in QEventLoop::exec (this=this@entry=0x7ffffffdcd30, flags=..., flags@entry=...) at /build/qtbase-everywhere-src-6.9.2/src/corelib/global/qflags.h:77
#132 0x00007ffff2fc1501 in QCoreApplication::exec () at /build/qtbase-everywhere-src-6.9.2/src/corelib/global/qflags.h:77
#133 0x00007ffff37f363d in QGuiApplication::exec () at /build/qtbase-everywhere-src-6.9.2/src/gui/kernel/qguiapplication.cpp:1986
#134 0x00007ffff43a1b99 in QApplication::exec () at /build/qtbase-everywhere-src-6.9.2/src/widgets/kernel/qapplication.cpp:2567
#135 0x0000000000409fce in main (argc=<optimized out>, argv=<optimized out>) at /home/user/sources/krita/krita/main.cc:802
```
Comment 1 Lenzoid 2025-12-20 22:12:03 UTC
Thanks for the report. You filled Version First Reported In with git master. That would be correct only if the release version is unaffected. Have you compared this to a stable version of Krita? Is it the same? Thanks again.
Comment 2 Ming Chuan 2025-12-21 06:45:23 UTC
No. Sorry this bug is rare so I can't try repro on stable version. Maybe krita devs will have some idea by looking at the stack trace
Comment 3 Dmitry Kazakov 2026-01-27 13:54:11 UTC
Git commit 97fbf20fafbbe37dd20d1d779bf97b61037f1a9f by Dmitry Kazakov.
Committed on 27/01/2026 at 13:49.
Pushed by dkazakov into branch 'master'.

Fix gradient handling in the layer style dialog

The patch streamlines handling of the embedded resources in the layers
style. Basiclly, the of the layer style usage are currently the follwoing:

1) When loading a layer style into the global storage, the embedded resources,
like gradients and patterns are loaded as sideLoadedResources(). Which
moves the handling of the dependencies into KisResourceLocator, which, in
turn, deduplicates resource filenames, which fixes bug 514744.

2) When a layer style is loaded into a layer style dialog, its embedded resources
are moved from an internal KisLocalStrokeResources into a temporary memory-
based resource storage, which is handled by KisTemporaryResourceStorageLockAdapter.

3) KisCmbGradient has been changed to use KisGenericGradientEditor
instead of a normal gradient selector, which allows the user to edit
gradients without saving them into the global database, which used to
pollute the database (and cause bugs like 505986 and 467729)
Related: bug 505986, bug 476729, bug 514744

M  +17   -5    libs/image/KisAslStorage.cpp
M  +63   -46   libs/image/kis_asl_layer_style_serializer.cpp
M  +4    -2    libs/image/kis_asl_layer_style_serializer.h
M  +45   -7    libs/image/kis_psd_layer_style.cpp
M  +11   -1    libs/image/kis_psd_layer_style.h
M  +1    -0    libs/resources/CMakeLists.txt
M  +6    -0    libs/resources/KisLocalStrokeResources.cpp
M  +12   -0    libs/resources/KisLocalStrokeResources.h
M  +3    -0    libs/resources/KisMemoryStorage.cpp
M  +15   -0    libs/resources/KisResourceLocator.cpp
M  +15   -0    libs/resources/KisResourceLocator.h
M  +32   -0    libs/resources/KisResourceModel.cpp
M  +14   -0    libs/resources/KisResourceModel.h
M  +81   -38   libs/resources/KisResourceStorage.cpp
M  +1    -0    libs/resources/KisResourceStorage.h
M  +9    -0    libs/resources/KisTagFilterResourceProxyModel.cpp
M  +1    -0    libs/resources/KisTagFilterResourceProxyModel.h
M  +9    -0    libs/resources/KisTagResourceModel.cpp
M  +1    -0    libs/resources/KisTagResourceModel.h
A  +42   -0    libs/resources/KisTemporaryResourceStorageLock.cpp     [License: GPL(v2.0+)]
A  +44   -0    libs/resources/KisTemporaryResourceStorageLock.h     [License: GPL(v2.0+)]
M  +159  -90   libs/ui/dialogs/kis_dlg_layer_style.cpp
M  +13   -10   libs/ui/dialogs/kis_dlg_layer_style.h
M  +0    -1    libs/ui/kis_layer_manager.cc
M  +36   -21   libs/ui/widgets/kis_cmb_gradient.cpp
M  +8    -4    libs/ui/widgets/kis_cmb_gradient.h

https://invent.kde.org/graphics/krita/-/commit/97fbf20fafbbe37dd20d1d779bf97b61037f1a9f
Comment 4 Dmitry Kazakov 2026-01-27 13:54:35 UTC
Git commit 8c854aaea604397c7eed54ec688e0b9a881d252b by Dmitry Kazakov.
Committed on 27/01/2026 at 13:49.
Pushed by dkazakov into branch 'master'.

Also fix bevel-and-emboss to save patterns correctly

M  +16   -7    libs/ui/dialogs/kis_dlg_layer_style.cpp
M  +2    -2    libs/ui/dialogs/kis_dlg_layer_style.h

https://invent.kde.org/graphics/krita/-/commit/8c854aaea604397c7eed54ec688e0b9a881d252b