Very specific setup with ControllerManager causes crash when resetting

As of 0.625, using a very specific setup with the ControllerManager can rarely cause a crash instead of throwing an error. This has been very difficult to replicate and explain but it managed to occur a few times in production.
In Studio it closes the app immediately, but in a live game it brings up the “unexpected error” message.

The crash seems to occur somewhat more consistently when Workspace.SignalBehavior is set to Immediate rather than Deferred. Interestingly if it’s set to Deferred I could only replicate it if the “Updated Roblox Controls” beta feature was enabled, however the place file provided uses Immediate since it seems to crash more consistently.

A flaw in the code provided where the ControllerManager’s ActiveController is currently set to a destroyed AirController and attempted to be set to nil, while the ControllerManager itself is later destroyed may be a cause of the issue.

It’s possible that it’s affected by higher framerates or timing but it could also be my code itself causing a framerate dependency since the original code is designed to step a character each frame. Either way this has been an extremely frustrating bug to figure out due to its inconsistency.

Repro

  1. Download the place file and open it
  2. Hit Play Solo
  3. Reset the character as soon as possible (esc-r-enter)
    You may have to repeat step 3 a few times since respawning isn’t implemented in the place file.

Place files

Player: ctmanager crash test 2 - Roblox
Studio: minimalCrashTest2.rbxl (50.3 KB)

Demonstrations

Player:


Studio:

Expected behavior

A regular error is thrown by attempting to set the ActiveController of a destroyed ControllerManager.

A private message is associated with this bug report

5 Likes

Thanks for the report! We’ll follow up when we have an update for you.

2 Likes

@nothing_1649 Can you confirm if this is still happening? We recently rolled out some stability fixes in related areas that may have fixed this issue.

1 Like

will get back to this in a couple hours, i’m out for a bit

can’t seem to reproduce anymore, likely fixed at this point

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.