Introduction
I’ve encountered a critical bug where a simple, non-malicious script using a recursive .Changed event causes not just Roblox Studio to freeze, but my entire operating system. This complete system lockup is inescapable without a hard reboot. I believe the engine should have safeguards to prevent a user script from breaking out of the application’s sandbox to this degree.
Issue Description
When a function connected to a BoolValue.Changed event contains logic that changes the BoolValue’s Value property, it creates an infinite, instantaneous feedback loop. While some performance impact is expected from bad code, the result in this case is catastrophic. The runaway recursion consumes 100% of system resources in an instant, freezing the mouse, keyboard, and all other applications. It is impossible to open Task Manager (Ctrl+Alt+Del is unresponsive) to kill the Studio process. The only way to recover is to hold the physical power button on the computer.
Reproduction Steps
-
Create a BoolValue instance anywhere (e.g., in Workspace).
-
Create a Script and parent it anywhere it will run.
-
Paste the following code into the script.
-- WARNING: This code will likely freeze your entire computer.
-- Save all work before running.
local boolValue = workspace.BoolValue -- Or your path to the BoolValue
boolValue.Changed:Connect(function(newValue)
-- This line immediately re-fires the .Changed event, creating an
-- infinite recursive loop that the engine cannot handle.
boolValue.Value = not boolValue.Value
end)
-- Trigger the initial change to start the loop.
boolValue.Value = not boolValue.Value
The Original Code that caused this bug
Configuration.PowerOn.Changed:Connect(function()
if PoweringState then
if Configuration.PowerOn.Value then
Configuration.PowerOn.Value = false
end
if Configuration.PowerOn.Value == false then
Configuration.PowerOn.Value = true
end
return
end
PoweringState = true
StartUp.Enabled = true
if Configuration.PowerOn.Value then
StartUp.Spinner.Visible = false
GradientTransparency(StartUp.Powering.Gradient,true,.5)
PoweringOnTextDisplay(StartUp.Powering,"Powering On",20)
GradientTransparency(StartUp.Powering.Gradient,false,.5)
StartUp.Spinner.Visible = true
Tracks.SpinnerFadeIn:Play()
Spinner(StartUp.Spinner,1)
Tracks.SpinnerFadeOut:Play()
Tracks.LogoFadeIn:Play()
Tracks.LogoFadeIn.Completed:Wait()
task.wait(3)
Tracks.LogoFadeOut:Play()
task.wait(.1)
StartUp.Enabled = false
TurnOnScreen(Screen,true)
PoweringState = false
return
end
TurnOnScreen(Screen,false)
Tracks.SpinnerFadeOut:Play()
Tracks.LogoFadeIn:Play()
Tracks.LogoFadeIn.Completed:Wait()
task.wait(2)
Tracks.LogoFadeOut:Play()
Tracks.LogoFadeOut.Completed:Wait()
GradientTransparency(StartUp.Powering.Gradient,true,.5)
PoweringOnTextDisplay(StartUp.Powering,"Powering Off",5)
GradientTransparency(StartUp.Powering.Gradient,false,.5)
--Power OFF Sequence
StartUp.Enabled = false
end)
Expected Behavior
I expect the Roblox Studio engine to handle this infinite loop gracefully. The application should either:
A) Time out the script after a certain execution limit and post an error to the output.
B) Crash the specific Studio process, allowing me to close it and restart.
C) Freeze, but remain contained within its own process, allowing me to use Task Manager to terminate it.