Crash when switching to in-progress render slot (2.91) #83198

Closed
opened 2020-11-29 20:09:17 +01:00 by Dec B · 12 comments

System Information
Operating system: Darwin-17.7.0-x86_64-i386-64bit 64 Bits
Graphics card: Intel(R) HD Graphics 6000 Intel Inc. 4.1 INTEL-10.36.23

Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862
Worked: 2.90.1

Short description of error
While a render is in progress, switching to that render slot sometimes causes a crash. It seems to happen more often if you switch between render slots in quick succession.

Exact steps for others to reproduce the error

  • Set render engine to cycles
  • Begin render

While render is in progress, switch back and forth between the in-progress render slot and any other render slot

**System Information** Operating system: Darwin-17.7.0-x86_64-i386-64bit 64 Bits Graphics card: Intel(R) HD Graphics 6000 Intel Inc. 4.1 INTEL-10.36.23 **Blender Version** Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `0f45cab862` Worked: 2.90.1 **Short description of error** While a render is in progress, switching to that render slot sometimes causes a crash. It seems to happen more often if you switch between render slots in quick succession. **Exact steps for others to reproduce the error** - Set render engine to cycles - Begin render # While render is in progress, switch back and forth between the in-progress render slot and any other render slot
Author

Added subscriber: @Dec

Added subscriber: @Dec

Added subscriber: @blenderrocket

Added subscriber: @blenderrocket
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscribers: @Jeroen-Bakker, @lichtwerk

Added subscribers: @Jeroen-Bakker, @lichtwerk
Member

@Jeroen-Bakker: does this ring a bell?

IMB_create_gpu_texture can end up returning invalid pointer in image_get_gpu_texture, from there on things go downhill...

1  blender::gpu::Texture::format_flag_get gpu_texture_private.hh 220  0xc73bf24 
2  GPU_texture_mipmap_mode                gpu_texture.cc         481  0xc73b828 
3  image_get_gpu_texture                  image_gpu.c            368  0x335661d 
4  BKE_image_get_gpu_texture              image_gpu.c            387  0x33566ac 
5  space_image_gpu_texture_get            image_engine.c         139  0x3b5e602 
6  image_gpu_texture_get                  image_engine.c         172  0x3b5e6d4 
7  image_cache_image                      image_engine.c         191  0x3b5e7a8 
8  IMAGE_cache_init                       image_engine.c         326  0x3b5edab 
9  drw_engines_cache_init                 draw_manager.c         1050 0x3b454f7 
10 DRW_draw_render_loop_2d_ex             draw_manager.c         2100 0x3b47d92 
11 DRW_draw_view                          draw_manager.c         1518 0x3b46771 
12 image_main_region_draw                 space_image.c          657  0x474c78b 
13 ED_region_do_draw                      area.c                 546  0x41238e9 
14 wm_draw_window_offscreen               wm_draw.c              731  0x3871052 
15 wm_draw_window                         wm_draw.c              872  0x387160b 
16 wm_draw_update                         wm_draw.c              1073 0x3871c43 
17 WM_main                                wm.c                   641  0x386e661 
18 main                                   creator.c              522  0x32f7682 
@Jeroen-Bakker: does this ring a bell? `IMB_create_gpu_texture` can end up returning invalid pointer in `image_get_gpu_texture`, from there on things go downhill... ``` 1 blender::gpu::Texture::format_flag_get gpu_texture_private.hh 220 0xc73bf24 2 GPU_texture_mipmap_mode gpu_texture.cc 481 0xc73b828 3 image_get_gpu_texture image_gpu.c 368 0x335661d 4 BKE_image_get_gpu_texture image_gpu.c 387 0x33566ac 5 space_image_gpu_texture_get image_engine.c 139 0x3b5e602 6 image_gpu_texture_get image_engine.c 172 0x3b5e6d4 7 image_cache_image image_engine.c 191 0x3b5e7a8 8 IMAGE_cache_init image_engine.c 326 0x3b5edab 9 drw_engines_cache_init draw_manager.c 1050 0x3b454f7 10 DRW_draw_render_loop_2d_ex draw_manager.c 2100 0x3b47d92 11 DRW_draw_view draw_manager.c 1518 0x3b46771 12 image_main_region_draw space_image.c 657 0x474c78b 13 ED_region_do_draw area.c 546 0x41238e9 14 wm_draw_window_offscreen wm_draw.c 731 0x3871052 15 wm_draw_window wm_draw.c 872 0x387160b 16 wm_draw_update wm_draw.c 1073 0x3871c43 17 WM_main wm.c 641 0x386e661 18 main creator.c 522 0x32f7682 ```
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

It seems to me that the pointer returned by IMB_create_gpu_texture is still fine. *tex is set to null a couple lines later in GPU_texture_generate_mipmap. I'm don't know how that happens yet.

This crashes on the second assert, when I quickly switch between slot 1 and 2 during rendering.

diff --git a/source/blender/blenkernel/intern/image_gpu.c b/source/blender/blenkernel/intern/image_gpu.c
index 05aa3c89a84..18ef587fc1f 100644
--- a/source/blender/blenkernel/intern/image_gpu.c
+++ b/source/blender/blenkernel/intern/image_gpu.c
@@ -387,7 +387,9 @@ static GPUTexture *image_get_gpu_texture(Image *ima,
     GPU_texture_wrap_mode(*tex, true, false);
 
     if (GPU_mipmap_enabled()) {
+      BLI_assert(*tex != NULL);
       GPU_texture_generate_mipmap(*tex);
+      BLI_assert(*tex != NULL);
       if (ima) {
         ima->gpuflag |= IMA_GPU_MIPMAP_COMPLETE;
       }
It seems to me that the pointer returned by `IMB_create_gpu_texture` is still fine. `*tex` is set to null a couple lines later in `GPU_texture_generate_mipmap`. I'm don't know how that happens yet. This crashes on the second assert, when I quickly switch between slot 1 and 2 during rendering. ``` diff --git a/source/blender/blenkernel/intern/image_gpu.c b/source/blender/blenkernel/intern/image_gpu.c index 05aa3c89a84..18ef587fc1f 100644 --- a/source/blender/blenkernel/intern/image_gpu.c +++ b/source/blender/blenkernel/intern/image_gpu.c @@ -387,7 +387,9 @@ static GPUTexture *image_get_gpu_texture(Image *ima, GPU_texture_wrap_mode(*tex, true, false); if (GPU_mipmap_enabled()) { + BLI_assert(*tex != NULL); GPU_texture_generate_mipmap(*tex); + BLI_assert(*tex != NULL); if (ima) { ima->gpuflag |= IMA_GPU_MIPMAP_COMPLETE; } ```
Member

I assume #84398 (Multiview images show only one view) is somewhat related, there *tex is borked due to "misuse" of get_image_gpu_texture_ptr

I assume #84398 (Multiview images show only one view) is somewhat related, there *tex is borked due to "misuse" of `get_image_gpu_texture_ptr`
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

There are several crash reports involving 2 scenes composited together that also crash in GPU mipmapping, I’ll hunt them down in the next hour-ish.

There are several crash reports involving 2 scenes composited together that also crash in GPU mipmapping, I’ll hunt them down in the next hour-ish.
Member

#84324 (Blender crashes during composited scenes rendering), #83375 (Blender 2.91 multi scene and engine render crash), #81183 (Crash during rendering of animation) all have crash reports with GPU_texture_mipmap_mode at the top of the stacktrace.

#84324 (Blender crashes during composited scenes rendering), #83375 (Blender 2.91 multi scene and engine render crash), #81183 (Crash during rendering of animation) all have crash reports with `GPU_texture_mipmap_mode` at the top of the stacktrace.
Member

Closed as duplicate of #84324

Closed as duplicate of #84324
Thomas Dinges added this to the 2.92 milestone 2023-02-08 16:15:38 +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#83198
No description provided.