Bug 492113

Summary: [Crash] Touch gesture for "Sampling Color" in [Canvas Input Setting] cause SAFE ASSERT warning and crash
Product: [Applications] krita Reporter: Protoniv <ss93078>
Component: Shortcuts and Canvas Input SettingsAssignee: Krita Bugs <krita-bugs-null>
Status: REPORTED ---    
Severity: crash CC: commend_unmanned410, xeses16388
Priority: NOR    
Version First Reported In: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Protoniv 2024-08-24 01:54:59 UTC
SUMMARY

On touch screen devices, Use "Two (or Three) finger drag" for sampling foreground color cause three SAFE ASSERT warning popup, ignore them all and krita just crash.

Crashlog from terminal
```
krita.input: KisAbstractInputAction "Alternate Invocation" tried to process event data from an unhandled event type QEvent::TouchCancel
SAFE ASSERT (krita): "m_d->strokeId" in file /builds/graphics/krita/libs/ui/tool/KisAsyncColorSamplerHelper.cpp, line 224
SAFE ASSERT (krita): "!m_sanityIsStarting" in file /builds/graphics/krita/libs/global/kis_signal_compressor.cpp, line 210
SAFE ASSERT (krita): "m_d->strokeId" in file /builds/graphics/krita/libs/ui/tool/KisAsyncColorSamplerHelper.cpp, line 224

Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
0x00007ffff79b0d74 in KisAbstractShortcut::shortcutIndex() const ()
   from /tmp/.mount_krita-rWENdf/usr/bin/../lib/libkritaui.so.20

```

Opensuse Leap 15.6
krita-5.3.0-prealpha-242de665a4-x86_64.appimage

STEPS TO REPRODUCE
1. On a touch Screen, Set Canvas Input Setting > Alternate Invocation > Gesture | Two Finger Drag | Sampling Foreground Color
2.  Draw on Canvas, and use gesture to sample color
3. Safe assert popup, ignore them all and crash


ADDITIONAL INFORMATION
Tested on Android 12 in early August "5.3.0-prealpha" build also has the same issue.
Comment 1 AppTest 2025-08-23 05:20:01 UTC
*** Bug 502718 has been marked as a duplicate of this bug. ***
Comment 2 AppTest 2025-08-23 05:26:38 UTC
Can confirm crash still exists as of August 16, 2025 nightly on Android
Comment 3 AppTest 2025-08-23 05:32:33 UTC
The shortcut works perfectly in 5.2.11. It's the 5.3 nightly with the crash
Comment 4 AppTest 2025-09-02 13:02:39 UTC
Crash is also currently present in 5.2 nightlies