Crash on leaving local view on the shading tab. #64551
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#64551
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
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64
Blender Version
Broken: version: 2.80 (sub 62), branch: master, commit date: 2019-05-13 09:55, hash:
86650b01d8
Worked: (optional)
Short description of error
When leaving the local view on the shading tab there is a exception raise (with crash) due to a null on cache->surf_per_mat_tris
It seems surf_per_mat_tris is missing from cache.
line 5306 - draw_cache_impl_mesh.c
Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]
Added subscriber: @dgsantana
As a workaround I added a null check to my local build just to avoid this, mostly because I don't know where the cache is populated, still "learning" my way around the blender source code.
Added subscriber: @lichtwerk
Cannot reproduce here (maybe I am misunderstanding something).
View
>Local View
>Toggle Local View
in the Shading workspace (cannot get it to crash/assert there)?Unfortunately, I can't share the file. This happens after working for a while. I was doing complex baking of some meshes, in the Shading workspace. This happened twice until I added the null pointer check, one of the time was while leaving the Local View (/ Numpad), the other was whne moving from the Shading to the Layout workspace. I will make a build without my patch to see if I get any crash during the day.
And it still crashed. Left blender rendering a Diffuse bake map, and went to take care of my garden. Come back and it crashed in the same line. Going to put back the null check again.
State of blender at crash.
Stack trace:
Just for the record the fix is just this:
@fclem, does this ring a bell?
I was looking into the code where surf_per_mat_tris is inited, and there may be a corner case that could cause this, I have some objects without materials and the allocation takes in account the material count, well if the material count is zero, the new array pointer will be effectively zero in length.
This happens on draw_cache_impl_mesh.c line 2105.
To me, it sounds like it has to do with some VBO garbage collection we are doing.
@lichtwerk can you confirm?
And diving a little further, the MEM_lockfree_callocN makes no assumption on the request memory block asked, so if we ask a 0 block it will create one because it always has some memory used by MemHead. But I don't see a problem with this, and of course maybe its by design.
If you guys guide me a little, since I don't know the blender code (I used to create plugins for 3dsmax, houdini and maya in the past), maybe I can help track the problem. @fclem Where should I look for the garbage collection, I quite savvy on C/C++, have about 20 years of developer experience in all kinds of languages including C/C++.
Call stack for the latest commit (
3db4284
- Fix #64601 Error division by zero in GPUVertexFormat) :@dgsantana the garbage collection happens in DRW_batch_cache_free_old. But let me investigate this.
It a bit weird, now it happened when zooming out on the layout workspace with Solid Texture mode. Spend an hour doing decimate on highpoly to low poly people, switching from Wire to Solid Texture, and done tons of zoom in/out. When I was about to call it a day, and zooming out to see the an overview, puff :D.
No work lost thanks to great the autoback ;).
This issue was referenced by
e9b282617a
Changed status from 'Open' to: 'Resolved'