Skip to content
Latchkey

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.

unity
Receiving unhandled NULL exception
Segmentation fault (core dumped)
Error: The process '/opt/unity/Editor/Unity' failed with exit code 139

Common 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

  1. Pass -batchmode -nographics -quit so the editor does not touch a display.
  2. Write logs to stdout with -logFile - so the crash context is visible.
  3. Re-run on the headless configuration.
Terminal
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 -nographics for headless batchmode builds.
  • Size runners to the project so memory does not run out.
  • Keep native plugins updated to versions tested on Linux.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →