Skip to content

[Bug]: Linux AppImage 1.4.148 — every CLI subcommand (incl. --version) SIGSEGVs in uv_close(); GUI mode unaffected #13719

Closed

Description

@whelp99-code

Environment

  • Orca 1.4.148 (Linux AppImage, orca-linux.AppImage, Chromium 150.0.7871.47)
  • Ubuntu 26.04 LTS, x86_64, glibc 2.43, kernel 7.0.0-29-generic (VM, 8 vCPU / 15 GB)
  • Headless server, no desktop session. Xvfb :102 provides the display.
  • Also reproduced on kernel 7.0.0-28-generic before an unrelated reboot, so this is not kernel-version specific.

Summary

Every CLI subcommand of the Linux AppImage crashes with SIGSEGV (exit 139) inside uv_close().
This includes --version, which does no real work at all, so it is not workload- or watcher-related.

The GUI mode of the same binary runs fine on the same machine at the same time, which makes this
look like a CLI-path-only teardown bug rather than a broken environment.

Reproduction

Minimal, 100% reproducible (4/4 runs):

./orca-ide --no-sandbox --disable-gpu --version
# exit 139 (SIGSEGV), no version printed

./orca-ide --no-sandbox --disable-gpu serve --pairing-address <host>
# exit 139 (SIGSEGV), no pairing URL printed, no port opened

Meanwhile, on the same host and at the same moment:

./orca-ide --no-sandbox --disable-gpu          # GUI mode under Xvfb
# runs normally, 7 processes alive, WebSocket runtime listening

Backtrace

Thread 1 "orca-ide" received signal SIGSEGV, Segmentation fault.
0x00005555592e7b35 in uv_close ()
#0  0x00005555592e7b35 in uv_close ()
#1  0x000055555ab20ecd in ?? ()
...
=> 0x5555592e7b35 <uv_close+37>:    mov    0x168(%rax),%rcx
   0x5555592e7b3c <uv_close+44>:    mov    %rcx,0x50(%rbx)
rip  0x5555592e7b35  <uv_close+37>

The faulting instruction reads handle->loop at offset 0x168 from %rax; %rax is not a valid
handle, i.e. uv_close() is called on an uninitialized or already-freed handle during teardown.

Kernel log shows the same fault at a constant binary offset on every run:

traps: orca-ide[...] general protection fault ip:...b35 ... in orca-ide[3d92b35,...+9ad3000]

Things ruled out

Each of these was tested and made no difference (still exit 139):

  • --use-gl=swiftshader, --headless, --disable-dev-shm-usage, --single-process
  • UV_USE_IO_URING=0, UV_THREADPOOL_SIZE=1
  • Fresh --user-data-dir
  • Running the extracted binary directly instead of the AppImage (FUSE mount not involved)
  • Real PTY vs. redirected stdio
  • kernel.apparmor_restrict_unprivileged_userns=0
  • Missing shared libraries (ldd reports none)
  • libuv in general is healthy on this host: Node 24.19.0 creates and closes TCP/fs-watch handles without issue.

Impact

orca serve is the documented way to expose a remote Orca runtime
(the UI itself suggests orca serve --pairing-address <host>), so on this platform remote pairing
via the CLI is impossible: the process dies before printing the orca://pair?code=... URL and
before binding a port.

Workaround

Running the GUI under Xvfb instead of serve produces a working runtime. The listening port
can be pinned by writing ~/.config/orca/mobile-ws-fallback-port.json:

{"port": 6769}

after which ~/.config/orca/orca-runtime.json reports ws://0.0.0.0:6769 and a remote client on the
same tailnet can reach it. This is what we ended up doing, but it bypasses the intended
serve + pairing-code flow entirely.

Related

Possibly the same crash class as #8212 (orca serve SIGSEGV), but that report is macOS + FSEvents +
concurrent worktrees. This one is Linux, has zero workload, and reproduces on --version, so the
trigger looks different.

Made with Orca 🐋

Activity

  1. manuaudio commented on Aug 11, 2026

    @manuaudio
    Contributor

    --version crashing is the tell, and I think it's explained without invoking libuv at all: --version is structurally ineligible for the redirect that routes a packaged Linux CLI invocation to the CLI entrypoint. It never reaches the CLI — the Electron main process keeps going with --version in argv and dies during startup/teardown. So this isn't "the CLI path SIGSEGVs"; for --version there is no CLI path taken.

    Verified on upstream/main at c065a2d7e1.

    The gate

    On Linux, maybeRedirectAppImageCliLaunch (src/main/startup/appimage-cli-redirect.ts:91) is what re-execs the binary as the CLI. It delegates eligibility to getAppImageCliArgs (:133), which returns null — meaning no redirect — unless the argv clears three gates:

    if (options.platform !== 'linux' || !options.isPackaged) return null   // :142
    if (!env.APPIMAGE && !env.APPDIR) return null                          // :145
    const cliArgs = args.filter((arg) => !APPIMAGE_DESKTOP_FLAGS.has(arg)) // :153
    if (cliArgs.some((arg) => HELP_FLAGS.has(arg))) return cliArgs         // :154
    …
    return firstPositional && commandNames.has(firstPositional) ? cliArgs : null  // :160

    and the flag set it checks against is (:25):

    const HELP_FLAGS = new Set(['--help', '-h', 'help'])

    --version is not in it — nor is -v or -V. And --version starts with -, so findFirstCommandCandidate (:163-175) skips it and returns null, failing the :160 branch too. Both exits return null, so maybeRedirectAppImageCliLaunch returns { redirected: false } at :105 and src/main/index.ts:443-444 simply does not call app.exit. Startup continues.

    The other redirect immediately above (maybeRedirectPackagedCliEntryLaunch, index.ts:430) can't catch it either — per the comment at index.ts:428-429, it "matches on the entry path instead", not on flags.

    So ./orca-ide … --version runs the full Electron main startup. That is consistent with your strongest observation — that --version "does no real work at all" — because the work being done isn't the CLI's, it's GUI startup being torn down.

    One command confirms or kills this

    --help is in HELP_FLAGS, and --version is not. So the two should diverge:

    ./orca-ide --no-sandbox --disable-gpu --help
    • Prints CLI help (exit 0) while --version still exits 139 → the gate is the mechanism, confirmed. The fix is a one-line eligibility change, not a libuv hunt.
    • Also exits 139 → the redirect isn't firing at all on your setup, and gate 2 (:145) is the next suspect, not the flag set.

    That second case is worth pre-empting, because your own testing points at it:

    env | grep -E 'APPIMAGE|APPDIR'

    :145 requires APPIMAGE or APPDIR to be set. You noted you also tried "running the extracted binary directly instead of the AppImage" — that clears both variables, so on that run the redirect could not have fired regardless of the subcommand. If your serve attempts were on the extracted binary, that alone explains them.

    There's corroboration for that in your own report: the redirect spawns the CLI with stdio: 'inherit' (:120-123), so a serve invocation that did redirect would have printed the pairing URL through to your terminal. You saw no output at all — consistent with the redirect never firing rather than with the CLI starting and dying.

    Things I checked and ruled out, so nobody re-chases them

    On the version gap

    You're on 1.4.148 and main is at 1.4.178-rc.2, so a retest on current is worth doing before anyone spends effort here. I'd stress that the --version gate above still reads the same way on main today, so I would not expect an upgrade alone to fix the --version case.

    What I could not determine

    I have no Linux AppImage build to run, so I did not reproduce the SIGSEGV or confirm what specifically faults in uv_close() once startup proceeds with CLI argv. The gate analysis explains why the process is in Electron startup at all, which I think is the load-bearing half; the crash itself may well be a second, independent defect in early app.exit/teardown that the gate merely exposes. Your backtrace stands on its own for that part.

    If --help works and --version doesn't, that asymmetry is the whole report in one line and would make this cheap to fix.

  2. nwparker commented on Sep 2, 2026

    @nwparker
    Contributor

    Fixed and now on main via #18100.

    Two independent fixes. CLI subcommands no longer boot Chromium at all (#15083), and a packaged non-serve launch with no usable display exits 1 with an actionable diagnosis instead of dying in Ozone teardown — the code comment cites this issue by number (src/main/index.ts, // Fail before Chromium's missing-display teardown can segfault (#13719).).

    Confirmed on hardware: the contract fails 4/8 against a pre-stack AppImage with three cases at status 133, and 8/8 after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions