EXCEPTION_ACCESS_VIOLATION crash when removing modifiers or rendering #47715

Closed
opened 2016-03-07 17:39:42 +01:00 by Ray Mairlot · 11 comments

System Information
Windows 10 64-bit, Nvidia GTX 570

Blender Version
Broken: 2.76b, 7499fcf (latest 2.77 64-bit build)
Worked: -

Short description of error

I have a specific file that immediately crashes (blender closes without warning) when rendering or when removing any modifiers (apart from the first 2) on a specific object. I have simplified the file as much as I can.

  • If I remove any of the objects in the second scene (they are targets of the shrinkwrap modifiers on the problematic object), the file successfully renders.
  • If I remove either of the first two modifiers on the problematic object, the file will render.
  • If I delete any more than a few faces in the object 'Shrinkwrap 1' (the target of the first shrinkwrap modifier on the problematic object), the file will render.

All crashes result in 'EXCEPTION_ACCESS_VIOLATION' being displayed (when running blender from the command line). 99% of the time that's the error, I did once see a 'divide by zero' error.

Just in case it is important, the object 'Shrinkwrap 2' (the target of the second shrinkwrap modifier) also uses 'Shrinkwrap one' (the target of the first shrinkwrap modifier) as the target on its own shrinkwrap modifier.

Exact steps for others to reproduce the error

Using this file: Shrinkwrap Crash.blend

  • Open the file.
  • Press 'Render' or 'F12'.

File instantly crashes.

Alternatively:

  • Open the file.
  • Remove any modifier below the first two on the object called 'Main object'.
  • File instantly crashes.
**System Information** Windows 10 64-bit, Nvidia GTX 570 **Blender Version** Broken: 2.76b, 7499fcf (latest 2.77 64-bit build) Worked: - **Short description of error** I have a specific file that immediately crashes (blender closes without warning) when rendering or when removing any modifiers (apart from the first 2) on a specific object. I have simplified the file as much as I can. - If I remove any of the objects in the second scene (they are targets of the shrinkwrap modifiers on the problematic object), the file successfully renders. - If I remove either of the first two modifiers on the problematic object, the file will render. - If I delete any more than a few faces in the object 'Shrinkwrap 1' (the target of the first shrinkwrap modifier on the problematic object), the file will render. All crashes result in 'EXCEPTION_ACCESS_VIOLATION' being displayed (when running blender from the command line). 99% of the time that's the error, I did once see a 'divide by zero' error. Just in case it is important, the object 'Shrinkwrap 2' (the target of the second shrinkwrap modifier) also uses 'Shrinkwrap one' (the target of the first shrinkwrap modifier) as the target on its own shrinkwrap modifier. **Exact steps for others to reproduce the error** Using this file: [Shrinkwrap Crash.blend](https://archive.blender.org/developer/F288957/Shrinkwrap_Crash.blend) - Open the file. - Press 'Render' or 'F12'. # File instantly crashes. Alternatively: - Open the file. - Remove any modifier below the first two on the object called 'Main object'. - File instantly crashes.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @RayMairlot

Added subscriber: @RayMairlot

Added subscriber: @sindra1961

Added subscriber: @sindra1961

If you run blender with --enable-new-depsgraph, this will not occur.

If you run blender with --enable-new-depsgraph, this will not occur.

Added subscriber: @Sergey

Added subscriber: @Sergey

This is a threading conflict. New depsgraph perhaps has different timing which avoids the crash, root of the issue is outside of the depsgraph.

This is a threading conflict. New depsgraph perhaps has different timing which avoids the crash, root of the issue is outside of the depsgraph.

Added subscribers: @mont29, @ideasman42

Added subscribers: @mont29, @ideasman42

Yeah… Same old issue again, modifiers using a DM from another object are a real problem (here, ShrinkwrapCalcData.target DM), we hit that issue several times in the past already.

Manage to fix part of the issues here by making a local copy (CDDM_copy) of it in shrinkwrapModifier_deform, but even then, manage to get a crash (likely because the target->derived_final was being freed while being fetched/copied in other thread).

We could:

  • Have a global modifiers lock (like the ones we have for nodes, fftw, etc.).
  • Use that lock when freeing the derivedFinal.
  • Add a modifiers-dedicated helper to get a DM, which would always return a copy of the derivedFinal (and be threadsafe too of course).

Or also, use a (thread-safe, trivial with atomic ops) refcount for DMs maybe? This would also avoid the need to copy other-objects DM in modifiers…

Yeah… Same old issue again, modifiers using a DM from another object are a real problem (here, `ShrinkwrapCalcData.target` DM), we hit that issue several times in the past already. Manage to fix part of the issues here by making a local copy (`CDDM_copy`) of it in `shrinkwrapModifier_deform`, but even then, manage to get a crash (likely because the target->derived_final was being freed while being fetched/copied in other thread). We could: * Have a global modifiers lock (like the ones we have for nodes, fftw, etc.). * Use that lock when freeing the `derivedFinal`. * Add a modifiers-dedicated helper to get a DM, which would always return a copy of the `derivedFinal` (and be threadsafe too of course). Or also, use a (thread-safe, trivial with atomic ops) refcount for DMs maybe? This would also avoid the need to copy other-objects DM in modifiers…

@mont29, modifiers are totally allowed to use other object's derived mesh. There are two possibilities here:

  • The derived mesh which is used by shrinkwrap was not fully updated before the modifier started evaluation. This would mean missing relation in the dependency graph.
  • Shrinkwrap modifies other object's derived mesh, This is forbidden and must not be worked around with reference counters.

Once those points are ensured none of local DM copy or refcounting are needed.

@mont29, modifiers are totally allowed to use other object's derived mesh. There are two possibilities here: - The derived mesh which is used by shrinkwrap was not fully updated before the modifier started evaluation. This would mean missing relation in the dependency graph. - Shrinkwrap modifies other object's derived mesh, This is forbidden and must not be worked around with reference counters. Once those points are ensured none of local DM copy or refcounting are needed.

This issue was referenced by 94a6019a7b

This issue was referenced by 94a6019a7ba94f8b46b737c185293ecce19cc6a6

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
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
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#47715
No description provided.