Crash due to zero uniform buffer binding for sssProfile #55475
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#55475
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
macOS 10.12.6
Intel Iris Graphics 6100 1536 MB
Blender Version
Broken:
2f3e890b94
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
Investigation
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.
Added subscriber: @EdmundKapusniak
#56132 was marked as duplicate of this issue
Added subscribers: @fclem, @brecht
Assigning to @fclem for advice.
There was a bad free of Uniform buffer as well as framebuffers that happened when using the shader preview. This was fixed.
@EdmundKapusniak can you still reproduce with latest build?
Unfortunately yes, the crash is intermittent but still happens in build dated 2018-07-28, hash
f50fa4c5d6
.Same repro steps:
Here is the backtrace from the Apple crash report dialog, very similar to the backtrace above:
The crash appears to be somehow timing dependent - performing the repro steps quickly will result in a greater chance of it crashing. I have attached a screenshot of the artefacts on the material.
Here is a patch for gpu_batch.c that detects when there are missing uniform buffers.
With
PREVENT_CRASH
defined, a dummy uniform buffer is created and bound to the missing active uniform blocks. In this case, the materials still render with artefacts, but I have not been able to reproduce the crash.Example output while rendering material previews with this patch applied:
#55475-debug.diff
Added subscribers: @kostex, @ArtoKitula, @brita
This is indeed Intel-only thing. I can crash blender on GPU_batch_draw_range_ex when enabling only Intel GPU on my MacBookPro.
Should be fixed by
3578212e46
@EdmundKapusniak Thanks for the patch it was very helpful. I integrated it to the debug build.
@ArtoKitula Can you try again with the latest build?
I've built blender
2a8413a0dd
So far I can say it's a stable build regarding this issue!
Cool!
Changed status from 'Open' to: 'Resolved'
@fclem tested, works. marking as resolved.