Editor crashes when trying to spawn specific actor? (EXCEPTION_ACCESS_VIOLATION reading address 0x00000018)

Greetings,

Today while working on my project, the editor began crashing (EXCEPTION_ACCESS_VIOLATION reading address 0x00000018) when attempting to spawn EnemyOrbs2 from Boss2:

This all began when I created a new map, and then when back to the old map which contained Boss2. At first I thought it was a corrupt uasset, but I no longer believe this to be the case. I deleted all of the assets that were causing the project to crash when opened, and reloaded earlier versions of them only to encounter the same problem. After a few hours of debugging, I narrowed it down to the Boss2 and EnemyOrbs2 assets. Specifically when Boss2 tries to spawn EnemyOrbs2 shown in the screenshot above.

Here are some of my debugging notes (from closing and reopening the editor over and over):

-Attempting to open Boss2 when “Spawn Actor EnemyOrbs2” node is connected results in a crash

-Removing the EnemyOrbs2 asset allows Boss2 to be opened

-Removing and then replacing EnemyOrbs2 allows both Boss2 and EnemyOrbs2 to be opened, but after closing and reopening the editor the error will occur again

-Removing the “Spawn Actor EnemyOrbs2” node allows both Boss2 and EnemyOrbs2 to be opened, closing and reopening the editor will not cause the problem to occur again

-Removing all code from EnemyOrbs2 does not fix the problem

-Creating a new blueprint with the same code from EnemyOrbs2 does not fix the problem

-Spawning other actors from the same node in Boss2 does not result in an error

-Spawning EnemyOrbs2 from a different blueprint does not result in an error

-Renaming events does not fix the error

-“Fix up redirections” does not fix the error

I also looked through the log files during all of this (albeit I’m not really sure what to be looking for) so here is one of them:

[Log File][2]

I kept seeing the “EXCEPTION_ACCESS_VIOLATION reading address 0x00000018” error, and after searching through other answers it would appear that using the “Spawn Actor” is accessing memory it shouldn’t whenever it attempts to spawn that asset. I don’t really know what happens behind the scenes when you go to open a blueprint, so I’m guessing whatever happens there is behind the issue I’m seeing.

If someone who has seen this before would be so kind as to enlighten me on how to fix this, I would be grateful.

The log mentions a redirector. It could be pointing to something that’s not there… Or something. It’s worth looking into.

In case you don’t know:

Ideally, redirectors should be “fixed up”. They are files that allow references to an old location to get the asset they want in the new location. They have cause me problems before. I’m not sure how to find them but I know they are 1KB so they stand out (or in, I suppose) from the larger asset files.

You can’t just delete them though. They need to be fixed up from the content browser. A quick search should net you the info you need.

Hi ,

I tried running “fixup redirectors” from inside the editor and from command line with no success. I tried finding the redirector file as well, but didn’t notice anything. Do you happen to know what the name of that file might be?

And continuing my debugging quest, I did learn some new things. This occurs because the actor object I am spawning, EnemyOrbs2, has a reference to the actor spawning it, Boss2. In other words, Boss2 spawns actor EnemyOrbs2, where EnemyOrbs2 has a variable reference of type Boss2. This causes the memory access violation, which I’m guessing is because one of them doesn’t know what the other one is, which would explain why removing one of them causes everything to work. It would also explain why removing one of them and then immediately adding it back to the project allows everything to work, because by adding back the asset the editor recognizes it again.

I created a new asset called foo which had a reference to Boss2, and then Boss2 attempted to spawn foo, and I also got the memory violation.

However, I then created an actor bar which spawned foo, and I changed the reference variable in foo to be of type bar, and I had no problems. So something is causing my Boss2 blueprint to be erroneous.

If you have more information on that redirector file I’d appreciate it. I couldn’t find the file.

The “spawn actor from class” node has an Owner pin. Plug a “Self” node into that. Then instead of using the reference to Boss2, use GetOwner() – or use GetOwner() to set the Boss2 reference in BeginPlay.

If you do that before anything that uses the Boss2 reference then you should be good. And I’m assuming you aren’t using the Boss2 reference in the Orbs2 construction script.

Not sure why foo would work with one reference over another. Unless you set them beforehand, they will both be set to “None”.

So I tried your suggestion–good suggestion by the way, and it still didn’t work. So I gave up for the day, and yesterday I tried a different approach. I removed all the code except the “Spawn Actor” node from Boss2 to see if I would still see the error, and to my surprise, no error!

From there I found that Boss2 can spawn EnemyOrbs2 without any problems. The real problem was a cast node to BP_shield I added:

A little background: I have a boss fight in my game, and what happens is in the third phase of the boss fight the boss shields itself, moves to the middle of the room, and spawns orbs which the player must destroy. The orbs cause a massive explosion if they are not destroyed, and the boss cannot be damaged while shielded. The shield is removed once the orbs are destroyed.

That was the last part I programmed, which is why I never noticed it before. So something about BP_shield is causing the memory access violation when opening Boss2. I have tried the following without success:

  • Opening BP_shield before opening Boss2
  • Removing all code/interfaces from BP_shield before opening Boss2
  • Fixing up redirectors in all folders

I don’t really have any other ideas. Would have been easier to figure out if this was a CPP project, but alas, it isn’t.

If someone has a suggestion that would be great, otherwise I’ll just find a workaround if I can.

It’s hard to tell what the crash is from. Does it crash when you open it in the editor or when you run the game – or both?

I would download the debug symbols – or better yet, download and install UE4 from the Github source (same version you’re using now). Then build the editor as “Debug Editor” and run it again. You should get more details about the crash, and you’ll be able to see in the code where it breaks.

It means dealing with Visual Studio and a few hours worth of installation and building the engine, but it might be worth it. Or just find out how to get the debug symbols so we at least get the call stack. I’m not sure how to find the symbols separately, I use the engine source.

I downloaded the debug symbols and reproduced the issue to see if there was something helpful there. Turns out it was because I was using a child actor for BP_Shield, and there is an issue in UE4 4.14 related to child actors:

https://answers.unrealengine.com/questions/528455/child-actor-component-keeps-corrupting-its-parent.html

https://answers.unrealengine.com/questions/527303/blueprint-crash-ue-414.html?sort=oldest

So I just migrated my project to 4.18 and this fixed the issues.

Thanks for the help!