Ever since updating my game to Unity6, I received some crash reports in one of the scenes of my game.
Today I received a minidump which contained the reason:
From WinDbg:
(2f48.3534): **Illegal instruction** - code c000001d (first/second chance not available)
For analysis of this file, run !analyze -v
ntdll!NtWaitForMultipleObjects+0x14:
00007fff`5d6b0d24 c3 ret
0:000> .ecxr
rax=00007ffefe56d798 rbx=000001949433a020 rcx=000000000000000a
rdx=000001949450bdd0 rsi=0000000000000000 rdi=000000000000000a
rip=00007ffefce9d521 rsp=0000006e680ee880 rbp=000001922021c9b0
r8=000001949450be08 r9=00007ffefe56d7c8 r10=00007ffefea5ff50
r11=000001926b5555b8 r12=0000006e680ee990 r13=00007ffefe6f7338
r14=000000000000005c r15=00007ffefe5dfd52
iopl=0 nv up ei ng nz na pe cy
cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010283
UnityPlayer!ComputeFalloffTableLegacy+0x61:
00007ffe`fce9d521 c4c168c2d80e **vcmpgtps** xmm3,xmm2,xmm8
The user has an Intel Celeron N5105 cpu, which doesnt support AVX instructions.
I checked the UnityPlayer.dll (Version 6000.0.30f1) which does indeed contain vcmpgtps instructions.
Since Unity’s system requirements only request SSE2 instruction set from CPUs, this has to be a bug!
I found this related issue in the Visual Studio issue tracker:
https://developercommunity.visualstudio.com/t/AVX-instruction-generated-with-arch:SSE/10678042?sort=newest
Using dumpbin /headers
on the DLL shows that it was compiled with MSVC Version 14.39. This version was shipped with Visual Studio 2022 version 17.9.6 suffers from the issue mentioned above.
While this issue might not affect all games out there, it certainly affects mine. Based on the debug information from WinDbg it looks like the function ComputeFalloffTableLegacy contains the instructions.
Does anybody know a way to work around that function? Not sure what exactly triggers it to be called in one of my scenes.