Reproduction steps:
1. Make sure IL2CPP is installed for the tested editor version
2. Download and extract the “IN-19000_Repro” folder
3. Adjust paths in “IN-19000_Repro/Builder.py” (lines 22-25 and 29)
4. Open the “IN-19000_Repro/Project” directory in Terminal
5. Run commands "git init", "git add ." (takes a few minutes), and "git commit -m "initial"" (takes a few minutes)
6. Run command "python3 ../Builder.py", and wait for up to 20 tests to finish (each test takes approximately an hour)
Expected result: No build crashed
Actual result: A build crashed with a “mono_os_sem_init: semaphore_create failed with error 268435472” error
Reproduced in: 2020.3.25f1
Could not test in: 2021.3.12f1, 2022.1.21f1, 2022.2.0b13, 2023.1.0a16 (no access to a reproducible machine)
Reproduced using: MacBook Pro Monterey 12.1 (M1)
Not reproduced using: Mac mini Monterey 12.6 (M1), Mac mini Ventura 13.0 (M1)
Building on M1 has a low but recurring chance of crashing with the "mono_os_sem_init: semaphore_create failed with error 268435472" error. From our testing, this generally happens at least once every 20 builds. We have also seen a crash without stacktrace in similar circumstances before:
assertion failed [(_unoccupied_temporary_gprs & mask) != 0: invalid temporary request
(TranslatorHelpers.cpp:105 allocate_temporary_gpr_num)
Running "strings /Library/Apple/usr/libexec/oah/libRosettaRuntime | grep "cpp" | sort -h" will flag up TranslationHelpers as part of Apple's Rosetta runtime, and the same is true for the "unoccupied_temporary_gprs..." log, leading us to believe this is an issue concerning Rosetta. We could not reproduce the crash on Intel machines.