Skip to content

fix(crash): name an inherited zero realtime limit when Linux kills Orca's GPU or renderer - #35984

Closed
OrcaWin wants to merge 2 commits into
mainfrom
crash/s60-linux-sigkill
Closed

OrcaWin wants to merge 2 commits into
mainfrom
crash/s60-linux-sigkill

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26

ELI5

Some Omarchy setups start every app with a "realtime CPU budget" of zero. Linux enforces that budget with no warning: once a thread inside Orca's GPU or renderer process starts a CPU timer, the kernel kills the process outright. No crash dump is written, and memory is not the cause. Orca can't raise that budget. What it can do is say the budget is zero, so these reports explain themselves.

Description

What users saw: on Omarchy (kernel 7.2.x), Orca's GPU or renderer process died with exit code 9 (SIGKILL), with GBs of RAM free and no minidump. Windows went blank or reloaded while the main process kept running.

Root cause: the kernel's RLIMIT_RTTIME watchdog. When rtkit is missing, Omarchy's launcher (quickshell, a PipeWire client using module-rt / rtportal) ends up with a hard RLIMIT_RTTIME of 0 0. Every app it launches inherits that limit. The first time a Chromium thread's CPU timer is checked, the kernel sends SIGKILL (SI_KERNEL). An unprivileged process cannot raise a hard limit, so Orca cannot fix this itself.

The real fix is upstream: omacom/omarchy#16824 (merged 2026-10-28). It installs rtkit, sets rtportal.enabled=false, and adds the omarchy-realtime-repair migration. Affected users should update Omarchy, or install rtkit and log in again.

What this PR does: it makes future reports name the cause themselves.

  • Adds src/main/linux-rttime-limit.ts (readZeroRtTimeLimit), which parses /proc/self/limits and returns the raw soft/hard values when either one is 0. On non-Linux it returns null.
  • buildProcessGoneCrashDetails adds rlimitRtTimeSoftUs / rlimitRtTimeHardUs to process-gone crash details when the limit is zero. GPU and renderer children inherit main's limit at fork, so main's own value matches theirs.
  • Records a linux_rttime_limit crash breadcrumb at startup when the limit is zero.
  • Reuses the existing parser instead of adding a second one: src/main/daemon/daemon-rttime-limit.ts (warnWhenRealtimeTimeoutIsZero, [Bug][Linux]: Orca runs with RLIMIT_RTTIME 0, so processes in Orca terminals get SIGKILLed #29745) now calls the shared helper. Its log event, fields and trigger condition are unchanged.

Crash reports

Covered (Omarchy, kernel 7.2.8-9, GBs free, exit 9):

  • cfe38b0a-1858-4906-9cd1-5b62f4e1b190
  • 2a1343a9-c1a3-4a86-81bf-9f5aab101d9a
  • b327d73a-e998-4d23-a1a7-8f1cc0d7614d
  • b253e857-db19-4790-a4e7-0e0482f785d6

Not covered (real memory pressure, about 1 GB available; a different cause):

  • 3d9a76e9-4ac1-4d62-9cec-d7072a692435
  • ee9875e8-59ea-4bb4-9e16-867d378e6d3f

Fix evidence

All runs are on the Omarchy test box (7.2.5-3-omarchy, pacman -Q rtkit → error: package 'rtkit' was not found).

1. The kernel kills a thread with a CPU timer armed under a zero limit. rttime_repro.py arms a CLOCK_THREAD_CPUTIME_ID timer for 200 ms and then spins for 3 s:

unlimited: survived
exit=0
0:0: bash: line 1: 1511054 Killed                     prlimit --rttime=$l python3 rttime_repro.py
exit=137
200000: survived
exit=0

2. The same kill hits Orca v1.4.244's GPU process (A/B). The same Orca build ran twice with a thread-CPU-timer shim, once under prlimit --rttime=0:0 and once unlimited.

  • Zero limit: 3 GPU kills, and main (pid 1490182) keeps running and reinitializes the GPU process.
[1490182:1029/072628.152850:ERROR:content/browser/gpu/gpu_process_host.cc:1108] GPU process exited unexpectedly: exit_code=9
[1490182:1029/072628.224893:ERROR:content/browser/gpu/gpu_process_host.cc:1108] GPU process exited unexpectedly: exit_code=9
[1490182:1029/072628.305096:ERROR:content/browser/gpu/gpu_process_host.cc:1108] GPU process exited unexpectedly: exit_code=9
[1490182:1029/072628.316920:WARNING:content/browser/gpu/gpu_process_host.cc:1130] Reinitialized the GPU process after a crash. The reported initialization time was 0 ms
  • Unlimited control: the timer was armed (RENDERER_CPUTIMER armed pid=1491367), and there were 0 exit_code=9 lines.

3. The real launcher passes a zero limit to its children (/proc/<pid>/limits on the live session):

quickshell pid=888655: Max realtime timeout      0                    0                    us
  child 889278 wl-paste: Max realtime timeout      0                    0                    us
  child 889279 wl-paste: Max realtime timeout      0                    0                    us

(One older child, inotifywait, shows unlimited. The apps quickshell launches inherit 0 0.)

4. The parser reads the real Omarchy limits file correctly. readZeroRtTimeLimit was run on quickshell's copied /proc/888655/limits:

omarchy quickshell limits -> {"soft":"0","hard":"0"}
darwin -> null

5. Tests: pnpm vitest run src/main/daemon/daemon-rttime-limit.test.ts. That file covers the shared parser through the daemon wrapper.

 Test Files  1 passed (1)
      Tests  5 passed (5)

6. pnpm check:changed --maxWorkers=2: ✓ 20 check(s) passed in 154.7s. (Run on the final head. The first run caught a mocked-module test failure in main-process-ready-duplicate-pty-repair.test.ts. The fix was to read the limit at startup straight from the shared helper.)

Trade-offs

  • Diagnostic only. This PR does not stop the kills, because only the OS can raise the hard limit (rtkit / Give PipeWire realtime with rtkit and stop the silent app kills omacom/omarchy#16824). It makes the cause visible in crash reports and breadcrumbs.
  • Cost: one small synchronous read of /proc/self/limits per process-gone report, plus one at startup. Off Linux the helper returns early and reads nothing.
  • No protocol or shared-type changes. Remote and mixed-version setups are unaffected. Behavior on macOS and Windows does not change.

Adversarial review

1 loop, clean: no P0 or P1 issues.

  • Duplicate parser: removed. Both the daemon warning and the crash diagnostics use src/main/linux-rttime-limit.ts.
  • Daemon warning: same event, same fields, same condition. Its existing tests pass (5/5).
  • Daemon bundle: the new module imports only node:fs, so the daemon bundle's plain-node entry guard is unaffected.
  • Platforms: a no-op on macOS and Windows.
  • Casts: none.
  • Report fields: the new fields are short strings, so redaction leaves them intact and they reach electron.process_gone details.
  • P2 follow-up, applied: the shared comment now says the kernel kills any thread with a CPU timer armed, instead of "realtime threads". That is the exact Chromium GPU/renderer case the repro hit.

m4air added 2 commits October 29, 2026 07:33
…orts

Omarchy launches apps from a shell that holds a hard RLIMIT_RTTIME of 0
(no rtkit, so the portal's zero realtime budget is applied by PipeWire
module-rt). Orca inherits it in every process, and the kernel CPU-timer
watchdog SIGKILLs GPU and renderer processes with no dump while GBs of
memory are free. A hard limit cannot be raised without privilege, so
record it as a startup breadcrumb and in process-gone crash details.

Move the daemon's /proc/self/limits parser into one shared reader so the
terminal warning and crash attribution flag the same zero soft or hard
limit.
@nwparker

nwparker commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

#36183 has merged and includes a later version of this PR's rttime-reporting changes (the same process-gone fields and daemon refactor). This PR looks superseded and is probably safe to close; I'm leaving that call to its owner.

@nwparker

nwparker commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #36183, which merged.

@nwparker nwparker closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants