Regression: Repeating resizing image and undoing causes view in image editor strange state, and editing it causes crash. #99356
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#99356
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86
Blender Version
Broken: version: 3.3.0 Alpha, branch: master, commit date: 2022-07-01 14:46, hash:
d0e3388848
Broken: 3.2
Worked: 3.1
Caused/exposed by
e06399c223
Short description of error
If resizeing image and undoing is repeated, view in image editor becomes strange state.
(It looks like that the image size is incorrect state).
If the image is editted in this state, the blender would crash.
At the first undoing, it looks O.K.
But if I repeat resizing and undoing one more time, the image becomes strange.
Exact steps for others to reproduce the error
Followings are what I did in the video above.
I tried above process in several conditions.
I found that
A. this does not happens in 3.1. It happens after 3.2
B. If I checked Undo Legacy option, this does not happen. It happens in standard undo mode.
Added subscriber: @popqjp
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm, will check
Added subscriber: @mont29
Caused/exposed by
e06399c223
CC @mont29
Repeating resizing image and undoing causes view in image editor strange state, and editing it causes crash.to Regression: Repeating resizing image and undoing causes view in image editor strange state, and editing it causes crash.Added subscriber: @Jeroen-Bakker
This commit just fixes the fact that caches were systematically trashed on undo/redo, so think it indeed only reveals the problem.
Note that this also happens with regular image files (loaded from disk), not only generated ones.
Would love to have first someone knowing the image code have a look at this one, @Jeroen-Bakker maybe? Suspect the cache is not properly cleared/re-created when size changes, or marked as dirty... But not really my area of expertise.
Seems like a faulty state in the image engine.
I am not able to reproduce it on
Will check on other platforms as well. Bastien confirmed he could reproduce it.
Added subscriber: @sycszero
Added subscriber: @pragma37
I took a look at this.
I'm able to reproduce it, except when the Image Editor is on Paint Mode.
I wasn't able to reproduce the issue when the image is in float mode, either.
I noticed that
image_undosys_poll
, the poll function used byBKE_UNDOSYS_TYPE_IMAGE
only returnstrue
when theSpaceImage
mode is set toSI_MODE_PAINT
, or when the object mode is setOB_MODE_TEXTURE_PAINT
.Updating it to return
true
regardless of theSpaceImage
mode seems to fix the issue.I have not submitted a patch because I don't have the full picture of the undo system, so I'm not sure if this is a true fix or just a "happy" side effect.
Why the current image undo would work at all outside of Paint Mode if the poll function discards those cases?
image_undosys_poll.diff
@pragma37 your solution makes sense. especially as resizing can happen in any mode. @mont29 do you see any issue with that?
Added subscriber: @ideasman42
I would be surprised if that was really a good solution, to me it sounds more like by-passing the problem existing in regular 'memfile' undo, by forcing image-editing dedicated undo system all the time?
But think @ideasman42 would be more able to answer to this question?
I tried to reproduce it many times on my systems with different configuration and steps. I was able to reproduce it once, so it is still a thing. Not sure I am able to reproduce it reliable enough to find make a fix for it.