Stack Overflow Error in Blueprint

I have play testers frequently getting stack overflow crashes that are caused when interacting with certain blueprints, and I am not sure why. Is there a way to increase the size of the stack?

I think you’ve really got to push it to get that kind of error. Rather than increasing the size of the stack ( is that even possible? ), you might want to find out why your blueprints are using up so much memory. Sorry to be a downer…

Thanks for the reply. I’m really struggling to hunt this problem down though because I haven’t been able to replicate it on my end or in editor despite it happening for multiple play testers on different machines. Do you think this problem is most likely caused because of the size of asset or by the actions performed by the asset?

These blueprints are puzzle pieces which use interfaces to pass arrays from one to the next, each doing simple math operations on the values in that array which can vary in length from 6 to 12. The player can also pick them up and reorder them.

Impossible to tell with knowing the BP, but I’d say the main thing that blows the stack up is recursion.

You might not actually have recursion, but you might have something approaching it.

Is it possible there could be a loop between the objects somewhere?

EDIT: Something else you could do is print to the log copiously. Get them to crash it and then get the log back from them and see what’s going on…

The reason one asset needs another asset can be a very indirect. Take a look in the reference viewer, that’ll tell you how to get from one to the other.

Also, if you want to get freaked out by the number of cyclic references is your project, check out:

It is possible that there could be unintended loops happening but I haven’t noticed them before. However, I also just found out that, embarrassingly, that blueprint is using a blueprint library function I made (just a cast node) to get a reference to the player. So it looks like every puzzle piece in the game contains a cast to the player (a TON of memory). So, I’ve found a way to work around needing to do this cast to the player in the base BP and and have reduced its memory size from the shown 148.6 MiB to 41.3KiB. Not sure if this was the problem, but some levels have hundreds of these puzzle pieces in them.

The old base BP

The offending BP function

Sounds like a likely candidate… :slight_smile:

I think it is. However, oddly, every BP that uses any function in the library has the player reference included in its memory even though it doesn’t call that function. I also attempted deleting that function and putting it in a separate library, however, that first library still includes the player in every BP to uses any of its functions. Do you know if this is normal or is there something wrong here?

I ended up discovering that this was caused by an infinite loop.

I am getting the same problem just implementing an interface to a copy of another blueprint.

Just here, after pressing “Progressable” I get a Stack overflow error

Then I get this