Page MenuHome

Blender crashes during composited scenes rendering
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Ubuntu 19.10 64bit
Graphics card: GeForce GTX 1050 Ti 4gb Nvidia driver: 450.80.02

Blender Version
Broken: 2.91.0 Hash: 0f45cab862b8 master branch, 2.92.0 alpha Hash: 0da1fc2fc417 master branch
Worked: 2.83.10

Short description of error
Rendering of two simple composited scenes crashes in a couple of seconds after start
when Eevee and Workbench render engines are used. Cycle works well

It crashes in:

>	blender.exe!GPU_texture_mipmap_mode(GPUTexture * tex_, bool use_mipmap, bool use_filter) Line 483	C++
 	blender.exe!image_get_gpu_texture(Image * ima, ImageUser * iuser, ImBuf * ibuf, eGPUTextureTarget textarget) Line 402	C
 	blender.exe!space_image_gpu_texture_get(Image * image, ImageUser * iuser, ImBuf * ibuf, GPUTexture * * r_gpu_texture, bool * r_owns_texture, GPUTexture * * r_tex_tile_data) Line 139	C
 	blender.exe!image_gpu_texture_get(Image * image, ImageUser * iuser, ImBuf * ibuf, GPUTexture * * r_gpu_texture, bool * r_owns_texture, GPUTexture * * r_tex_tile_data) Line 174	C
 	blender.exe!image_cache_image(IMAGE_Data * vedata, Image * image, ImageUser * iuser, ImBuf * ibuf) Line 193	C
 	blender.exe!IMAGE_cache_init(void * ved) Line 328	C
 	blender.exe!drw_engines_cache_init() Line 1036	C
 	blender.exe!DRW_draw_render_loop_2d_ex(Depsgraph * depsgraph, ARegion * region, GPUViewport * viewport, const bContext * evil_C) Line 2106	C
 	blender.exe!image_main_region_draw(const bContext * C, ARegion * region) Line 658	C
 	blender.exe!ED_region_do_draw(bContext * C, ARegion * region) Line 551	C
 	blender.exe!wm_draw_window_offscreen(bContext * C, wmWindow * win, bool stereo) Line 732	C
 	blender.exe!wm_draw_window(bContext * C, wmWindow * win) Line 875	C
 	blender.exe!wm_draw_update(bContext * C) Line 1074	C
 	blender.exe!WM_main(bContext * C) Line 642	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 527	C
 	[External Code]

Exact steps for others to reproduce the error

  • open attached file or
    • use default startup scene with a cube
    • set RenderProperties > Film > Transparent on
    • make full copy of the scene
    • edit default cube a bit to make composition more meaningful
    • open Compositor and mix both scenes using Color > Mix node
  • try to render 100 frames of animation (doesn't matter jpeg, png, or ffmpeg video)

Event Timeline

A similar crash was reported in T83375, with the same driver version 450.80.02 on Linux.

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Jan 12 2021, 12:57 AM
Germano Cavalcante (mano-wii) triaged this task as High priority.
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

I can confirm the crash in release build using this file:

Apparently a thread frees the gpu_texture while the main thread is using the same texture pointer.

I'm not sure if we can trust the stack trace of a release build, but apparently the texture is freed here:

>	blender.exe!image_free_gpu(Image * ima, const bool immediate) Line 470	C
 	blender.exe!BKE_image_free_buffers_ex(Image * ima, bool do_lock) Line 503	C
 	blender.exe!BKE_image_signal(Main * bmain, Image * ima, ImageUser * iuser, int signal) Line 3477	C
 	blender.exe!CompositorOperation::deinitExecution() Line 117	C++
 	blender.exe!ExecutionSystem::execute() Line 194	C++
 	blender.exe!COM_execute(RenderData * rd, Scene * scene, bNodeTree * editingtree, int rendering, const ColorManagedViewSettings * viewSettings, const ColorManagedDisplaySettings * displaySettings, const char * viewName) Line 106	C++
 	blender.exe!ntreeCompositExecTree(Scene * scene, bNodeTree * ntree, RenderData * rd, int rendering, int do_preview, const ColorManagedViewSettings * view_settings, const ColorManagedDisplaySettings * display_settings, const unsigned char * view_name) Line 255	C
 	blender.exe!do_render_composite(Render * re) Line 1403	C
 	blender.exe!do_render_all_options(Render * re) Line 1619	C
 	blender.exe!RE_RenderAnim(Render * re, Main * bmain, Scene * scene, ViewLayer * single_layer, Object * camera_override, int sfra, int efra, int tfra) Line 2594	C
 	blender.exe!render_startjob(void * rjv, short * stop, short * do_update, float * progress) Line 667	C
 	blender.exe!do_job_thread(void * job_v) Line 390	C
 	[External Code]

While the same texture is used here: (*tex becomes NULL).

>	blender.exe!GPU_texture_mipmap_mode(GPUTexture * tex_, bool use_mipmap, bool use_filter) Line 483	C++
 	blender.exe!image_get_gpu_texture(Image * ima, ImageUser * iuser, ImBuf * ibuf, eGPUTextureTarget textarget) Line 402	C
 	blender.exe!space_image_gpu_texture_get(Image * image, ImageUser * iuser, ImBuf * ibuf, GPUTexture * * r_gpu_texture, bool * r_owns_texture, GPUTexture * * r_tex_tile_data) Line 139	C
 	blender.exe!image_gpu_texture_get(Image * image, ImageUser * iuser, ImBuf * ibuf, GPUTexture * * r_gpu_texture, bool * r_owns_texture, GPUTexture * * r_tex_tile_data) Line 174	C
 	blender.exe!image_cache_image(IMAGE_Data * vedata, Image * image, ImageUser * iuser, ImBuf * ibuf) Line 193	C
 	blender.exe!IMAGE_cache_init(void * ved) Line 328	C
 	blender.exe!drw_engines_cache_init() Line 1036	C
 	blender.exe!DRW_draw_render_loop_2d_ex(Depsgraph * depsgraph, ARegion * region, GPUViewport * viewport, const bContext * evil_C) Line 2106	C
 	blender.exe!image_main_region_draw(const bContext * C, ARegion * region) Line 658	C
 	blender.exe!ED_region_do_draw(bContext * C, ARegion * region) Line 551	C
 	blender.exe!wm_draw_window_offscreen(bContext * C, wmWindow * win, bool stereo) Line 732	C
 	blender.exe!wm_draw_window(bContext * C, wmWindow * win) Line 875	C
 	blender.exe!wm_draw_update(bContext * C) Line 1074	C
 	blender.exe!WM_main(bContext * C) Line 642	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 527	C
 	[External Code]

The stack trace is clear. When drawing the viewer node in the image editor or node backdrop the LOCK_DRAW_IMAGE isn't checked that is used in the CompositorOperation::deinitExecution thread.