Unity Editor "Segmentation fault" crash in CI
The Unity Editor process crashed (SIGSEGV) during a batchmode CI build. On headless Linux runners this is usually a graphics, driver, or memory problem rather than a bug in your scripts.
What this error means
The job ends abruptly with "Segmentation fault (core dumped)" or "Unity has crashed", a non-zero exit, and a crash log under the project Editor logs.
Receiving unhandled NULL exception
Segmentation fault (core dumped)
Error: The process '/opt/unity/Editor/Unity' failed with exit code 139Common causes
Headless run without -nographics
On a runner with no display, the editor tries to initialize graphics and crashes. Batchmode CI builds should pass -nographics.
Out of memory or a native plugin fault
A large project or a native plugin can exhaust runner memory or fault, taking the editor process down with SIGSEGV.
How to fix it
Run batchmode headless
- Pass
-batchmode -nographics -quitso the editor does not touch a display. - Write logs to stdout with
-logFile -so the crash context is visible. - Re-run on the headless configuration.
Unity -batchmode -nographics -quit \
-projectPath . -executeMethod BuildScript.PerformBuild -logFile -Give the job more memory
Use a larger runner or container memory limit for big projects so the editor does not crash under load.
How to prevent it
- Always use
-nographicsfor headless batchmode builds. - Size runners to the project so memory does not run out.
- Keep native plugins updated to versions tested on Linux.