Reproduction steps:
1. Setup Ubuntu 22.04 on WSL
2. Build the “BugRepro” Project in batch mode (example: ~/Unity/Hub/Editor/<version>/Editor/Unity -batchmode -quit -nographics -projectPath <project path> -logFile <project path>/build.log -buildTarget Android -executeMethod EditorScript.Build)
3. Observe the “build.log” Log file
Expected result: The Project builds successfully
Actual result: The Project build fails with an error (./External/baselib/builds/Include/Internal/../C/Internal/Baselib_Semaphore_FutexBased.inl.h(158): Assertion failed (count >= 0) - Destruction is not allowed when there are still threads waiting on the semaphore.)
Reproducible with: 2021.3.35f1, 2022.3.20f1, 2023.2.12f1, 2023.3.0b9
Reproducible on: WSL Ubuntu 22.04, AWS EC2 (User)
Not reproducible on: Ubuntu 22.04
Notes:
- If the problem does not occur, delete the Library folder, give it a few minutes (~ 2 mins), and open the project again
- Error message on AWS EC2: ./External/TextureCompressors/Crunch/crnlib/crn_threading_pthreads.cpp(194): Failure: ""semaphore: sem_wait() or sem_timedwait() failed""
- Error message on 2023.2 and 2023.3 Unity streams: GetManagerFromContext: pointer to object of manager 'PhysicsManager' is NULL (table index 9)