Duplicate Object, then Linked Duplicate Object, then Repeat Last Tool causes crash #77867
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#77867
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.18362-SP0 64 Bits
Graphics card: GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.20
Blender Version
Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-06-12 17:01, hash:
fd8d245e6a
Worked: 2.83.0
Short description of error
Crash when redoing Duplicate Linked several times in a row
ShiftD AltD Crash.mkv
Exact steps for others to reproduce the error
Added subscriber: @heavypoly
#78098 was marked as duplicate of this issue
#78448 was marked as duplicate of this issue
#77547 was marked as duplicate of this issue
Added subscriber: @deadpin
I can confirm this crash here as well using a slightly newer build even. However, it sometimes doesn't happen during the first shift-d, alt-d, repeat cycle. It usually happens on the second attempt for me.
Also, I cannot get a good stack trace for the issue. Of the 3 times I attempted it, I'm getting crashes in 3 different areas... 2 of those have BLI_task_* functions in the stack somewhere so there's a good chance this is threading related :-/
[EDIT] Actually, my 3 crashes happen when undo'ing and not strictly with repeating last.
Added subscriber: @mano-wii
Changed status from 'Needs Triage' to: 'Needs User Info'
I cannot reproduce this with the current development versions of Blender:
Go to File → Defaults → Load Factory Settings and then load your file to see if you still can reproduce this issue.
If the problem persists, please give us more clear instructions on how to reproduce it from scratch.
ShiftD AltD Crash.mkv
Here's a video showing the exact steps.
Using today's daily build from builder.blender.org and load factory settings.
Changed status from 'Needs User Info' to: 'Needs Triage'
Changed status from 'Needs Triage' to: 'Confirmed'
I can confirm in Release build only.
But I'm still not sure what causes the crash.
For the traceback it seems to be on Depsgraph.
Added subscriber: @Jeroen-Bakker
After further testing, it seems that the source of the problem is in draw_manager.
Commenting on that line seems to have resolved so far:
@Jeroen-Bakker, does this have anything to do with recent changes to fix the wires drawing problem?
Changed status from 'Confirmed' to: 'Needs User Info'
I can't reproduce the problem anymore.
I think this problem was related to the same problem described in #78004 (which was recently fixed).
A build with the fix will be available tomorrow.
Please check and confirm as soon as available: https://builder.blender.org/download/
Unfortunately I can now repro more reliably (without having to use Undo; but still involving tbb / threading) with latest master
b89898cbd3
. Here's the full crash report: blender.crash.txtStill getting the same crash with same Shift D, Alt D, Shift RRRRRRRRRR steps as before.
Using today's build (Windows)
6899cb3c07
Changed status from 'Needs User Info' to: 'Needs Triage'
Changed status from 'Needs Triage' to: 'Confirmed'
Also crashes when right clicking a collection in outliner > Instance to scene, then Shift D the newly instanced collection.
However does not crash when using Alt D on instanced collection
Added subscriber: @jwun
Added subscribers: @FabianOrrego, @NanoGlyph, @xela_aklarts, @Alaska
Added subscribers: @VincentBlankfield, @antoniov
Can someone retest this issue. There were several issues solved in this area and I ain't able to reproduce it. I also checked related tasks.
Still reproducible in 2.90.0 Alpha, branch: master, commit date: 2020-07-13 15:08, hash:
29da019cb3
The condition of the assert from my merged report #78448 still fails. It's
BLI_assert(mr->cache->surface_per_mat- [x]->elem == ibo)
fromextract_tris_finish
indraw_cache_extract_mesh.c
. It's condition fails reliably in release build whenever the Duplicate Linked (Alt+D) operation is performed. Tested only on Windows.Was also able to reproduce the crash using steps from this report. Though for me the probability of reproducing it is and always have been about 0.001. The crash happened in
extract_pos_nor_iter_poly_mesh
ofdraw_cache_extract_mesh.c
:vert->pos
was NULL incopy_v3_v3(vert->pos, mv->co);
.Stack trace of thread 1 (crashed):
Stack trace of thread 2 (in parallel with the crashed one):
Note: The line numbers for
draw_cache_extract_mesh.c
in the stack traces may be few lines off - that's because I added print statements to check the assert condition in the release build. Nothing else was changed.I am able to reproduce on linux (release builds) using the repeat last action method. Thanks for the clarification!
I think that the reason why you cannot reproduce this in debug builds is that the threading method is synced to validate if every batch is created. During release mode this isn't the case and the sync is skipped. I will remove this section and see what is going on.
I have been looking into some alternatives to solve this issue.
Alternatives
Solution 1: Calculate single mesh/ob
+
This fixes the issue-
but has a huge performance penalty. (02_020_A.anim.blend 12.5fps => 11fps)-
IBO's are throw away before any usageSolution 2: Check for validity when extracting the IBO
-
code not clean could lead to usage after free-
IBO's are throw away before any usage-
Can still fail due to threading issues, just less likelySolution 3: Split DRW_mesh_batch_cache_create_requested
split DRW_mesh_batch_cache_create_requested so it only does (create requested). This means that it is only valid
to be called when all meshes are processed. Creates a GHash of all meshes and what needs to be done based on the
given object. schedule and start the extraction when all meshes have been checked.
NOTE: This could be optimized if we are 100% sure there is only a single user of the object. If that is the case there is
only a single object and we know that another object won't discard the IBO/VBO that are being calculated at that moment.
Solution 4: Combine Surface and Surface per material batch creation
Solution 3 would still work around the hack in the code-base. Solution 4 works on the idea that surface per material is most likely what users want. So why don't we combine the two batch creations so we could remove the hack.
NOTE: This solution could also add two fast paths for meshes with one or two materials.
This issue was referenced by
9582797d4b
Changed status from 'Confirmed' to: 'Resolved'
Added subscribers: @aleksijuvani, @lichtwerk