yuzu icon indicating copy to clipboard operation
yuzu copied to clipboard

Rocket League: Won't boot anymore after Mainline 458

Open FearlessTobi opened this issue 2 years ago • 2 comments

Rocket League version 1.0.0 regressed in mainline 458. It used to work fine in mainline 456. It now SVCbreaks after SetThreadCoreMask returns an error. grafik

https://github.com/yuzu-emu/yuzu/pull/4996 is very likely the Pull Request that caused the regression.

FearlessTobi avatar Aug 17 '22 20:08 FearlessTobi

While #4996 may have caused the regression to appear, the root cause is undefined behavior in the game. It creates a new thread class on the heap using operator new, and passes this thread class to a new KThread, which then calls SetThreadCoreMask with an uninitialized memory value that originated from this call to operator new. image image

Thread 99 "yuzu:CPUCore_0" received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x7f7d337f6640 (LWP 18507)]
Kernel::Svc::SetThreadCoreMask (system=..., thread_handle=459251, core_id=core_id@entry=-1917688664, affinity_mask=affinity_mask@entry=1)

liamwhite avatar Aug 18 '22 13:08 liamwhite

Can be worked around by setting main+0xab8dd4 = 0xd503201f (little endian). The game starts the thread before assigning a value it uses, and wins this race on console due to not having recompilation overhead from Dynarmic.

liamwhite avatar Aug 19 '22 00:08 liamwhite