Maniphest T60809

Crash undoing object rename in edit mode
Closed, Resolved

Assigned To
Campbell Barton (campbellbarton)
Authored By
seef (seef)
Jan 23 2019, 11:53 PM
Tags
  • BF Blender
Subscribers
Brecht Van Lommel (brecht)
matc (matc)
seef (seef)

Description

System Information
Operating system: Win10
Graphics card: GeforceGTX950

Blender Version
2.80, dc3b5024be1a4, 2019-01-23, win64

Blender sometimes crashs by pressing Ctrl+Z directly after a mesh renamed (in my case Cube.001)

SysInfo:

Revisions and Commits

rB Blender

Event Timeline

seef (seef) created this task.Jan 23 2019, 11:53 PM
Brecht Van Lommel (brecht) assigned this task to Campbell Barton (campbellbarton).Jan 24 2019, 7:32 AM
Brecht Van Lommel (brecht) lowered the priority of this task from 90 to 50.
Brecht Van Lommel (brecht) added a subscriber: Brecht Van Lommel (brecht).

Confirmed.

Enter edit mode on default cube, rename cube object, then press Ctrl+Z.

Brecht Van Lommel (brecht) renamed this task from Blender sometimes crashs by pressing Ctrl+Z directly after renaming a mesh to Crash undoing object rename in edit mode.Jan 24 2019, 7:32 AM
Brecht Van Lommel (brecht) added a subscriber: matc (matc).
matc (matc) added a comment.Jan 26 2019, 1:48 PM

This fixes the problem. But I'm not sure whether meshedit_undo should be handling this in the first place.

diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index 12cd8fc43e9..c2a814128af 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -126,8 +126,6 @@ static void undosys_id_ref_store(void *UNUSED(user_data), UndoRefID *id_ref)
 	BLI_assert(id_ref->name[0] == '\0');
 	if (id_ref->ptr) {
 		BLI_strncpy(id_ref->name, id_ref->ptr->name, sizeof(id_ref->name));
-		/* Not needed, just prevents stale data access. */
-		id_ref->ptr = NULL;
 	}
 }
Campbell Barton (campbellbarton) added a comment.EditedJan 28 2019, 9:50 AM

@matc (matc), this only works in the simple case, it wont work if a memfile undo step as been loaded.


On Friday I looked into possible fixes for this:

Some options are:

  • Add memfile undo pushes when renaming.
  • Use something besides the name (eg, a UUID) for each ID instead of it's name.
  • Use memfile undo for all modes and optimize it to remove the need for different undo systems (see: T56163).

I'll try some solutions this week in a branch and post any updates here.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved by committing rB78719abc01f1: Fix T60809: Crash undoing object rename in edit-mode.Jan 29 2019, 5:27 AM
Campbell Barton (campbellbarton) mentioned this in rB59a0a143ddb5: Library: tag memfile undo for writing after rename.
Campbell Barton (campbellbarton) added a commit: rB78719abc01f1: Fix T60809: Crash undoing object rename in edit-mode.