BT Service Deactivation is called after Blackboard Component is destroyed

Win 7 64, UE 4.8 binary

I noticed that bt service event “receive deactivation ai” is called after the bb is uninitialized and reset. That means the service will access invalid values in bb. This is happens for example if the service is active when you exit the game.

To test I made a service that simply prints a bb value every time when it’s deactivated.

To reproduce:

  1. Start with vanilla 3rd person template

  2. Add navmesh

  3. Copy attached files in Blueprints folder

  4. Play then press F. This will spawn BT controlled bot, which will run into player then wait for 5 sec, then run again etc…

  5. Run somewhere far from the bot and when it’s running toward you press esc to exit the game.

  6. Look into the log, you should see something like:

    LogBlueprintUserMessages: Activation
    LogBlueprintUserMessages: Deactivation ThirdPersonCharacter
    LogBlueprintUserMessages: Activation
    LogBlueprintUserMessages: Deactivation

Last log doesn’t print character display name, because the bb was already reset by UBlackboardComponent::DestroyValues() method.

I think this is a bug.

Blueprints.zip

PS: I believe that it can lead to crashes too. I had some illegal memory access crashes from blueprint execution code.

Hello scha,

I was able to reproduce this issue on our end. I have written up a report (UE-19064) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Make it a great day