Stacking profiler labels too deeply can cause client crashes on the Detailed view

If you stack too many profiler labels (e.g. I tried profiling something that was more recursive than expected), the client can crash upon viewing the Detailed mode of the Ctrl + F6 microprofiler

Test game: microprofiler - Roblox
Simple reproduction (put this in a LocalScript):

local function test(n)
	debug.profilebegin("test")
	if n < 200 then
		test(n + 1)
	end
	debug.profileend()
end

game:GetService("RunService").RenderStepped:Connect(function()
	test(1)
end)

200 should be enough such that you don’t immediately crash upon opening the detailed view, but do crash upon zooming out further

Interestingly, unlike a different similar crash I’ve encountered elsewhere, this crash seems to not create a crash dump file under logs/crashes, so I have no crash info to attach, but the crash should be more than reliable enough that it isn’t required

Hi, thanks for reporting this. We definitely should limit the depth when storing this in internal buffers (as well as fix the on-screen UI crash caused by overflow). Currently, we only limit the stack depth when displaying it in the HTML dump viewer.

Was this knowingly fixed? The render still freaks out a bit when there’s so many labels, BUT it’s no longer hard crashing or vanishing weirdly when I open the menu