[Critical] Engine Freeze: Infinite .Changed Event Recursion Crashes Entire PC, Not Just Studio

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.

1 Like

i Stumbled on this bug because i just wanted to change the state of the BoolValue back to the previous state to reset the changed state back to its last state to preserve user experience on my desktop job

dont know why anyone isn’t taking this serious bump…

You only posted this an hour ago and there’s a lot of bugs out there, don’t feel too discouraged if it gets pushed down the list.

With that being said, this seems more like an engine bug than a studio bug, since I would imagine it would have the same effect on the client if it ran in a local script.

Have you tried to disconnect the event after it fires, or use :Once()?

i actually just changed the variables around to not change the value instead and just passed a debounce to any of the events that fire it to prevent the loop

but going back this bug is more about the engine and then my operating system crashing aftwards
like full lock up within seconds

i think this infinite loop is worser because it engages the roblox studio properties information and since the ui is updating and i figure its not really in a sandbox it causes that massive crash i was descibing

I just get an error about max event depth reached, does not crash

What are your PC Specs ? Because when it happened everything locked up for me

Mine are

CPU

Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz

Base speed:	2.11 GHz
Sockets:	1
Cores:	4
Logical processors:	8
Virtualization:	Enabled
L1 cache:	256 KB
L2 cache:	1.0 MB
L3 cache:	8.0 MB

Utilization	18%
Speed	2.31 GHz
Up time	2:00:42:24
Processes	280
Threads	3885
Handles	148200

RAM

16.0 GB

Speed:	2400 MT/s
Slots used:	1 of 2
Form factor:	SODIMM
Hardware reserved:	225 MB

Available	2.4 GB
Cached	2.4 GB
Committed	20.7/25.7 GB
Paged pool	540 MB
Non-paged pool	986 MB
In use (Compressed)	13.3 GB (1.5 GB)

Disk 0 (C:)

Micron 2200S NVMe 256GB

Capacity:	239 GB
Formatted:	239 GB
System disk:	Yes
Page file:	Yes
Type:	SSD

Read speed	65.1 KB/s
Write speed	268 KB/s
Active time	1%
Average response time	1.5 ms

GPU

Intel(R) UHD Graphics 620

Driver version:	31.0.101.2135
Driver date:	3/6/2025
DirectX version:	12 (FL 12.1)
Physical location:	PCI bus 0, device 2, function 0

Utilization	0%
Dedicated GPU memory	
Shared GPU memory	0.4/7.9 GB
GPU Memory	0.4/7.9 GB

This bug has existed in the engine for a long time, and it has proved quite tricky to fix in an ideal way. After several attempted fixes that were abandoned, we’ve finally come up with one that we are happy with. As of now, exponentially growing deferred signals will cause an error rather than hanging Studio. I know you’ve already worked around this bug a while back, but if you run into any further issues please reach out.