Why does this line of code crash my whole pc?

Like, WHAT THE HELL?

I’ve been looking around in the BAE MainModule and I stumbled apon this:

(WARNING: DONT RUN THIS, IT CAN AND WILL CRASH YOUR COMPUTER OR STUDIO)

 print(game[("%s|"):rep(0xFFFFFFF)])

It’s a simple print code, but it still deals a hefty punch.
I searched up about 0xFFFFFFF and it means infinite so I’m guessing it’s looking for a massive service with infinite letters that doesn’t even exist? I’m not sure.
I hope Roblox can make a sort of string limit when printing - or maybe for everything

This is the full code, again I don’t recommend running it.

spawn(function()
		local function Crash()
			while true do
				repeat
					pcall(function()
						print(game[("%s|"):rep(0xFFFFFFF)])
						Crash()
					end)
				until nil
			end
		end
		Crash()
	end)

That - without a doubt - will crash your pc and send your CPU up in flames.

4 Likes

I don’t see the issue. You are triyng to get a 268435455 long string. You shouldn’t even be coding like this or running into this issue at all.

6 Likes

I was messing around in an admin module, I was just curious so I made a post, but I understand what your saying

This is a small showcase of the code for those who are afraid to run it. It doesn’t “send your CPU up in flames”, it just increases RAM usage.


I tried to crash my PC several times using this method, but the system always reset the increasing RAM value to 10-11 GB. :melting_face: How can this be avoided?
It may have crashed your PC because you didn’t have enough RAM or an old OS. If you are reading this message, can you tell me your performance stats?

Edit: The so-called RAM reset cannot be avoided, as I found out later. Scripts have their own “allowed execution time”, which depends on where they are run. In the studio, this time can be adjusted using different methods using the command line:

  1. settings().Studio.ScriptTimeoutLength = ... - change the ScriptTimeoutLength property directly
  2. game:GetService("ScriptContext"):SetTimeout(...) - using the ScriptContext service and the SetTimeout method

Unfortunately, these functions are not available in the Roblox player and this time is about 30 seconds. Afterwards, an error occurs that stops the code from running.

2 Likes

i have a slight feeling they’ve figured it out by this point

3 Likes