Pasting code copied from a not responding place crashes functional place

People are losing progress because of an issue where the whole game freezes by simply pasting code from a not responding place.

This issue has affected me 8 times already in the past 2 weeks.
I have lost a lot of progress because of this and even had to completely rewrite 6 scripts!

This is an extremely bad issue as anything can crash instantly very easily.
Examples of what this issue could cause for people:

Imagine copying a piece of code from a test server right as your laptop with 2.1GHZ cant handle the place for a split second, you’d copy it into the actual game place and boom it freezes instantly and you’ve lost tons of progress.

Testing a piece of code you started working on in a new baseplate and the place freezes, you realise you had copied the code before, so you start a new baseplate and paste the code in there and then it freezes aswell, which means you have lost the code forever.

Accidently editing the script in a test server and you then copy the code and force close the test, while its still working on closing the server you pasted the code in the actual game and it freezes instantly.

Repro steps:

  1. Launch 2 baseplate games.
  2. Create a serverscript in both games in workspace.
  3. Paste this in the script in the first place:
while true do
	print("h")
end
  1. Copy the code out of the script and paste it in the runbar.
  2. Execute the code by pressing enter in the runbar, the first game will now freeze in studio.
  3. Paste the code in the script from the second game without closing the frozen game.
2 Likes

I think you might have misunderstood my post…

Its not crashing because there is no wait, the reason the first place crashed is because i pasted code i copied earlier from place 2 into place 1.

  1. Copy infinite loop code from script in Place 2
  2. Execute infinite loop code in runbar in Place 2
  3. Paste code you copied earlier into script in place1
  4. Place1 crashes together with Place 2 even though you haven’t executed anything in there.
1 Like

I think this is a thread problem. Most likely, the game will freeze up because the thread that created the script or the Runbar thread won’t yield and won’t give the roblox engine time to do anything else.

Edit: typically wait is used to generate delays, but it is also used to yield threads. That’s what it says in the manual

Yields the current thread until the specified amount of seconds have elapsed.

1 Like

This might be related to my report here:

https://devforum.roblox.com/t/roblox-crashes-upon-pasting-large-amount-of-lines/813338/2

It’s possible it was crashing due to this, not totally sure however.

You’re still misunderstanding this post. The script provided there is run on place (A) to intentionally freeze it, and then the script is pasted on another place (B) without running it. That shouldn’t crash place B, but it does. This is also happening in studio, not in-game.

3 Likes

Personally I don’t think it has anything to do with copying and pasting code into different studio instances. Rather, the instances are not completely independent, perhaps for reasons of efficiency.

What I believe that it happens is that, it is executing a thread that never yields (the infinite loop) and it blocks the first instance. But as the instances of the engine are not completely independent, then it ends up blocking the second instance. But this is just a guess.

What is clear to me is that we should never create threads that never yield, and that was my intention from the beginning. Because I believe that there is not and will not be any situation where we intentionally require a thread that never yields (unless it is malware)

But the place can freeze up by itself instead of being intentionally being caused with a while true do loop, meaning this issue could come up in actual situations too. The OP also provided examples of this in the original post.

2 Likes

One blocked instance of the engine could eventually cause the others to be blocked (this is only for Studio). But this is a guess and the only one who could verify this is a Roblox engineer. That’s why I didn’t want to focus on this.

In this experiment there is clearly a thread that never yields:

So that must be the problem that must be solved if it were to happen in a real case.

I’m sorry, I can’t explain it better.

Thanks for the report and we will work on a fix, but it won’t be easy as it is a OS level issue. Windows clipboard tries to get information from the source application when you paste the text into another application. It is not possible while the source application is irresponsive. Until we can work around this problem to find a fix, please try to avoid getting yourself into this situation, like @lykyob has suggested above.

5 Likes