Electron crashes with no display
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
44.4.5
What operating system(s) are you using?
Ubuntu
Operating System Version
Ubuntu 24.04 X11
What arch are you using?
x64
Last Known Working Electron version
N/A
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
Electron should not crash, best if it would automatically use a headless platform.
I'm working on adding some cli support to an electron based app. More specifically via theia. Uses an older version of electron, but the issue is not fixed in the current version. For reproduction, I did asked an AI (Claude) to create an minimal reproducible case. electron-headless-crash-repro.zip
What we try to do is to support some operations as cli, without an actual UI. Whereas the app normally runs with an UI. But when starting with a cli option, we currently crash if no display is setup, or if the DISPLAY env var is incorrectly set. One environment we run into this is the Ubuntu github build runner. But in general we want to support to run some operations headless.
Actual Behavior
with our older version of electron, we run into a crash (SIGSEGV) with the current one I see a SIGTRAP. We cannot handle either of those).
I cannot easily create a github gist (company setup), so I did attach a zip instead (sorry :-( ).
Testcase Gist URL
No response
Additional Information
No response
Source: electron/electron