Construction script crashing the engine?

If you can reproduce it raport it as a bug Report a Bug - Unreal Engine

Enigne should not crash from something like this

While using construction scripts in UE4 I managed to crash the engine while compiling a blueprint (I’m only using blueprints). After a bit of time in a new project I was able to reproduce the same crash.

(just in case my instructions are unclear I uploaded a .zip with my screenshots here)

Setup:

  • Create two actors. I named those “tile” and “tilemap”.
  • put both of them on the level
  • Add a instance editable variable to “tile” that will receive a object of the “tilemap” and set it to the one you placed in the previous step
  • Go to “tilemap” and create a function. I named it “getSnapLocation”.
  • Make the function return a vector and return the value of “getActorLocation” (There is no need to do that because your function just needs to do something).
  • Go to “tile” and on the construction script, if the “tilemap” variable is valid, call “getSnapLocation”
  • Compile “tile”, compile “tilemap” and crash.

It seems to only happen when you compile “tilemap” and there is a instance that is calling a function of a instance of “tilemap” on a construction script. That code will run without crashing after you open the project again, but if you compile the “tile” while a instance is calling the function of the “tilemap” and then compile the tilemap, it will crash again. Why? If the code does work, why does the engine crash? Can someone tell me what exactly is going on?
I was able to work around this in my project but its not clean and really annoying (you do everything inside “tile” by grabbing many variables of “tilemap”). I will end up doing a lot of this in my current project.

log file

It crash, this is something that should not happen on blueprint and don’t nothing bad will happen if it’s not a bug (which is). You should have email response from it informing if this is bug, known or not

I thought about it but I was unsure if it was actually a bug or something fundamental about how it works. Unfortunately, my laptop doesn’t seem to run the most recent versions correctly (many graphical bugs) but I will try to reproduce this bug on the latest version tomorrow (slow internet). It’s strange that I couldn’t find anything about this on the web considering that it seems to be fairly easy to reproduce and run into.

It seems to be fixed in version 4.22.3. I’m not sure about the other versions but if it was fixed it should be a known bug. Blueprints can’t be100% foolproof (by design) so I expected this to be my fault or by design. I’ll report this anyway. Thanks for you time.

This is a bug that happens on version 4.18 and I can’t keep testing it in other version. I will report this as a bug but I couldn’t reproduce the bug on version 4.22.3 so I’m pretty sure it is a known bug, relatively minor, happens in older versions and they can’t be bothered fixing it -_- . There is a way around the bug: Not calling the functions of other instances in a construction script. You just grab the variables, do the math and modify the values of the other instance on the instance that you would use to call the function.