Crash when switching render slots while render is in progress #87982

Closed
opened 2021-05-02 10:51:54 +02:00 by Wouter Stomp · 13 comments

System Information
Operating system: macOS-11.3-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 5500M OpenGL Engine ATI Technologies Inc. 4.1 ATI-4.4.17

Blender Version
Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-05-01 15:22, hash: 7c5e009655
Worked: 2.91.2

Short description of error
When a render is in progress, if I press J a few times to cycle between render slots, Blender wil crash.

Exact steps for others to reproduce the error
Default scene
Switch from Eevee to Cycles
Press F12 to render
In the render view, press J to switch render slots a few times while the render is in progress; Blender will invariably crash after doing this a few times (sometimes up to 10-20 times, sometimes faster).

Crash log:
Renderslotcrash.txt

**System Information** Operating system: macOS-11.3-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro 5500M OpenGL Engine ATI Technologies Inc. 4.1 ATI-4.4.17 **Blender Version** Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-05-01 15:22, hash: `7c5e009655` Worked: 2.91.2 **Short description of error** When a render is in progress, if I press J a few times to cycle between render slots, Blender wil crash. **Exact steps for others to reproduce the error** Default scene Switch from Eevee to Cycles Press F12 to render In the render view, press J to switch render slots a few times while the render is in progress; Blender will invariably crash after doing this a few times (sometimes up to 10-20 times, sometimes faster). Crash log: [Renderslotcrash.txt](https://archive.blender.org/developer/F10049656/Renderslotcrash.txt)
Author

Added subscriber: @blenderrocket

Added subscriber: @blenderrocket
Member

Added subscriber: @Alaska

Added subscriber: @Alaska
Member

I just want to say that I can reproduce this issue on Linux with a Nvidia GPU in 2.92, 2.93 and 3.0. But I'll leave the triaging of this report to others.

backtrace
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(BLI_system_backtrace+0x20) [0xa50dc20]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf49fea]
/lib/x86_64-linux-gnu/libc.so.6(+0x3bd60) [0x7fa0fd53fd60]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(GPU_texture_update_sub+0x42) [0x853fac2]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf892b4]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf8959c]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf89904]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf89a98]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0x143ca63]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0x143ce46]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0x142da36]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(DRW_draw_render_loop_2d_ex+0x474) [0x142fc04]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0x1cacee2]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(ED_region_do_draw+0x861) [0x188bd21]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(wm_draw_update+0x51e) [0x12dee2e]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(WM_main+0x30) [0x12dcc40]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(main+0x31d) [0xe7786d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea) [0x7fa0fd52ad0a]
/mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(_start+0x2a) [0xf4699a]

Python backtrace

I just want to say that I can reproduce this issue on Linux with a Nvidia GPU in 2.92, 2.93 and 3.0. But I'll leave the triaging of this report to others. > backtrace > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(BLI_system_backtrace+0x20) [0xa50dc20] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf49fea] > /lib/x86_64-linux-gnu/libc.so.6(+0x3bd60) [0x7fa0fd53fd60] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(GPU_texture_update_sub+0x42) [0x853fac2] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf892b4] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf8959c] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf89904] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0xf89a98] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0x143ca63] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0x143ce46] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0x142da36] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(DRW_draw_render_loop_2d_ex+0x474) [0x142fc04] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender() [0x1cacee2] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(ED_region_do_draw+0x861) [0x188bd21] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(wm_draw_update+0x51e) [0x12dee2e] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(WM_main+0x30) [0x12dcc40] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(main+0x31d) [0xe7786d] > /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea) [0x7fa0fd52ad0a] > /mnt/HDD/Home/Alaska/Documents/blender-git/build_linux/bin/blender(_start+0x2a) [0xf4699a] > > Python backtrace
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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

Changed status from 'Needs Triage' to: 'Confirmed'
Philipp Oeser self-assigned this 2021-05-03 15:42:18 +02:00
Member

Can confirm, will check.

Can confirm, will check.
Philipp Oeser removed their assignment 2021-05-03 16:18:05 +02:00
Member

Added subscribers: @Jeroen-Bakker, @brecht

Added subscribers: @Jeroen-Bakker, @brecht
Member

Apparently b4f0d52473 is not safe all the way, I am entering GPU_texture_mipmap_mode with a NULL tex

Will step down though, @brecht or @Jeroen-Bakker are probably faster fixing this.

Will dare setting this to High prio, it has been around since 2.92, but it is a regression and an operation that is done pretty often I think.

1  blender::gpu::Texture::format_flag_get gpu_texture_private.hh 227  0xddd0c9c 
2  GPU_texture_mipmap_mode                gpu_texture.cc         487  0xddd04e0 
3  image_get_gpu_texture                  image_gpu.c            419  0x35fbe8e 
4  BKE_image_get_gpu_texture              image_gpu.c            441  0x35fbf29 
5  space_image_gpu_texture_get            image_engine.c         138  0x3e7ed2a 
6  image_gpu_texture_get                  image_engine.c         171  0x3e7ee00 
7  image_cache_image                      image_engine.c         190  0x3e7eee4 
8  IMAGE_cache_init                       image_engine.c         327  0x3e7f4e5 
9  drw_engines_cache_init                 draw_manager.c         1052 0x3e65b7d 
10 DRW_draw_render_loop_2d_ex             draw_manager.c         2110 0x3e684d5 
11 DRW_draw_view                          draw_manager.c         1520 0x3e66df7 
12 image_main_region_draw                 space_image.c          653  0x4c055c7 
13 ED_region_do_draw                      area.c                 558  0x45a9235 
14 wm_draw_window_offscreen               wm_draw.c              724  0x3b8b194 
15 wm_draw_window                         wm_draw.c              864  0x3b8b741 
16 wm_draw_update                         wm_draw.c              1065 0x3b8bd79 
17 WM_main                                wm.c                   653  0x3b884a3 
18 main                                   creator.c              520  0x35983f2 
Apparently b4f0d52473 is not safe all the way, I am entering `GPU_texture_mipmap_mode` with a NULL `tex` Will step down though, @brecht or @Jeroen-Bakker are probably faster fixing this. Will dare setting this to High prio, it has been around since 2.92, but it is a regression and an operation that is done pretty often I think. ``` 1 blender::gpu::Texture::format_flag_get gpu_texture_private.hh 227 0xddd0c9c 2 GPU_texture_mipmap_mode gpu_texture.cc 487 0xddd04e0 3 image_get_gpu_texture image_gpu.c 419 0x35fbe8e 4 BKE_image_get_gpu_texture image_gpu.c 441 0x35fbf29 5 space_image_gpu_texture_get image_engine.c 138 0x3e7ed2a 6 image_gpu_texture_get image_engine.c 171 0x3e7ee00 7 image_cache_image image_engine.c 190 0x3e7eee4 8 IMAGE_cache_init image_engine.c 327 0x3e7f4e5 9 drw_engines_cache_init draw_manager.c 1052 0x3e65b7d 10 DRW_draw_render_loop_2d_ex draw_manager.c 2110 0x3e684d5 11 DRW_draw_view draw_manager.c 1520 0x3e66df7 12 image_main_region_draw space_image.c 653 0x4c055c7 13 ED_region_do_draw area.c 558 0x45a9235 14 wm_draw_window_offscreen wm_draw.c 724 0x3b8b194 15 wm_draw_window wm_draw.c 864 0x3b8b741 16 wm_draw_update wm_draw.c 1065 0x3b8bd79 17 WM_main wm.c 653 0x3b884a3 18 main creator.c 520 0x35983f2 ```

@lichtwerk, I can't reproduce the crash in latest master (9f1e20e7).

From the code, it's not clear to me how tex can become NULL in GPU_texture_mipmap_mode?

    if (*tex) {
      GPU_texture_wrap_mode(*tex, true, false);

      if (GPU_mipmap_enabled()) {
        GPU_texture_generate_mipmap(*tex);
        if (ima) {
          ima->gpuflag |= IMA_GPU_MIPMAP_COMPLETE;
        }
        GPU_texture_mipmap_mode(*tex, true, true);
      }
      else {
        GPU_texture_mipmap_mode(*tex, false, true);
      }
    }
@lichtwerk, I can't reproduce the crash in latest master (9f1e20e7). From the code, it's not clear to me how `tex` can become `NULL` in `GPU_texture_mipmap_mode`? ``` if (*tex) { GPU_texture_wrap_mode(*tex, true, false); if (GPU_mipmap_enabled()) { GPU_texture_generate_mipmap(*tex); if (ima) { ima->gpuflag |= IMA_GPU_MIPMAP_COMPLETE; } GPU_texture_mipmap_mode(*tex, true, true); } else { GPU_texture_mipmap_mode(*tex, false, true); } } ```
Member

This is what happens here (this time I had to hammer {key J} quite often, but it can happen with less presses, too):

#87982.webm

could this be freed from another thread or so?

This is what happens here (this time I had to hammer {key J} quite often, but it can happen with less presses, too): [#87982.webm](https://archive.blender.org/developer/F10051543/T87982.webm) could this be freed from another thread or so?

This issue was referenced by 8ce11c8b66

This issue was referenced by 8ce11c8b663c427a69962a7adbded5c6cfa2082e

I could reproduce now, you're right about the threads.

I could reproduce now, you're right about the threads.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2021-05-03 22:10:38 +02: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
5 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#87982
No description provided.