On Linux/Docker CI build, the editor sometimes crashes when building and during test runs. The crash happens when ToFileDescriptor is called inside pal_utilities.h:160 with the message 'Assertion `fd < sysconf(_SC_OPEN_MAX) && "Requested file descriptor exceeds maximum number of files allowed to be open at a time."' failed.'` Logging open fds shows this is {}not{} exceeding the maximum.
Steps to reproduce:
NOTE - This is rare race. See loop script from this investigation (repro_loop2.sh).
1. On Linux, create a docker container, and pull this game ci-image: `unityci/editor:ubuntu-6000.0.65f1-android-3.2.2`
2. Run the container with fd limit set to 524288
3. Create minimal project that compiles scripts when opened
4. Ensure editor has an activated license
5. Launch the editor in a loop using `Unity -batchmode -nographics -projectPath <proj> -logFile <run.log> -quit`. Library/Bee and Library/ScriptAssemblies must be deleted before each launch to ensure scripts are compiled.
6. (Unsure if needed to repro but will increase chances) Run two parallel instances of the editor with duplicate projects
7. Wait until crash reproduces (this took about 3 days for me). You can grep each run log for the assertion.
Expected behavior:
Editor compiles scripts successfully and building/testing completes without crashing.
Actual behavior:
Editor crashes while compiling scripts. See run_5328.log:231. The message wording makes it sound like fd exhaustion, but when logging the number of open fds this stayed low, so the process is not out of descriptors.
Notes:
- Customer reports crash did not happen on 2022.3.62f2
- Ticket was confirmed without CQA reproduction