Skip to content

Bundled ripgrep aborts with jemalloc 'Unsupported system page size' on 16KB-page ARM64 kernels (Asahi Linux) #4977

Closed

Description

@richardpowellus

Description

The ripgrep binary bundled with the Copilot CLI (<pkg-dir>/ripgrep/bin/linux-arm64/rg) statically links jemalloc built assuming a 4KB page size. On a kernel configured with a 16KB page size — the default on Asahi Linux (Linux-on-Apple-Silicon) — the binary aborts immediately instead of running, which breaks any Copilot CLI feature that shells out to ripgrep for file search.

Environment

  • copilot --version: GitHub Copilot CLI 1.0.88
  • OS: Ubuntu on Asahi Linux, kernel 7.0.0-1002-asahi-arm (aarch64)
  • getconf PAGESIZE: 16384
  • Affected path pattern: ~/.cache/copilot/pkg/linux-arm64/<version>/ripgrep/bin/linux-arm64/rg — reproduced on cached versions 1.0.83, 1.0.87, and 1.0.88, so this has been present across multiple releases.

Reproduction

$ getconf PAGESIZE
16384
$ echo hello | ~/.cache/copilot/pkg/linux-arm64/1.0.88/ripgrep/bin/linux-arm64/rg hello
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 160 bytes failed
Aborted (exit code 134)

file on the binary confirms it's statically linked (bundling its own allocator):

.../ripgrep/bin/linux-arm64/rg: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped

For comparison, the distro's own rg (dynamically linked, uses glibc's allocator, no jemalloc) runs fine on the same machine — the crash is specific to this bundle's static jemalloc, not the kernel or the machine generally.

Expected

Any file-search feature that shells out to the bundled ripgrep should work on 16KB-page kernels, since ripgrep itself has no such restriction — this is purely a byproduct of how this specific prebuilt binary was compiled/linked.

Suggested fix

Either build the bundled ripgrep against a page-size-agnostic allocator (e.g. link the system allocator instead of a statically-linked jemalloc build pinned to 4KB pages), or fall back to a PATH-available rg/grep when the bundled binary fails to exec/aborts.

Workaround in use

Replacing the bundled rg at each cached version's ripgrep/bin/linux-arm64/rg with the system's dynamically-linked rg resolves the crash locally, but is undone on every CLI update since it re-fetches the broken bundle.

Activity

  1. added
    area:installationInstalling, updating, versioning, PATH setup, and binary distribution
    area:platform-linuxLinux-specific: Wayland, X11, Ubuntu, Fedora, Alpine, ARM, terminal emulators
    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior
    and removed on Sep 30, 2026
  2. johnturek commented on Oct 9, 2026

    @johnturek

    Still reproducing on Copilot CLI package 1.0.94 (1.0.93 is also installed; I only tested 1.0.94).

    Environment: Arch Linux ARM on Apple Silicon (Omarchy), kernel 7.1.12, getconf PAGESIZE = 16384.

    Repro: ~/.cache/copilot/pkg/linux-arm64/1.0.94/ripgrep/bin/linux-arm64/rg --version

    <jemalloc>: Unsupported system page size
    <jemalloc>: Unsupported system page size
    memory allocation of 160 bytes failed
    

    The process then aborts with SIGABRT. systemd-coredump recorded 4 crashes in one afternoon, all from the agent's search tool calls, so every search with the bundled rg fails on this machine.

    Likely cause (inference): jemalloc in the bundled ripgrep is built for 4K pages. Building it with --with-lg-page=14 (or larger) would cover 16K kernels. Preferring or falling back to a system rg when the bundled one fails would also help.

    Workaround: the system ripgrep (15.2.0 from the distro package) runs fine on the same machine.

  3. johnturek commented on Oct 25, 2026

    @johnturek

    Still reproducible on Copilot CLI 1.0.103 (the latest published release as of 2026-10-25). This follows up on my 1.0.94 report above.

    • ARM64 Linux on Apple Silicon, using a kernel with 16,384-byte pages (getconf PAGESIZE).
    • The 1.0.103 bundled ripgrep/bin/linux-arm64/rg is statically linked. Both built-in rg and glob searches fail with jemalloc: Unsupported system page size, followed by an allocation failure and SIGABRT. systemd-coredump confirms the bundled executable is the process aborting.
    • System /usr/bin/rg (15.2.0) runs successfully on the same machine.
    • Verified workaround: launch a fresh Copilot process with USE_BUILTIN_RIPGREP=false and a working system rg on PATH. I verified both actual built-in search tools against a harmless fixture: glob found the file and rg found its matching line. Setting this for future shells does not change an already-running Copilot process.

    Related: #4918 reports the same allocator failure on 64 KiB-page ARM64 kernels. A permanent fix should cover both 16 KiB and 64 KiB kernels, for example by shipping an ARM64 ripgrep build without this jemalloc page-size restriction (or with support for all supported kernel page sizes). The workaround avoids the incompatible binary but does not repair the shipped artifact.

    Is there a public source/build pipeline for this bundled ripgrep artifact where we can contribute a patch and a startup/search smoke test on larger-page ARM64 kernels? The public copilot-cli repository does not appear to include the CLI search implementation or its ripgrep build pipeline.

    No core dumps or private logs are attached.

  4. techt3 commented on Nov 8, 2026

    @techt3

    Still reproducible in Copilot CLI 1.0.107 on Omarchy/Arch Linux ARM with 16 KiB pages. The bundled static ripgrep/bin/linux-arm64/rg aborts with jemalloc: Unsupported system page size; system rg 15.2.0 works.

    I built ripgrep 15.2.0 from upstream on the same host as a normal glibc binary (no jemalloc), exercised the same search, and its 446 release tests pass. Please reopen: ship the ARM64 bundle without the 4 KiB-pinned jemalloc, or automatically fall back to PATH rg when the bundled executable aborts. USE_BUILTIN_RIPGREP=false remains a viable workaround.

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

    area:installationInstalling, updating, versioning, PATH setup, and binary distributionarea:platform-linuxLinux-specific: Wayland, X11, Ubuntu, Fedora, Alpine, ARM, terminal emulatorsarea:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions