[4.9.0] - Undo In Certain Case Causes Crash

Hey Guys,

Found a bug in 4.9. I created an asset after deleting one. I was going to rename the new asset the as the new one but forgot that I needed to submit to source control. Without thinking, I accidently hit Ctrl+Z to undo and it caused an editor crash.

More specifically, its in Transactor.h at the following line of code…
Res = ReferencedObjects[ObjectIndex].GetObject();

FArchive& operator<<( class UObject*& Res ) override
			{
				int32 ObjectIndex = 0;
				(FArchive&)*this << ObjectIndex;
				Res = ReferencedObjects[ObjectIndex].GetObject();
				return *this;
			}

ObjectIndex was showing a value of 65537 and the size at the time of the ReferencedObjects array was 2

Hope this helps and the team is having a great week :smiley:

Thanks!

Hi MC Stryker,

I tried to reproduce this in a new test project, but was unable to do so. After creating several assets, saving, closing and reopening the project, I deleted one of the assets, then created a new asset and pressed Ctrl-Z. Nothing happened. When I checked the Undo history, it was empty. Would you be able to provide some additional information?

  • Do you recall specifically what type of asset you had deleted and created just prior to the crash?
  • Do you recall if you had made any edits to the deleted asset just before it was deleted?

Hey , long time buddy.

Let me think here… okay I think I remember a couple other details about what I was doing at that moment. I had created a Blueprint (Pawn based Actor) a while back and wanted to replace it with another that had the same name. Mind you, on this game, its using Perforce and was active at the time during this (in case Perforce is related).

I didn’t have any of those Actors in the scene at the time so no instances present and what I usually do is rename an Asset to ‘Name’_DEPRECIATED and on the next build check-in, I then usually re-reference that asset in any levels/actor instances current (in a case like this where I wanted it to be re-created). I think I was moving real quick and deleted the original asset, created a new one, attempted to rename it but was told about conflicts and at that moment, I hit undo (Ctrl+Z) accidently and was presented with this error.

Anyways, let me know your thoughts and its possible that extra information will help out. Hope you’ve been well since we last spoke and take it easy !

Hi MC Stryker,

I have tried to reproduce the crash that you described off and on for a while, and still have not been able to reproduce it. If you happen to have any additional details that may help, regardless of how minor they may seem, that would be great. I will mark this as resolved for now, but I will keep trying to reproduce the crash and will let you know if I am successful.

Hey ,

It was an odd case so if it does happen again, I’ll be sure to let you know. It is pretty rare thankfully but wish I had some more information.

The only other thing I can think of is it might have been possible when I did this, that the Actor may have been referenced in the level at the time by another Actor. I may have been presented the dialog to replace references and its possible some redirector underneath the covers was unaccounted for possibly.

The second I do happen to see this again, I’ll be sure to immediately let you know and attempt to reproduce it if I can hopefully do so. Let me know of course if you do have any progress but in the meantime, one thing that could avoid it is changing the following…

1. FArchive& operator<<( class UObject*& Res ) override
2.             {
3.                 int32 ObjectIndex = 0;
4.                 (FArchive&)*this << ObjectIndex;
5.                 Res = ReferencedObjects[ObjectIndex].GetObject();
6.                 return *this;
7.             }

To this… Note: I have no idea how this would affect the chain so this might not work properly but its a thought :slight_smile:

1. FArchive& operator<<( class UObject*& Res ) override
2.             {
3.                 int32 ObjectIndex = 0;
4.                 (FArchive&)*this << ObjectIndex;
5.                 Res = ReferencedObjects.LastIndex() < ObjectIndex ? nullptr : ReferencedObjects[ObjectIndex].GetObject();
6.                 return *this;
7.             }

Anyways, keep me posted and have a great day !