Skip to content

cursor-cli: SIGSEGV on startup with patchelf 0.19.2 (autoPatchelf corrupts bundled node) #579143

Done

Description

@dmivankov

Nixpkgs version

  • Unstable (26.11)

Describe the bug

cursor-cli’s bundled Node binary (share/cursor-agent/node) segfaults immediately after packaging with the current default patchelf 0.19.2 via autoPatchelfHook. The wrapper dies at the --use-system-ca --version probe:

cursor-agent: line 33: Segmentation fault (core dumped) "$NODE_BIN" --use-system-ca --version

Plain node --version also SIGSEGVs (exit 139). ldd on the patched binary exits 1 with no output.

Steps to reproduce

  1. Use a nixpkgs revision that has patchelf 0.19.2 (e.g. 3ec636362e1816bc2f0888fa0fa2c69f1bc9e504 or current master).
  2. nix-build -A cursor-cli (with allowUnfree).
  3. Run:
    ./result/share/cursor-agent/node --version

Expected behaviour

node --version prints v24.5.0 and cursor-agent starts.

Relevant log output

Segmentation fault (core dumped)

Additional context

  • Works on nixpkgs fe13242281a67641c0102cdb1087f0ebe586c7df where default patchelf is still 0.15.2 (same upstream agent-cli-package.tar.gz, same package.nix).

  • Broken once patchelf is 0.19.2: same source hash, but the patched node ELF differs by ~11MB in the first pages (layout rewrite), then SIGSEGV.

  • Local workaround that restores a working binary on the broken pin: put patchelf 0.15.2 first in nativeBuildInputs so auto-patchelf invokes it from PATH (same pattern as gnat-bootstrap / androidenv / #574271):

    cursor-cli.overrideAttrs (old: {
      nativeBuildInputs = [
        (patchelf.overrideAttrs (finalAttrs: previousAttrs: {
          version = "0.15.2";
          src = fetchurl {
            url = "https://github.com/NixOS/patchelf/releases/download/${finalAttrs.version}/patchelf-${finalAttrs.version}.tar.bz2";
            hash = "sha256-F3RfVkFZyOIo/EEtplogSLhGxLa0Igt3y/IkFuAvLXw=";
          };
        }))
      ] ++ (old.nativeBuildInputs or []);
    })
  • Same class of fallout as #576412 (nvidia-smi since patchelf 0.19.2). Related upstream: NixOS/patchelf#531 (node + --set-rpath), NixOS/patchelf#672 (overlapping LOAD fix, merged after 0.19.2 release — not in nixpkgs yet).

  • Open version bump #574219 does not address this (still autoPatchelfHook + default patchelf).

Notify maintainers

@sudosubin @AndrewBastin


Add a 👍 reaction to issues you find important.

Activity

  1. AndrewBastin commented on Nov 7, 2026

    @AndrewBastin
    Member

    I just merged in #574219, the latest bump in the PR seems to have fixed the issue. Maybe we can close this as this should be cleared now ?

  2. added a commit that references this issue on Nov 11, 2026
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions