Bug 431997

Summary: Crash in gradient generator using Krita 4.4.2 on Android
Product: [Applications] krita Reporter: Deif Lou <ginoba>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: shzam
Priority: NOR    
Version First Reported In: 4.4.2   
Target Milestone: ---   
Platform: Android   
OS: Android 10.x   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Deif Lou 2021-01-23 16:19:36 UTC
SUMMARY
Version 4.4.2 crashes when selecting the gradient generator on android. It also crashes if it is selected in the halftone filter options.

STEPS TO REPRODUCE
1. Open krita 4.4.2 on android, and open/create a document
2. Add a new fill layer
3. In the dialog, change the generator to "gradient".

OBSERVED RESULT
Krita crashes.

EXPECTED RESULT
The gradient generator should be selected and work properly.

SOFTWARE/OS VERSIONS
Android 10

ADDITIONAL INFORMATION
These are the last lines I get from the adb output:

01-23 17:09:08.107 21913 21958 W libc    : malloc(18446744073709551615) failed: returning null pointer
--------- beginning of crash
01-23 17:09:08.108 21913 21958 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4 in tid 21958 (qtMainLoopThrea), pid 21913 (org.krita)
Comment 1 sh_zam 2021-01-26 11:52:15 UTC
This was caused by nColumns' [1] value being zero. Which seems to have been  fixed by later commits where the comparison for zero *is* performed.

Fixed in both master and krita/4.3


[1]: https://invent.kde.org/graphics/krita/-/blob/krita/4.4.2/libs/ui/KisGenericGradientEditor.cpp#L889