Regression: Geometry Nodes: Access Violation Exception when copying from Mesh with GPU Subdivision Surface Modifier #113377
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
10 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#113377
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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 Pro
Graphics card: NVIDIA GeForce RTX 3060 Ti
Blender Version
Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-11-11 21:32, hash:
rB03ccf37162d3
Worked: version: 3.5.0 Alpha, branch: master, commit date: 2022-11-10 21:29, hash:
rBca1642cd0c5c
Short description of error
I was fiddling around with steps to reproduce an earlier report issues/113358, but stumbled across another way to crash blender with an access violation (might be related, might not). Setting up a scene where a base object has a subdivision modifier from which another object then copies causes a crash when you try to edit both at once. Other generative modifiers don't seem to be affected.
Interestingly, this crash does not occur when both objects have mesh data with the same layout (i.e. both are cubes/spheres/monkeys as created by the add mesh operator)
Steps to Crash
1.Open the file CopyDataCrash.blend.
2. Select
Cube.001
andOutline.001
(the order doesn't seem to matter).3. Try tabbing into edit mode.
4. at this point, blender should have crashed with an
EXCEPTION_ACCESS_VIOLATION
(Report CopyDataCrash.crash.txt attached).The other cube+outline objects are included to show that only the subdivision surface modifier seems to be affected. Using the same steps on those groups does not produce a crash.
Workarounds
Any one of these will prevent a crash:
Cube.001
or the Geometry Nodes onOutline.001
.Outline.001
in edit mode (such that bothCube.001
andOutline.001
have the same amount/layout of faces).Geometry Nodes | Access Violation Exception when copying from Mesh with Subdivision Surface Modifierto Regression: Geometry Nodes: Access Violation Exception when copying from Mesh with GPU Subdivision Surface ModifierI really don't know who is causer, there are too many potential causes:
88c956c13b
/ @Jeroen-Bakkerff7645c5ed
/ @HooglyBoogly6295bdfd38
/ @JacquesLuckeOn the one hand, all this seems indirectly related, but at the same time i won’t say that anyone is definitely guilty, since it’s clearly not directly related.
88c956c13b
should only impacts rendering, not viewport drawing. Has anyone been able to reproduce the issue? We could revert this commit and see if it still fails.I agree that the other mentioned commits aren't directly related.
Up to date call stack. (Blender 4.1)
It seems like inconsistency in the data model.
I will assign it to EEVEE/Viewport module as the crash occurs there.
When switching to edit mode it seems like one bmesh instance doesn't match the mesh it represents. Its faces, edges and vertices are empty. Which crashes blender. So it might be that the input data isn't complete.
DRW_create_subdivision
->draw_subdiv_create_requested_buffers
.Same callstack as in #114141
Will dare setting this to High priority (since this is a crasher which is not too uncommon to run into)
I've been taking a look at this.
I can avoid the crash by checking if
bm->totface == mr.face_len
indraw_subdiv_cache_extra_coarse_face_data_mapped
.But that's more a hacky workaround than a fix.
I guess a proper fix would be to check if there's any meaningful mapping between the edit and the eval mesh at
mesh_render_data_create
and don't set theorigindex
variables when there isn't (?).But I don't see any way to do so. Maybe @HooglyBoogly can shed some light?
The point of this
draw_subdiv_cache_extra_coarse_face_data_mapped
code path is to reasonably extract edit mesh data for the corresponding faces in the evaluated mesh. Thep_origindex
map means it's supposed to be fine if the number of faces don't match. SO I don't think that's the right solution. But I'll spend some time looking into this and see if I can find something.The problem here is the combination of the object info node with both object's in edit mode. The source object's mesh has
CD_ORIGINDEX
layers referring to its own edit mesh, then the second object uses those mapping layers when its own edit mesh is empty.I think the fix here is to properly propagate the
Mesh::edit_mesh
pointer through the modifier stack, including nodes, instead of just setting the pointers at the end of evaluation as currently happens ineditbmesh_build_data
. That way, when the mesh is completely replaced from a mesh from another object, the edit mesh pointer from that object would come with it.Design wise, that's basically how the current code "should" be working. But it's probably not trivial. So maybe we can find a temporary fix too.
Maybe
CD_ORIGINDEX
layers should be cleared when importing geometry into another object's geometry node tree? So that there is no mapping.Mapping face selection from one object to another object seems tricky, and probably enough of a corner case that it's not worth supporting.
That's probably the best short term fix. But it's also not trivial. Currently I'm not sure we can do that without destroying visibility of object instances, etc. in the object info node. But it could be doable.
I do think that assigning the active object's
edit_mesh
pointer to an evaluated mesh derived from a completely different object is wrong though. I'd like that to be solved so we wouldn't run into this problem eventually too.This seems resolved. Can anyone confirm?
No, it's not resolved, I can still reproduce the crash in main.
Any updates here? I suggest to either lower the priority if this needs more design and work or try to find some time to at add a workaround.
I have done the groundwork for a proper fix already. I started with #120276 and some other related cleanups. #113377 is the fix. I now need input from the EEVEE & Viewport module about when the cage/edit mode drawing should happen. The existing code is unclear there and the inputs for that decision are slightly different now. If I get help there I can finish up the fix relatively quickly, but that's what I've been waiting for.
excuse me. 113377 is this ticket itself. I assume you meant to say #120999?