omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

`omarchy-browser-prewarm.service`: stopping it makes the browser core dump (SIGTRAP) on every logout, update and reboot

Open Korgen-Jurai opened this issue 2 days ago • 6 comments

What happens Every time omarchy-browser-prewarm.service stops (logout, reboot, or the restart omarchy-update triggers), the browser dies with SIGTRAP and leaves a core dump. Users then get a "Process crashed" notification without having done anything.

Mon 2026-11-30 11:27:26  132683 SIGTRAP  /opt/brave-origin-bin/brave   (logout)
Mon 2026-11-30 11:57:53  964708 SIGTRAP  /opt/brave-origin-bin/brave   (update restarted the service)
Mon 2026-11-30 12:28:16 1088246 SIGTRAP  /opt/brave-origin-bin/brave   (update restarted the service)
Mon 2026-11-30 12:28:17 1216660 SIGTRAP  /opt/brave-origin-bin/brave   (reboot, 2 s after the restart)

All four crash at the same frame (brave + 0xcd05e4a), which is a deliberate abort on a failed internal check, not a random crash.

Cause At startup, Chromium moves its main browser process out of the service's cgroup into its own transient app-org.chromium.Chromium-<pid>.scope. Its helper processes (zygote, GPU, renderers) and the wrapper script stay in omarchy-browser-prewarm.service:

2756 /opt/brave-origin-bin/brave ... --no-startup-window --keep-alive-for-test
     0::/user.slice/.../app.slice/app-org.chromium.Chromium-2756.scope
2876 /opt/brave-origin-bin/brave --type=zygote ...
     0::/user.slice/.../app.slice/omarchy-browser-prewarm.service

On stop, systemd kills only the service's cgroup: the wrapper and the helpers, but not the main browser process. The main process then sees its zygote and GPU process gone and aborts.

Steps to reproduce

  1. Brave Origin as the default browser, with at least 5 GB of RAM so the service runs.
  2. systemctl --user restart omarchy-browser-prewarm (or log out, or reboot).
  3. coredumpctl list shows a new SIGTRAP core dump from the browser.

Expected: the browser shuts down cleanly.

Possible fix Ask the main process to quit before systemd kills the cgroup. Chromium shuts down cleanly on SIGTERM while its helpers are still alive. This drop-in fixes it here; after it, stopping or restarting the service leaves no core dumps:

[Service]
ExecStop=%h/.local/bin/browser-prewarm-stop $MAINPID
TimeoutStopSec=15
#!/bin/bash
wrapper=$1
pids=$(pgrep -P "$wrapper" | while read -r p; do [[ $(cat /proc/$p/comm 2>/dev/null) == cat ]] || echo "$p"; done)
[[ -z $pids ]] && exit 0
kill -TERM $pids 2>/dev/null
for _ in $(seq 100); do
  alive=0
  for p in $pids; do kill -0 "$p" 2>/dev/null && alive=1; done
  ((alive)) || exit 0
  sleep 0.1
done

($MAINPID is the vendor wrapper script; the real browser is its child that isn't cat.) Exec-ing the binary directly, without the wrapper, would make $MAINPID the browser itself. That's simpler, but it may still need a stop step before the cgroup is killed, because the main process is outside the service's cgroup.

System

  • Omarchy 4.0.0.r8686.g956df5a
  • AMD Ryzen 7 7800X3D, NVIDIA RTX 4070 SUPER (+ Radeon 610M iGPU)
  • brave-origin-bin 1:1.100.59-1
  • Only tested with Brave Origin; other Chromium browsers likely do the same, since the scope move is Chromium behavior.

Filed by Claude Opus 5.5 via Claude Code.

Korgen-Jurai avatar Nov 30 '26 18:11 Korgen-Jurai

Confirming this on the released v4.6.0-rc2 (omarchy 4.6.0rc2-1 package, not just a dev build), which is the first release shipping the prewarm service (#20910, #20928). Different hardware too: AMD Ryzen AI 7 350 with Radeon 860M iGPU only, no NVIDIA. brave-origin-bin 1:1.100.59-1.

Two SIGTRAP cores on the first boot after updating from 4.6.0rc1 to rc2, both at the same frame as above (brave + 0xcd05e4a), with identical stacks:

21:58:19  SIGTRAP  /opt/brave-origin-bin/brave  (service restarted right after the post-update step, ~20 s after login)
22:10:31  SIGTRAP  /opt/brave-origin-bin/brave  (power-off: omarchy-system shutdown stops the service)

In both cases the journal shows Stopped Keep the default browser running hidden… about 40–50 ms before systemd-coredump picks up the browser. coredumpctl info lists the crashed process under User Unit: app-org.chromium.Chromium-<pid>.scope, not under omarchy-browser-prewarm.service, which matches the cgroup-split cause described above.

So on rc2 every user with Brave Origin as the default browser and at least 5 GB of RAM will get a crash notification on every shutdown and every update that restarts the service.

Filed by Claude Opus 5.5 via Claude Code.

hnry047 avatar Dec 01 '26 14:12 hnry047

Codex 6.2 Sol High, Opus 5.5 High and Muse Wonder High checked the service and #20977 from source. On quattro, stopping prewarm can terminate Brave Origin’s helpers while its browser process is still running in a separate scope. #20977 already links this issue and asks the browser to exit before its helpers are stopped. The update helper can signal browser processes before it restarts the service, so #20977’s runtime verification should exercise that path separately from a direct service restart.

omarchybot avatar Dec 02 '26 13:12 omarchybot

Another consequence of this on rc2: on the update path, the Brave stop also took down Hyprland. When Brave's client was destroyed, Hyprland segfaulted in omarchy-hyprland-titlebars (COmarchyFloatingHyprBar::draw → omarchyWantsServerDecorations, during CWindow::unmapWindow → makeSnapshotFB), killing the whole session. Filed separately as #21340, since the compositor crash is a plugin bug in its own right. It might be worth covering in #20977's runtime verification: restart the service while a Brave window is mapped. Brave Origin 1:1.100.59-1, same brave + 0xcd05e4a frame.

Filed by Claude Opus 5.5 via Claude Code.

rilesc555 avatar Dec 02 '26 15:12 rilesc555

Still reproduces on 4.6.0rc3-1, which does not include #20977: there is no omarchy-cmd-browser-prewarm-stop and omarchy-browser-prewarm.service is unchanged. AMD Ryzen AI MAX+ 395 (Strix Halo, Radeon 8060S), brave-origin-bin 1:1.100.59-1, linux-omarchy 7.3.6-10. Same brave + 0xcd05e4a frame on all three cores.

Three SIGTRAP cores in one update session, covering both the update and the reboot paths:

07:28:24.852  Started Keep the default browser running hidden…   (service restarted during omarchy-update)
07:28:24.907  Process 3658 (brave) terminated abnormally with signal 5/TRAP

07:28:28.810  Stopped Keep the default browser running hidden…   (omarchy-system reboot --execute)
07:28:28.868  Process 37499 (brave) terminated abnormally with signal 5/TRAP
07:28:30.300  omakeys: The Wayland connection broke

07:31:37.955  Stopped Keep the default browser running hidden…   (omarchy-system reboot --execute, after the rc2→rc3 upgrade)
07:31:38.015  Process 38102 (brave) terminated abnormally with signal 5/TRAP
07:31:39.735  omakeys: The Wayland connection broke

The crash consistently comes about 55–60 ms after the service stops and about 1.5–1.7 s before the compositor exits. That rules out a lost Wayland connection as the trigger: Brave dies while Hyprland is still up. As in the earlier reports, coredumpctl info puts the crashed process in app-org.chromium.Chromium-<pid>.scope, not in the service's cgroup.

Filed by Claude Opus 5.5 via Claude Code.

RobbyBobby77 avatar Dec 02 '26 15:12 RobbyBobby77

The December 2 reboot on Omarchy 4.6.0.r8797.g4d0085b-1 captured the fatal message behind brave + 0xcd05e4a. With brave-origin-bin 1:1.100.59-1, the main browser process logged:

[72695:72695:1202/102251.335053:FATAL:content/browser/gpu/gpu_data_manager_impl_private.cc:385] GPU process isn't usable. Goodbye.

Brave emitted that message 28 ms after omarchy-browser-prewarm.service stopped. The browser was still in app-org.chromium.Chromium-72695.scope. Two earlier power-offs on this machine produced the same first six browser stack frames.

Filed by GPT-6 via Codex.

RafiPafi1 avatar Dec 02 '26 15:12 RafiPafi1

The rc3 reboot logs put Brave’s SIGTRAP before the Wayland disconnect. Codex High, Opus 5.5 High and Muse Wonder High checked the restart path. The rc2 update guard could miss a Brave Origin window because it matched only the service wrapper’s PID. #20979 changed it to match browser process PIDs on quattro. For #20977, check that omarchy-restart-browser --quiet leaves an open Brave Origin window alone, then rerun it with the browser prewarmed and windowless to check for a clean restart without a new core dump. The Hyprland titlebars crash is tracked in #21340.

omarchybot avatar Dec 02 '26 15:12 omarchybot