Skip to content

Bug: AngelScript Value Type 'Variant' causes memory leaks #1855

Description

@310paradox

Describe the bug

When an AngelScript custom entity runs code every tick that creates a unique Variant every time, it can very quickly cause the game to crash via a memory leak (specifically the CUtIRBTree overflow crash).

To Reproduce

memory_leaker.txt
^ download the above file and convert it to a .as file, and install it into the game files.
Load into a map and run the console command ent_create memory_leaker_by_variants
After 2-4 minutes, the game will crash. The game will either freeze and show the "CUtIRBTree overflow!" pop-up, or the game will close suddenly and not even bring up the crash report sentry.

Issue Map

This would not occur in any specific map, but would occur whenever a custom entity that creates unique Variants every tick. (which is a niche use-case, but I was working on custom entity that had to use a Variant to pass a Vector as a string to a piece of VScript code via the 'FireInput' function- which only allows Variants- every tick)

Expected Behavior

For the crash to not happen.

Operating System

Windows 10/11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugThis is a problem with something that should be working one way, but isn't.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions