System Information
macOS 10.12.6
Intel Iris Graphics 6100 1536 MB
Blender Version
Broken: 2f3e890b94e blender2.8 (modified) (built from head of blender2.8 branch)
Short description of error
Blender crashes in macOS Intel OpenGL driver when rendering materials due to 0 being bound to the 'sssProfile' uniform block.
Exact steps for others to reproduce the error
- Open Blender.
- In the Properties Editor, select the Material tab.
- Use the dropdown near the top left of the window to switch the main area to the Shader Editor.
- In the Properties Editor, enable and disable 'Use Nodes' several times.
- Blender will crash with the following backtrace:
* thread #18, stop reason = EXC_BAD_ACCESS (code=1, address=0x100)
* frame #0: 0x00007fff84799178 IOAccelerator`IOAccelContextAddResource + 8
frame #1: 0x0000000117dcffa0 AppleIntelBDWGraphicsGLDriver`void updateBindingTable<SGfx3dStateBindingTablePointers>(GenContext*, unsigned int, SGfx3dStateBindingTablePointers&) + 2887
frame #2: 0x0000000117dcc9f3 AppleIntelBDWGraphicsGLDriver`GenContext::ProgramPipeline() + 15463
frame #3: 0x0000000117deabdd AppleIntelBDWGraphicsGLDriver`glrIntelRenderVertexArray + 391
frame #4: 0x000000011780bbc5 GLEngine`glDrawRangeElements_GL3Exec + 315
frame #5: 0x00007fff79ea1980 libGL.dylib`glDrawRangeElements + 45
frame #6: 0x0000000105ae43c4 blender`GWN_batch_draw_range_ex(batch=0x000060d00034d860, v_first=0, v_count=23040, force_instance=false) at gwn_batch.c:710
frame #7: 0x0000000100eb1b2e blender`draw_geometry_execute_ex(shgroup=0x0000631000461c40, geom=0x000060d00034d860, start=0, count=0, draw_instance=false) at draw_manager_exec.c:847
frame #8: 0x0000000100eb1f06 blender`draw_geometry_execute(shgroup=0x0000631000461c40, geom=0x000060d00034d860) at draw_manager_exec.c:854
frame #9: 0x0000000100eb0fb6 blender`draw_shgroup(shgroup=0x0000631000461c40, pass_state=525346) at draw_manager_exec.c:1159
frame #10: 0x0000000100eafa44 blender`drw_draw_pass_ex(pass=0x0000621000d00040, start_group=0x0000631000461ba0, end_group=0x0000631000461c40) at draw_manager_exec.c:1232
frame #11: 0x0000000100eaf954 blender`DRW_draw_pass(pass=0x0000621000d00040) at draw_manager_exec.c:1265
frame #12: 0x0000000100ee6b8c blender`EEVEE_draw_default_passes(psl=0x00006210002abd38) at eevee_materials.c:1753
frame #13: 0x0000000100ee9b06 blender`EEVEE_render_draw(vedata=0x000061700051bbb8, engine=0x00006180001728b8, rl=0x0000611000619bf8, rect=0x0000700007b66b88) at eevee_render.c:510
frame #14: 0x0000000100ed4dad blender`eevee_render_to_image(vedata=0x000061700051bbb8, engine=0x00006180001728b8, render_layer=0x0000611000619bf8, rect=0x0000700007b66b88) at eevee_engine.c:414
frame #15: 0x0000000100ea7455 blender`DRW_render_to_image(engine=0x00006180001728b8, depsgraph=0x0000611000379a38) at draw_manager.c:1548
frame #16: 0x0000000100868a74 blender`RE_engine_render(re=0x000062200012d938, do_all=0) at external_engine.c:740
frame #17: 0x000000010087aff5 blender`do_render_3d(re=0x000062200012d938) at pipeline.c:1082
frame #18: 0x000000010087d357 blender`RE_PreviewRender(re=0x000062200012d938, bmain=0x000061c00025d0b8, sce=0x000062200021c138) at pipeline.c:2624
frame #19: 0x00000001007751a7 blender`shader_preview_render(sp=0x0000611000373778, id=0x0000614000021078, split=0, first=0) at render_preview.c:750
frame #20: 0x0000000100774b81 blender`shader_preview_startjob(customdata=0x0000611000373778, stop=0x000061300037246c, do_update=0x000061300037246a) at render_preview.c:787
frame #21: 0x0000000100774469 blender`common_preview_startjob(customdata=0x0000611000373778, stop=0x000061300037246c, do_update=0x000061300037246a, UNUSED_progress=0x0000613000372470) at render_preview.c:1026
frame #22: 0x0000000100160f67 blender`do_job_thread(job_v=0x00006130003723f8) at wm_jobs.c:337
frame #23: 0x0000000101628cc1 blender`tslot_thread_start(tslot_p=0x000060b0003fdd38) at threads.c:253
frame #24: 0x00007fff8b3f093b libsystem_pthread.dylib`_pthread_body + 180
frame #25: 0x00007fff8b3f0887 libsystem_pthread.dylib`_pthread_start + 286
frame #26: 0x00007fff8b3f008d libsystem_pthread.dylib`thread_start + 13Investigation
I have debugged and managed to track the crash down to a missing uniform buffer. When the crash occurs, the active shader program has an active uniform block 'sssProfile'.
For the 'sssProfile' uniform block, GL_UNIFORM_BLOCK_BINDING is 0.
For uniform binding 0, GL_UNIFORM_BUFFER_BINDING is 0.
Therefore, there is no uniform buffer bound to the 'sssProfile' uniform block. I suspect there is also no texture bound to the 'sssTexProfile' sampler either. I am assuming for this shader this uniform block is coming from lamps_lib.glsl, although an identical uniform block is also present in effect_subsurface_frag.glsl.
I can prevent the crash by binding a dummy uniform buffer of the correct size to 'sssProfile'. In this case the rendering of the material in the preview appears corrupt.
I tried adding an #if !defined(USE_TRANSLUCENCY) || defined(VOLUMETRICS) around the uniform block and corresponding sss_profile function in the glsl file, but the problem persists. I suspect that there is a case where this uniform block is actually being accessed without the uniform buffer being bound.
My check for missing uniform buffers also fires on 'clip_block' in other shaders.
