Crash undoing after bpy.data.objects.remove() in editmode #65681

Closed
opened 2019-06-10 07:38:16 +02:00 by kursad k · 12 comments
Member

{F7097143}System Information
Operating system: Windows 10
Graphics card: Intel

Blender Version
blender-2.80.0-git.030c7df19da9-windows64

Short description of error

Blender crashes when undo is called if a lattice object is deleted in edit mode via an operator addon

Exact steps for others to reproduce the error

  • install the addon in the attachment (copy it to addons or as zip)

  • open the addon tab and search for "crasher"

  • enable it

  • open the violation.blend file that is in the addon folder (or from the zip file)

  • it should open in lattice (active) edit mode, if not select the lattice and toggle to edit mode

  • F3, search for simple operator

  • execute it

  • do not do anything else, just do undo (ctrl-z)

Blender will exit with


Error   : EXCEPTION_ACCESS_VIOLATION 
Address : 0x00007FF65A3BDF97

It seems like it is possible to avoid the crash only if the user does some other stuff like selecting moving other objects after firing the addon however this does not help with the addon context, not possible to avoid this as far as I can tell.

I originally thought that using bpy.data.objects.remove(l) was causing this however using the ops equivalent bpy.ops.object.delete(use_global=False) does the same ill affect.

{[F7097143](https://archive.blender.org/developer/F7097143/simpleoperator.zip)}**System Information** Operating system: Windows 10 Graphics card: Intel **Blender Version** blender-2.80.0-git.030c7df19da9-windows64 **Short description of error** Blender crashes when undo is called if a lattice object is deleted in edit mode via an operator addon **Exact steps for others to reproduce the error** - install the addon in the attachment (copy it to addons or as zip) - open the addon tab and search for "crasher" - enable it - open the `violation.blend` file that is in the addon folder (or from the zip file) - it should open in lattice (active) edit mode, if not select the lattice and toggle to edit mode - F3, search for simple operator - execute it - do not do anything else, just do `undo` (ctrl-z) Blender will exit with ``` Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF65A3BDF97 ``` It seems like it is possible to avoid the crash only if the user does some other stuff like selecting moving other objects after firing the addon however this does not help with the addon context, not possible to avoid this as far as I can tell. I originally thought that using `bpy.data.objects.remove(l)` was causing this however using the ops equivalent `bpy.ops.object.delete(use_global=False)` does the same ill affect.
Author
Member

Added subscriber: @kursadk

Added subscriber: @kursadk
Author
Member

Here is an strace of when it crashed, I got it under Winx64 10, MSYS. Probably not that useful


00007ff879060000
--- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\number\c_utils.cp37-win_amd64.pyd at 00007ff879040000
--- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\number\float_math.cp37-win_amd64.pyd at 00007ff879010000
--- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\vector\vector_math.cp37-win_amd64.pyd at 00007ff878fe0000
--- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\vector\c_utils.cp37-win_amd64.pyd at 00007ff878fc0000
--- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\object\object_matrix_output.cp37-win_amd64.pyd at 00007ff878fa0000
--- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\rotation\c_utils.cp37-win_amd64.pyd at 00007ff878f80000
--- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\spline\c_utils.cp37-win_amd64.pyd at 00007ff878f60000
--- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\spline\splines_from_edges_utils.cp37-win_amd64.pyd at 00007ff878f40000
--- Process 2420 loaded C:\Windows\System32\UIAutomationCore.dll at 00007ff89ef90000
--- Process 2420 loaded C:\Windows\System32\userenv.dll at 00007ff8b6130000
--- Process 2420 thread 9888 created
--- Process 2420 thread 212 created
--- Process 2420 loaded C:\Windows\System32\sxs.dll at 00007ff8b6bf0000
--- Process 2420 thread 9568 exited with status 0x0
--- Process 2420 thread 10296 exited with status 0x0
--- Process 2420 loaded C:\Windows\System32\oleacc.dll at 00007ff8a8780000
--- Process 2420 loaded C:\Windows\System32\twinapi.dll at 00007ff89d660000
--- Process 2420, exception c0000005 at 00007ff65a3bdf97
--- Process 2420 thread 9372 exited with status 0xff
--- Process 2420 thread 11124 exited with status 0xff
--- Process 2420 thread 9888 exited with status 0xff
--- Process 2420 thread 9320 exited with status 0xff
--- Process 2420 thread 11068 exited with status 0xff
--- Process 2420 thread 1240 exited with status 0xff
--- Process 2420 thread 11256 exited with status 0xff
--- Process 2420 thread 6224 exited with status 0xff
--- Process 2420 thread 2640 exited with status 0xff
--- Process 2420 thread 5556 exited with status 0xff
--- Process 2420 thread 9772 exited with status 0xff
--- Process 2420 thread 8436 exited with status 0xff
--- Process 2420 thread 2568 exited with status 0xff
--- Process 2420 thread 5480 exited with status 0xff
--- Process 2420 thread 9500 exited with status 0xff
--- Process 2420 thread 2376 exited with status 0xff
--- Process 2420 thread 10920 exited with status 0xff
--- Process 2420 thread 5708 exited with status 0xff
--- Process 2420 thread 212 exited with status 0xff
--- Process 2420 exited with status 0xff

Here is an strace of when it crashed, I got it under Winx64 10, MSYS. Probably not that useful ``` 00007ff879060000 --- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\number\c_utils.cp37-win_amd64.pyd at 00007ff879040000 --- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\number\float_math.cp37-win_amd64.pyd at 00007ff879010000 --- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\vector\vector_math.cp37-win_amd64.pyd at 00007ff878fe0000 --- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\vector\c_utils.cp37-win_amd64.pyd at 00007ff878fc0000 --- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\object\object_matrix_output.cp37-win_amd64.pyd at 00007ff878fa0000 --- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\rotation\c_utils.cp37-win_amd64.pyd at 00007ff878f80000 --- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\spline\c_utils.cp37-win_amd64.pyd at 00007ff878f60000 --- Process 2420 loaded C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\animation_nodes\nodes\spline\splines_from_edges_utils.cp37-win_amd64.pyd at 00007ff878f40000 --- Process 2420 loaded C:\Windows\System32\UIAutomationCore.dll at 00007ff89ef90000 --- Process 2420 loaded C:\Windows\System32\userenv.dll at 00007ff8b6130000 --- Process 2420 thread 9888 created --- Process 2420 thread 212 created --- Process 2420 loaded C:\Windows\System32\sxs.dll at 00007ff8b6bf0000 --- Process 2420 thread 9568 exited with status 0x0 --- Process 2420 thread 10296 exited with status 0x0 --- Process 2420 loaded C:\Windows\System32\oleacc.dll at 00007ff8a8780000 --- Process 2420 loaded C:\Windows\System32\twinapi.dll at 00007ff89d660000 --- Process 2420, exception c0000005 at 00007ff65a3bdf97 --- Process 2420 thread 9372 exited with status 0xff --- Process 2420 thread 11124 exited with status 0xff --- Process 2420 thread 9888 exited with status 0xff --- Process 2420 thread 9320 exited with status 0xff --- Process 2420 thread 11068 exited with status 0xff --- Process 2420 thread 1240 exited with status 0xff --- Process 2420 thread 11256 exited with status 0xff --- Process 2420 thread 6224 exited with status 0xff --- Process 2420 thread 2640 exited with status 0xff --- Process 2420 thread 5556 exited with status 0xff --- Process 2420 thread 9772 exited with status 0xff --- Process 2420 thread 8436 exited with status 0xff --- Process 2420 thread 2568 exited with status 0xff --- Process 2420 thread 5480 exited with status 0xff --- Process 2420 thread 9500 exited with status 0xff --- Process 2420 thread 2376 exited with status 0xff --- Process 2420 thread 10920 exited with status 0xff --- Process 2420 thread 5708 exited with status 0xff --- Process 2420 thread 212 exited with status 0xff --- Process 2420 exited with status 0xff ```
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Backtrace is a bit misleading [since this is reproducable without animation_nodes enabled], but can confirm, checking...
Deleting from the UI has a valid Lattice->editlatt in lattice_undosys_poll / editlatt_object_from_context whereas doing this from python doesnt...

Backtrace is a bit misleading [since this is reproducable without animation_nodes enabled], but can confirm, checking... Deleting from the UI has a valid `Lattice->editlatt` in `lattice_undosys_poll` / `editlatt_object_from_context` whereas doing this from python doesnt...
Philipp Oeser changed title from Blender crashes with EXCEPTION_ACCESS_VIOLATION when undoing to Crash undoing a removal of a lattice via python 2019-06-11 10:18:36 +02:00
Author
Member

@lichtwerk

Thanks for conforming the bug. Do you know a work around with the API so I can avoid the crash until this is fixed?

@lichtwerk Thanks for conforming the bug. Do you know a work around with the API so I can avoid the crash until this is fixed?
Author
Member

It seems like this bug not just affecting undo delete but also it crashes Blender after undoing lattice naming and other Lattice objct related operations

It seems like this bug not just affecting undo delete but also it crashes Blender after undoing lattice naming and other Lattice objct related operations
Member

Added subscriber: @JosephEagar

Added subscriber: @JosephEagar
Member

Okay, looks like the problem is with the undo system; if you manually exit editmode then push the understack, e.g.:

bpy.ops.object.editmode_toggle()
bpy.ops.ed.undo_push()

the crash won't happen.

I imagine this could be tricky to fix; it might be a good idea to prohibit python deletion of objects in editmode.

Okay, looks like the problem is with the undo system; if you manually exit editmode then push the understack, e.g.: bpy.ops.object.editmode_toggle() bpy.ops.ed.undo_push() the crash won't happen. I imagine this could be tricky to fix; it might be a good idea to prohibit python deletion of objects in editmode.
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Author
Member

As far as I can tell the solution recommended by @JosephEagar works in this case. I will test it further but I was able to overcome the hard crashes I have been facing when ediitng the lattice in an operator.

As far as I can tell the solution recommended by @JosephEagar works in this case. I will test it further but I was able to overcome the hard crashes I have been facing when ediitng the lattice in an operator.
Campbell Barton was assigned by Philipp Oeser 2019-06-17 09:29:30 +02:00
Campbell Barton was unassigned by Dalai Felinto 2019-12-23 16:34:08 +01:00
Member

Reconfirmed, true for all object types that support editmode...

Reconfirmed, true for all object types that support editmode...
Philipp Oeser changed title from Crash undoing a removal of a lattice via python to Crash undoing after bpy.data.objects.remove() in editmode 2020-02-05 16:00:41 +01:00

Closed as duplicate of #77557

Closed as duplicate of #77557
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
4 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#65681
No description provided.