The Bug
If you attempt to call Instance:ClearAllChildren()
on an instance in the same window that a descendant is being parented to said instance, the client hangs itself on a while loop.
Repro
local f = Instance.new("Folder")
f.ChildAdded:Connect(function ()
f:ClearAllChildren()
end)
Instance.new("Folder",f) -- X_X
Probable Cause
Under normal circumstances, trying to destroy an object while its being parented to another object throws this warning in the output:
I suspect that ClearAllChildren is just doing some while (!children.empty())
loop without acknowledging this soft write-lock to the Parent property, so it gets snagged on that loop and never escapes, causing Roblox to hang.
Credit to @moded for the discovery,
He asked me to write a bug report because "[he's] bad at writing bug reports"
(lol).