Bug 430953 - Krita crashes when applying Smart Patch Tool
Summary: Krita crashes when applying Smart Patch Tool
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Smart Patch (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression
: 431199 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-12-29 18:46 UTC by tohanfreerun
Modified: 2021-02-17 06:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kritacrash.log (189.14 KB, text/plain)
2020-12-29 18:46 UTC, tohanfreerun
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tohanfreerun 2020-12-29 18:46:37 UTC
Created attachment 134385 [details]
kritacrash.log

SUMMARY
Krita crashes when applying Smart Patch Tool. 
Can be reproduced everytime

STEPS TO REPRODUCE
1. Open a random image
2. Select Smart Patch Tool
3. Draw a region to patch

OBSERVED RESULT
Crash

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS

Krita

 Version: 5.0.0-prealpha (git 1734cb1)
 Languages: cs_CZ, cs, en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.9
  Version (loaded): 5.12.9

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  CPU	Intel(R) Core(TM) i5-8250U 
  Kernel Type: winnt
  Kernel Version: 10.0.19042
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

OpenGL Info
 
  Vendor:  "NVIDIA Corporation" 
  Renderer:  "GeForce MX150/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 460.89" 
  Shading language:  "4.60 NVIDIA" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::sRGBColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
     Version: 4.6
     Supports deprecated functions true 
     is OpenGL ES: false 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsAngleD3D11: true 
  isQtPreferAngle: true 

Hardware Information

  GPU Acceleration: desktop
  Memory: 8111 Mb
  Number of Cores: 8
  Swap Location: D:/Apps/Krita

Current Settings

  Current Swap Location: D:/Apps/Krita
  Current Swap Location writable: true
  Undo Enabled: true
  Undo Stack Limit: 30
  Use OpenGL: true
  Use OpenGL Texture Buffer: true
  Use AMD Vectorization Workaround: false
  Canvas State: OPENGL_SUCCESS
  Autosave Interval: 900
  Use Backup Files: true
  Number of Backups Kept: 1
  Backup File Suffix: ~
  Backup Location: Same Folder as the File
  Backup Location writable: false
  Use Win8 Pointer Input: false
  Use RightMiddleTabletButton Workaround: false
  Levels of Detail Enabled: false
  Use Zip64: false


Display Information
Number of screens: 1
	Screen: 0
		Name: \\.\DISPLAY1
		Depth: 32
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: 
		Model: 
		Refresh Rate: 60
Comment 1 Tiar 2021-01-05 23:20:43 UTC
*** Bug 431199 has been marked as a duplicate of this bug. ***
Comment 2 Tiar 2021-01-05 23:21:21 UTC
In the duplicate report there is a test file and a Linux crash log from all relevant threads.
Comment 3 Tiar 2021-01-05 23:22:35 UTC
Btw, this doesn't happen on the 4.4.2-beta2. It's still a regression though.
Comment 4 Dmitry Kazakov 2021-02-11 12:56:33 UTC
This is the offending commit. It looks like float is converted into int wrongly in some place.

Author: Samuel Gaist <samuel.gaist@kde.org>  2020-08-06 10:51:47
Committer: Samuel Gaist <samuel.gaist@kde.org>  2020-08-06 11:20:32
Parent: 54a14bca3d50cc4d5b4926372ff3e4f16ef91b21 (Use reinterpret_cast in maximize and minimize functions)
Child:  16ce406b94b87502d3c7e70634069e8a097bc427 (Correct a typo in KisWelcomePageWidget.cpp)
Branches: master and many more (41)
Follows: v4.3.0-prealpha
Precedes: 

    Refactor distance_impl type casting in kis_inpaint
    
    Use reinterpret_cast to fix cast-align warning
    Convert directly to the exptected pointer type
    Remove float cast on type that is already a float
Comment 5 Dmitry Kazakov 2021-02-11 13:34:50 UTC
Git commit 6d985b00da931b803ce1bee37df040d0d0c449f5 by Dmitry Kazakov.
Committed on 11/02/2021 at 13:34.
Pushed by dkazakov into branch 'master'.

Fix normalization in Smart Patch Tool

(and a corresponding crash)

M  +1    -1    plugins/tools/tool_smart_patch/kis_inpaint.cpp

https://invent.kde.org/graphics/krita/commit/6d985b00da931b803ce1bee37df040d0d0c449f5
Comment 6 Dmitry Kazakov 2021-02-17 06:04:26 UTC
Git commit b3dabf2428fc5bfdcbf026dc560bdfe30f44a4b9 by Dmitry Kazakov.
Committed on 17/02/2021 at 05:41.
Pushed by dkazakov into branch 'krita/4.3'.

Fix normalization in Smart Patch Tool

(and a corresponding crash)

M  +1    -1    plugins/tools/tool_smart_patch/kis_inpaint.cpp

https://invent.kde.org/graphics/krita/commit/b3dabf2428fc5bfdcbf026dc560bdfe30f44a4b9