Crash on entering Edit Mode of high poly mesh used by Shrink Wrap #52149
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#52149
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/Blender Version:
Win8.1x64, 3x gtx580:
Ubuntu 14 x64, IntelGMA:
Short description of error
Entering edit mode on particular relatively high poly mesh, used by Shrink Wrap modifiers, crashes Blender 2.79 test build 2. If Shrink Wraps using the mesh are disabled - no crash. No crash on a much weaker virtually GPU-less Ubuntu machine or both machines in 2.78c.
Running from cmd:
Exact steps for others to reproduce the error
err3b.blend
Changed status to: 'Open'
Added subscriber: @KonstantinsVisnevskis
#52544 was marked as duplicate of this issue
#52353 was marked as duplicate of this issue
Added subscriber: @fablefox
I tried with latest daily build and didn't crash. Win 7 + GTX 750.
Daily build (e 982ebd) crashes for me.
OK. I can confirm this. Apparently, the crash might be random for me. I was testing writing debug log to disk, and changing to Edit Mode cause Blender to close with the error you mentioned.
Note to developer:
Try testing this multiple time if the first time didn't cause a crash. Maybe the first time changing the mode didn't cause a crash, but it might do something to memory. But subsequent opening the file and changing the mode will cause blender to crash with EXCEPTION_ACCESS_VIOLATION.
Also of note, Blender crash that involve such error doesn't flush error or anything to the text file, even if cmd box is OK. test2.txt remains empty.
OK. This bug is really strange. If I run blender -d without piping to text file, I get the original result as the first time testing this bug (no crash).
Another note, now that I try with piping to text again, no crash.
Conclusion: I can confirm this bug, but for me apparently its quite random...
Added subscriber: @mont29
EXCEPTION_ACCESS_VIOLATION
means Blender tries to access invalid memory - typically already freed one.Could be a threading issue e.g., can you reproduce it with
-t 1
option? Also, @fablefox, if you have a debug build of Blender, you should be able to use MSVC debugger to precisely locate the bug?Added subscriber: @LazyDodo
@mont29 here's a stackdump
looptri is pointing to invalid / freed memory.... don't know the code well enough to actually fix the bug here.
Added subscriber: @mano-wii
In my case, the looptri 553472 is pointing to the loops {4261281277, 0, 0} :\
I made these changes in the code and the problem was solved!:
I don't know why this change fixed the bug, but I've seen something that goes against the main goal of multithread, the performance.
In the file, two objects have the Shrinkwrap modifier with the high-poly object as target, so that two threads execute the code that searches the looptris of the high-poly object.
The problem is that the two threads execute the same
ccgDM_recalcLoopTri
function so one waits at the beginning of the function, to repeat it as soon as the other ends (BLI_rw_mutex_lock).This repetition is a total waste of processing. So it should be avoided.
Added subscribers: @Sergey, @ideasman42
Thanks for the investigations so far. :)
The problem is thread concurrency, as usual:
getLoopTriArray()
, which finds lopptri array is NULL and needs to be computed.recalcLoopTri()
and locked the RWmutex.Note that this is just an example, order could be totally different here, point is, there is no real protection against concurrency here.
Your solution works, but only in that specific case - if someone calls
recaclLoopTri
without passing bygetLoopTriArray()
, you'll again get concurrency issues.I think proper solution here would be to not expose
recalcLoopTri
at all in DM API, and instead feature aninvalidateLoopTri
callback tagging the looptri array as needing recomputation. That way, bothget
andinvalidate
functions could do proper lock and safetycheck inside locked area, to ensure they do not tip over other threads' toes.recalcLoopTri
would then just be internal static helper. Note that you also have to handle CDDM and EMDM!@ideasman42, @Sergey, thoughts?
Added subscriber: @BrandonGriffin
This issue was referenced by
00cb352790
Changed status from 'Open' to: 'Resolved'
Added subscriber: @pawelb