Crash when undoing deletion of last shape key. #44439
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#44439
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
NA
Blender Version
Broken: (example: current master
Worked: no idea (you need a debug build to reproduce the crash it seems)
Short description of error
Undoing deletion of the last shapekeys, asan breaks on freed memory access (from Outliner's tselem->id of the deleted shapekey).
I think what happens is the undo step gets saved after deletion of the skey ID, but before Outliner's get updated? Still investigating...
Exact steps for others to reproduce the error
Just add some shape keys to default cube, remove them, and undo, in debug build with asan crash is 100% reproducible, with following info:
P220: (An Untitled Masterwork)
Changed status to: 'Open'
Added subscriber: @mont29
Added subscribers: @Sergey, @ideasman42
Sergey, Campbell, working on this one, but if you have some quick and obvious idea about what happens exactly and how to fix it… ;)
So so far, here is the issue as I understand it:
I tried not restoring pointers of 'unused' tselem, it seems to work, but not quite sure it's desired… this means all 'stored' unused tselem become useless then. Still trying to understand what goes on here and how to fix it properly.
OK, so learning further, seems that tselem->used is not to be used at all here - unused (free) tselem shall have a NULL id value (used seems to be used just to tag newly created tselem or something like that :/ ).
Now, as far as I follow outliner code, tselems do not seem to be ever actually released (except by big nuke BLI_mempool_destroy)? And only object seem to care to set tselem->id to NULL (in BKE_object_unlink)… Soooo… do we end up having tons of invalid pointers dangling like that in unused tselems? and if so, why does it not crash more often? Because we rather seldomly actually free IDs?
Actually, found we could get same crash in other cases (e.g. shift-click on a material ID selector of a matslot, delete material from py console (
bpy.data.materials.remove(bpy.data.materials['my_mat'])
), and undo -> crash).Proposed patch: D1272
This issue was referenced by
f271d85b86
Changed status from 'Open' to: 'Resolved'
Closed by commit
f271d85b86
.