Error during compilation, in structures. Array index out of bounds: 0 from an array of size 0 (With instruction for repeat)

The bug is that if you create a structure from the MAP container, in which the key is a class, then the compilation will produce an error in the arrays.

Instructions for repetition:

  1. Create a container structure, for example:

  1. We create in any object a variable with the type of this structure.
    It looks like this:

210238-2017-08-18-09-34-03-achtng-unreal-editor.png

  1. We are trying to compile the project. I compile into shipping.

In the end we get the following result:

begin: stack for UAT
Error: === Critical error: ===

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:e:\program files\unrealengine\engine\source\runtime\core\public\Containers/Array.h] [Line: 596]

Error: Array index out of bounds: 0 from an array of size 0

I’ve been catching this bug for a long time, and I found it. I could not understand what the problem was, and I found this very reason.

While the solution is simple, create the same MAP container in the object itself, rather than the global structure. But I would like that would be structures of this type could be used. You can put other types of keys into a key, in fact, with the class of the problem.

Thank you for being here, Epic.

Hey -

I tried to follow your reproduction steps but was able to package for shipping without the error you mentioned. Here was the setup I used:

  1. New Project
  2. Create blueprint structure
  3. Set MemberVar_0 type to an Actor/Integer Map
  4. In Default Values, set 2 elements as Actor/5 & BlockingVolume/45 (Blueprint_Effect_Steam does not appear to be an editor default option)
  5. Create an actor blueprint
  6. Add a variable of my struct
  7. File->Package Project->Build Configuration->Shipping
  8. File->Package Project->Windows->Windows (64-bit)

The build was successful and I was able to run the .exe as expected. Can you try replacing Bluepirnt_Effect_Steam with Actor in your screenshot and let me know if you get the same behavior. If you do run into the same error, please provide the full callstack and a sample project to help test locally.

Sorry that I did not reply for a while.

I figured out more, and brought out a more specific instruction.

  1. Open any project, you can a new one.
  2. Create 3 items: simple Actor Blueprint 2 pcs. Actor1 and Actor2.
    And the Structure with the Map container, in which the key will be the Actor Class, And the value does not matter what.
  3. Set the key value to Actor1.
  4. In Actor2, create a variable of the type of this structure.
  5. Compile in any form.

A sample of the empty project with the configured error is attached:
https://drive.google.com/open?id=0B3IpDc8jJDigOUtGTGp3RE9TN0k

Hey -

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-48925) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers