Local variable crash in 4.9

Ok it took a bit to track this down and distill it into a reproducible test case, but I finally managed it.

Basically under proper conditions in 4.9p1 and 4.9p2, creating a local variable in a function will crash editor 100% of time. It seems that there are many moving pieces to repro’ing this, and I am not sure exactly which pieces are key or not. I do know that crash will only occur on creating local variable, not on a normal global one. Also error will only occur when setting local variable type to a custom struct that contains a custom enum, AND position of enum in struct matters. And signature of overall function matters. Yeesh.

Ok test case attached.

  1. Open sample project
  2. Open “Market” blueprint
  3. In that blueprint, go to “TestFunction” function
  4. In that simple graph, right click output pin from Array Get node and choose Promote to Local Variable
  5. Editor should crash

NOTE: Not sure how to reduce project size small enough to fit in 5mb limit here, so I am instead giving a link to it shared on Dropbox

How very odd. Yes it was 100% reproducible for me. I tested it several times. However when it crashes there isn’t anything in crash report box for sample project, though there is in my real project. Which is kind of odd. I will see what more I can do, but I will probably not be able to loop back to it for several hours.

Oh and this was from binary, from launcher. No compilation.

Hi John,

I’ve downloaded project and followed steps you listed, but did not crash. Does this happen 100% of time with those steps in this project for you? Is this a project from Preview 2 binary via Launcher, or did you build engine from source?

If this crash occurs for you again, please copy information from Crash Reporter window, including Machine ID, and paste it here for me. And make sure you hit Send. Thanks!

For some reason in sample project, I get no crash dump info, just machine id and a line saying no minidump is available.

MachineId:151C006F498B8D4171B2AF878842A0A4

in sample project I sent, can you verify that default value of “Quantity” field in struct is set to 1?

Strangely that needs to be set to 1 to recreate crash. I just recreated a second test project and it wasn’t crashing until I did that. But now again 100% crash.

I think I lied to you earlier though. In recreating this a second time I realized that my default choice when creating new project was “From Code” not “From Blueprint” so as a result there is some compiling that takes places when project is first created. Does that matter?

Yep, it’s set to 1. I tried changing it, then changing it back to 1, running with all tabs open, and still couldn’t reproduce at all.

It shouldn’t make any difference if it’s a code or BP project. I just wanted to make sure we were running on same version of engine, for testing purposes. So if you’re running with 4.9 Preview 2 binary through Launcher, we are.

Hi ,

Unfortunately I don’t know what else I can do to get this reproducible for you. It hits me 100% of time, but I am able to work around it by moving position of enum in struct, as odd as that sounds. I think it is possibly an alignment issue.

However while I can work around this, I have discovered another more severe bug which I am about to post, also involving enums, which makes me suspect there is a severe issue with enums in 4.9

Other on posted: (Blueprint) User defined enum in 4.9 getting corrupted - Blueprint - Epic Developer Community Forums

Okay, I’ll go ahead and resolve this post for now, since I can’t get a local repro. I’ll keep investigating and see if I can link it to other problems, though, such as this additional enum issue you posted about (which I’ve assigned to one of our team to look into), and if it’s related I’ll enter an additional bug report. Let me know if you find any other ways to reproduce issue. Thanks!