How to reproduce:
- Run headless (-batchmode -nographics) Unity Editor in the Linux terminal with the -projectPath set to the attached “3342084-nographics-cursor-crash.zip” project. For example:
$ "/opt/Unity/Hub/Editor/<Version>/Editor/Unity" -batchmode -nographics -projectPath ~/Downloads/case-files/IN-142911_3342084-nographics-cursor-crash
- Observe the terminal output
Actual result: Segmentation fault crash happens
Expected result: No segmentation fault crashes happen
Reproducible with: 2023.1.0a1, 6000.0.75f1, 6000.3.16f1, 6000.4.8f1, 6000.5.0b9, 6000.6.0a5
Reproducible on: Ubuntu 24.04.4 LTS
Not reproducible on: MacOS 15.7.5 (M1), Windows 11
Workaround: Run the editor with xvfb-run -a (xvfb package) without the -nographics argument, for example here:
$ xvfb-run -a "/opt/Unity/Hub/Editor/<Version>/Editor/Unity" -batchmode -projectPath ~/Downloads/case-files/IN-142911_3342084-nographics-cursor-crash -quit
Note: Commenting out the code line “PlayerSettings.defaultCursor = cursor;” in the “Assets/Editor/SetupCursor.cs” script and then deleting the “ProjectSettings/ProjectSettings.asset” file in the project before trying to run the project again stops the issue from reproducing
First few lines of the stack trace:
#0 0x000076af650eb47b XAddExtension (libX11.so.6 + 0x2847b)
#1 0x000076af6674c624 _XcursorGetDisplayInfo (libXcursor.so.1 + 0x3624)
#2 0x000076af6674cbbd XcursorSupportsARGB (libXcursor.so.1 + 0x3bbd)
#3 0x000076af6674cc20 XcursorImageLoadCursor (libXcursor.so.1 + 0x3c20)