Regression: Crash after discarding texture paint changes #95800

Closed
opened 2022-02-15 15:32:03 +01:00 by Richard Antalik · 20 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65

Blender Version
Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-12 01:56, hash: 517afcc858
Worked: blender-3.1.0-alpha 34d424fd64

Caused by 507a4deef1

Short description of error
When repainting over a loaded image (loaded via the "Discard" button), you will see artifacts and possibly crash:
untitled.png

Trace:
P2799: (An Untitled Masterwork)

 	blender.exe!MEM_lockfree_freeN(void * vmemh) Line 118	C
 	blender.exe!imb_freerectImBuf(ImBuf * ibuf) Line 106	C
 	blender.exe!imb_freerectImbuf_all(ImBuf * ibuf) Line 185	C
 	blender.exe!IMB_freeImBuf(ImBuf * ibuf) Line 208	C
>	blender.exe!image_undosys_step_encode(bContext * C, Main * UNUSED_bmain, UndoStep * us_p) Line 868	C
 	blender.exe!undosys_step_encode(bContext * C, Main * bmain, UndoStack * ustack, UndoStep * us) Line 144	C
 	blender.exe!BKE_undosys_step_push_with_type(UndoStack * ustack, bContext * C, const unsigned char * name, const UndoType * ut) Line 548	C
 	blender.exe!BKE_undosys_step_push(UndoStack * ustack, bContext * C, const unsigned char * name) Line 594	C
 	blender.exe!ED_image_undo_push_end() Line 1088	C
 	blender.exe!paint_stroke_done(const bContext * C, PaintStroke * stroke) Line 655	C
 	blender.exe!stroke_done(bContext * C, wmOperator * op) Line 991	C
 	blender.exe!paint_stroke_modal(bContext * C, wmOperator * op, const wmEvent * event) Line 1496	C
 	blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2227	C
 	blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3093	C
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3145	C
 	blender.exe!wm_event_do_handlers(bContext * C) Line 3675	C
 	blender.exe!WM_main(bContext * C) Line 626	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 548	C
 	[External Code]	

Exact steps for others to reproduce the error

  • Download blend file and image attached
  • Open .blend file -> In the Image Texture node, open the image as texture for shader and paint
  • Open same image in image editor
  • Paint something in the Image Editor
  • In Image editor Image tab (sidebar), click Discard to reload file
  • Don't perform any events in image editor (like zoom, pan, etc.)
  • Paint something again
    bug.blend
    300.png
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65 **Blender Version** Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-12 01:56, hash: `517afcc858` Worked: blender-3.1.0-alpha 34d424fd64bb Caused by 507a4deef1 **Short description of error** When repainting over a loaded image (loaded via the "Discard" button), you will see artifacts and possibly crash: ![untitled.png](https://archive.blender.org/developer/F12868369/untitled.png) Trace: [P2799: (An Untitled Masterwork)](https://archive.blender.org/developer/P2799.txt) ``` blender.exe!MEM_lockfree_freeN(void * vmemh) Line 118 C blender.exe!imb_freerectImBuf(ImBuf * ibuf) Line 106 C blender.exe!imb_freerectImbuf_all(ImBuf * ibuf) Line 185 C blender.exe!IMB_freeImBuf(ImBuf * ibuf) Line 208 C > blender.exe!image_undosys_step_encode(bContext * C, Main * UNUSED_bmain, UndoStep * us_p) Line 868 C blender.exe!undosys_step_encode(bContext * C, Main * bmain, UndoStack * ustack, UndoStep * us) Line 144 C blender.exe!BKE_undosys_step_push_with_type(UndoStack * ustack, bContext * C, const unsigned char * name, const UndoType * ut) Line 548 C blender.exe!BKE_undosys_step_push(UndoStack * ustack, bContext * C, const unsigned char * name) Line 594 C blender.exe!ED_image_undo_push_end() Line 1088 C blender.exe!paint_stroke_done(const bContext * C, PaintStroke * stroke) Line 655 C blender.exe!stroke_done(bContext * C, wmOperator * op) Line 991 C blender.exe!paint_stroke_modal(bContext * C, wmOperator * op, const wmEvent * event) Line 1496 C blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2227 C blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3093 C blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3145 C blender.exe!wm_event_do_handlers(bContext * C) Line 3675 C blender.exe!WM_main(bContext * C) Line 626 C blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 548 C [External Code] ``` **Exact steps for others to reproduce the error** - Download blend file and image attached - Open .blend file -> In the `Image Texture` node, open the image as texture for shader and paint - Open same image in image editor - Paint something in the Image Editor - In Image editor Image tab (sidebar), click Discard to reload file - Don't perform any events in image editor (like zoom, pan, etc.) - Paint something again [bug.blend](https://archive.blender.org/developer/F12868365/bug.blend) ![300.png](https://archive.blender.org/developer/F12868366/300.png)
Author
Member

Added subscriber: @iss

Added subscriber: @iss

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

I've edited the description to include some unreported details and better match our submission template and guidelines.
But I cannot reproduce this with either the latest stable or current development versions of Blender:

Please try the latest daily build: https://builder.blender.org/download/

Go to File → Defaults → Load Factory Settings and then load your file to see if you still can reproduce this issue.

If the problem persists, please give us more clear instructions on how to reproduce it from scratch.

I've edited the description to include some unreported details and better match our [submission template and guidelines](https://developer.blender.org/maniphest/task/edit/form/1/). But I cannot reproduce this with either the latest stable or current development versions of Blender: Please try the latest daily build: https://builder.blender.org/download/ Go to File → Defaults → Load Factory Settings and then load your file to see if you still can reproduce this issue. If the problem persists, please give us more clear instructions on how to reproduce it from scratch.
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Member

I can get both crash and artifacts with provided steps (Bisecting...)

blender.exe         :0x00007FF63A5BE690  imb_freerectImbuf_all
blender.exe         :0x00007FF63A5BDD40  IMB_freeImBuf
blender.exe         :0x00007FF63AE24E60  image_undosys_step_encode
blender.exe         :0x00007FF63F74B0E0  BKE_undosys_step_push_with_type
blender.exe         :0x00007FF63F74AF20  BKE_undosys_step_push
blender.exe         :0x00007FF63AE24A70  ED_image_undo_push_end
blender.exe         :0x00007FF63AC37E00  paint_stroke_done
blender.exe         :0x00007FF63AC5D260  stroke_done
blender.exe         :0x00007FF63AC5C630  paint_stroke_modal
blender.exe         :0x00007FF63A41ACB0  wm_handler_operator_call
blender.exe         :0x00007FF63A41BCA0  wm_handlers_do_intern
blender.exe         :0x00007FF63A41B2D0  wm_handlers_do
blender.exe         :0x00007FF63A418350  wm_event_do_handlers
blender.exe         :0x00007FF63A402450  WM_main
blender.exe         :0x00007FF63A0403C0  main
blender.exe         :0x00007FF63F744494  __scrt_common_main_seh
KERNEL32.DLL        :0x00007FFAD6AF7020  BaseThreadInitThunk
ntdll.dll           :0x00007FFAD8402630  RtlUserThreadStart```
I can get both crash and artifacts with provided steps (Bisecting...) ```tbbmalloc.dll :0x00007FFAB89687E0 rml::pool_reset blender.exe :0x00007FF63A5BE690 imb_freerectImbuf_all blender.exe :0x00007FF63A5BDD40 IMB_freeImBuf blender.exe :0x00007FF63AE24E60 image_undosys_step_encode blender.exe :0x00007FF63F74B0E0 BKE_undosys_step_push_with_type blender.exe :0x00007FF63F74AF20 BKE_undosys_step_push blender.exe :0x00007FF63AE24A70 ED_image_undo_push_end blender.exe :0x00007FF63AC37E00 paint_stroke_done blender.exe :0x00007FF63AC5D260 stroke_done blender.exe :0x00007FF63AC5C630 paint_stroke_modal blender.exe :0x00007FF63A41ACB0 wm_handler_operator_call blender.exe :0x00007FF63A41BCA0 wm_handlers_do_intern blender.exe :0x00007FF63A41B2D0 wm_handlers_do blender.exe :0x00007FF63A418350 wm_event_do_handlers blender.exe :0x00007FF63A402450 WM_main blender.exe :0x00007FF63A0403C0 main blender.exe :0x00007FF63F744494 __scrt_common_main_seh KERNEL32.DLL :0x00007FFAD6AF7020 BaseThreadInitThunk ntdll.dll :0x00007FFAD8402630 RtlUserThreadStart```
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

Bisecting points to 507a4deef1
@Jeroen-Bakker , can you check?
Image editor actually does not update after discarding the brush strokes. So painting on reloaded image causes crash and artifacts.
To avoid crash- just zoom in, pan or perform any similar event after reloading the image and then paint again.

Bisecting points to 507a4deef1 @Jeroen-Bakker , can you check? Image editor actually does not update after discarding the brush strokes. So painting on reloaded image causes crash and artifacts. To avoid crash- just zoom in, pan or perform any similar event after reloading the image and then paint again.
Philipp Oeser changed title from Crash after discarding texture paint changes to Regression: Crash after discarding texture paint changes 2022-02-18 10:07:28 +01:00

Added subscriber: @brecht

Added subscriber: @brecht

Tagging high prio bug with 3.1 so we get an overview of the work remaining for that release. If the module owner does not consider this planned for 3.1, please change the tag to 3.2 or lower the priority to normal.

Tagging high prio bug with 3.1 so we get an overview of the work remaining for that release. If the module owner does not consider this planned for 3.1, please change the tag to 3.2 or lower the priority to normal.

I could not reproduce the crash here in latest master. But I did notice that painting does not update all the tiles of the images. With a sufficiently high res image (e.g. 2K), it seems only the lower left tile gets updated while painting, and updating the entire image requires e.g. moving viewport.

I could not reproduce the crash here in latest master. But I did notice that painting does not update all the tiles of the images. With a sufficiently high res image (e.g. 2K), it seems only the lower left tile gets updated while painting, and updating the entire image requires e.g. moving viewport.
Member

@brecht yes, both crash and artifacts appear as resolved.

But I did notice that painting does not update all the tiles of the images.

Only this is pending.

@brecht yes, both crash and artifacts appear as resolved. > But I did notice that painting does not update all the tiles of the images. Only this is pending.
Member

Hmmm I just test and couldn't reproduce the artifact that not all tiles are updated. Can someone add a video how to reproduce it. (tested in 3.1 branch)

Hmmm I just test and couldn't reproduce the artifact that not all tiles are updated. Can someone add a video how to reproduce it. (tested in 3.1 branch)
Jeroen Bakker self-assigned this 2022-03-02 11:51:26 +01:00
Member

@Jeroen-Bakker hi, original reported issue seems to be fixed between 9153bf24cb - fcda858e32
#95800.gif

The only issue pending is- Image editor ain't updating when image is reloaded (Discard button)
#95800-partial.gif

@Jeroen-Bakker hi, original reported issue seems to be fixed between 9153bf24cbf2 - fcda858e3200 ![#95800.gif](https://archive.blender.org/developer/F12894156/T95800.gif) The only issue pending is- Image editor ain't updating when image is reloaded (Discard button) ![#95800-partial.gif](https://archive.blender.org/developer/F12894167/T95800-partial.gif)
Member

Is this also the case in blender-v3.1-release branch? Seems like fixes I did at the beginning of this week.

Is this also the case in blender-v3.1-release branch? Seems like fixes I did at the beginning of this week.
Member
[#95800.mp4](https://archive.blender.org/developer/F12894258/T95800.mp4)

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

As this seems fixed, closing the report. Thanks.

As this seems fixed, closing the report. Thanks.
Thomas Dinges added this to the 3.1 milestone 2023-02-08 15:52:46 +01:00
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#95800
No description provided.