[Bug Report] Interface and isValid node crashing in stable build

Build version:
4.6.1-2386410

Description:

Apparently when you take an object that was cast to an interface and check if it is valid with the “isValid” node, the shipping build of the project will crash. This crash won’t happen when running the project in editor or in a development build.

Repro steps:

  • Create blank project (No code, no starter content)
  • Create new blueprint “MyBlueprint” that subclasses Actor
  • Add a scene component as the root of MyBlueprint
  • Add a static mesh component to MyBlueprint
  • Use the “Sphere” static mesh in the engine content for the static mesh component
  • Create new blueprint interface “MyInterface”
  • Create new function “GetStaticMesh” with output “staticMesh” of type “StaticMeshComponent” in MyInterface
  • Implement MyInterface on MyBlueprint
  • In the “GetStaticMesh” function in MyBlueprint, connect “StaticMesh1” to the return node
  • Create a new “Default” level
  • Save the level as “MyMap”
  • Place an instance of MyBlueprint on (1500,0,20)
  • In the level blueprint of MyMap create the following graph:

  • In the project setting set MyMap as the Game default map
  • Play the level and verify that when pressing “U” the ball will move up and go back down after releasing “U”
  • Make a shipping (not development) build of the project (build lighting, cook content, package project)
  • Run the final product and attempt pressing “U”. The game will crash:

  • Go back to the level blueprint of MyMap on the engine and make the following change:

28886-isvalidbug3.png

  • Make a second shipping build with this new change
  • Verify that with this new build you can press “U” to make the ball move up and down without crashing

Notes:

  • The problem is inside the “isValid” function and since the “isValid” macro uses the “isValid” function then they both cause the same behavior

  • The “!=” node also crashes just like the “isValid” function:

28888-isvalidbug4.png

  • The input pin on the “!=” and “isValid” nodes are of type object while the output of the “Cast To MyInterface” node is a “MyInterface” instance object. But conceptually this is not a problem since all interface instances are, by definition, objects. This is the reason why playing in engine doesn’t crash and why we are not required to use a “To Object” node in the blueprint.

  • Making a “Development” build (as opposed to “Shipping” build) will not cause any crash whether using “!=” or “isValid” without a “To Object” node.

  • Same issue goes with the “==” node followed by a “NOT” node

  • To summarize, this problem will happen when using an interface with “isValid” function, “isValid” macro, “!=” node, “==,NOT” nodes, and probably any other node that takes an object as input.

Howdy Mastodon,

Thank you reporting this issue. I have been able to replicate the crash with the steps that you have provided. I have also tested this issue in our internal build and the error is not occurring because the Level Blueprint is not having you convert the connection between the cost node and the Is Valid node:

28961-2-4-2015+convert+node.jpg

By having this conversion now implemented, thus the crash is no longer occurring. I am unsure as to when this will be implemented into the engine but the crash has been resolved. Please let me know if you have any additional questions.

Thanks and have a great day!

It’s great to hear that a fix is coming down the pipeline.

Thank you for letting me know about the current status of this issue.

Glad I could help.

You have a great day as well.