Skip to content

Tracking: patchelf failures caused by 0.19.2 #577387

Open

Description

@corngood

patchelf was updated in dcd39b0. This introduced some cases where patchelf would crash, or output an executable that would crash.

e.g.

autoFixElfFiles: using addDriverRunpath to fix /nix/store/rl7n8mx6794l9pbcj16qhpsh6vpzvz78-cuda13.4-libcufile-1.19.1.55/tools/gdsio
patchelf: patchelf.cc:547: void ElfFile<Elf_Ehdr, Elf_Phdr, Elf_Shdr, Elf_Nhdr, Elf_Addr, Elf_Off, Elf_Dyn, Elf_Sym, Elf_Versym, Elf_Verdef, Elf_Verdaux, Elf_Verneed, Elf_Vernaux, Elf_Rel, Elf_Rela, ElfClass>::shiftFile(unsigned int, size_t, size_t) [with Elf_Ehdr = Elf64_Ehdr; Elf_Phdr = Elf64_Phdr; Elf_Shdr = Elf64_Shdr; Elf_Nhdr = Elf64_Nhdr; Elf_Addr = long unsigned int; Elf_Off = long unsigned int; Elf_Dyn = Elf64_Dyn; Elf_Sym = Elf64_Sym; Elf_Versym = short unsigned int; Elf_Verdef = Elf64_Verdef; Elf_Verdaux = Elf64_Verdaux; Elf_Verneed = Elf64_Verneed; Elf_Vernaux = Elf64_Vernaux; Elf_Rel = Elf64_Rel; Elf_Rela = Elf64_Rela; unsigned int ElfClass = 64; size_t = long unsigned int]: Assertion `splitIndex == -1' failed.
/nix/store/c9fggk6arh8c1x8fbama99crqng8wcmx-add-driver-runpath-hook/nix-support/setup-hook: line 23:   379 Aborted                    (core dumped) patchelf --set-rpath "/run/opengl-driver/lib:$origRpath" ${forceRpath:+--force-rpath} "$file"
Segmentation fault (core dumped)
Run exit: 139

NixOS/patchelf#672 includes a fix related to this.

Based on this comment, it's unclear if it will solve all of the problems:

NixOS/patchelf#672 (comment)

With this PR, the Grpc.Tools patch sequence still produces invalid output or aborts:

Workaround commits that should potentially be reverted:

Activity

  1. changed the title [-]Tracking: revert patchelf hacks that work around problems in 0.19.2[/-] [+]Tracking: patchelf failures caused by 0.19.2[/+] on Oct 22, 2026
  2. added
    5.scope: tracking
    on Oct 22, 2026
  3. Tygo-van-den-Hurk commented on Oct 23, 2026

    @Tygo-van-den-Hurk
    Member

    I'm not sure if its helpful to mention or just noise but I found (some) executables from the gcc-arm-embedded package stopped working because of this exact issue.

    full list of them
    • arm-none-eabi-addr2line
    • arm-none-eabi-ar
    • arm-none-eabi-as
    • arm-none-eabi-c++
    • arm-none-eabi-c++filt
    • arm-none-eabi-cpp
    • arm-none-eabi-g++
    • arm-none-eabi-gcc
    • arm-none-eabi-gcc-15.3.1
    • arm-none-eabi-gcc-ar
    • arm-none-eabi-gcc-nm
    • arm-none-eabi-gcc-ranlib
    • arm-none-eabi-gcov
    • arm-none-eabi-gcov-dump
    • arm-none-eabi-gcov-tool
    • arm-none-eabi-gdb
    • arm-none-eabi-gdb-add-index
    • arm-none-eabi-gfortran
    • arm-none-eabi-gprof
    • arm-none-eabi-ld
    • arm-none-eabi-ld.bfd
    • arm-none-eabi-lto-dump
    • arm-none-eabi-nm
    • arm-none-eabi-objcopy
    • arm-none-eabi-objdump
    • arm-none-eabi-ranlib
    • arm-none-eabi-readelf
    • arm-none-eabi-size
    • arm-none-eabi-strings
    • arm-none-eabi-strip
  4. limwa commented on Oct 26, 2026

    @limwa
    Contributor

    #577949 should be reverted as well

  5. TyceHerrman commented on Oct 27, 2026

    @TyceHerrman
    Contributor

    NixOS/patchelf#672 is merged

    also, another Node reproduction to add:

    With nixpkgs 31f3e225826b, patchelf 0.19.2 corrupted the official prebuilt Node 24.22.1 binary during autoPatchelfHook processing. Applying the source changes from upstream commit 59acc3d98b4961cfddf02090d9426ac735603218 fixed it on both x86_64-linux and aarch64-linux. The Node archives and checksums were unchanged.

    #579143 reports similar symptoms with Cursor’s bundled Node.

  6. MaxWipfli commented on Oct 27, 2026

    @MaxWipfli
    Contributor

    #576779 is also (partially) caused by this, and the accompanying PR #578975 will contain a fix that can be reverted for the new patchelf version.

  7. corngood commented on Oct 27, 2026

    @corngood
    ContributorAuthor

    #576779 is also (partially) caused by this, and the accompanying PR #578975 will contain a fix that can be reverted for the new patchelf version.

    If the PR had a separate commit with the revert-able part that we could link here, that would be cool.

  8. silikeite commented on Oct 28, 2026

    @silikeite

    #579810 (for packages attempting to connect via JACK) might also be caused by this, reverting the affected packages to unstable prior to the patchelf upgrade fixes the affected packages.

    Not skilled enough myself though to prove prove if the issue is due to patchelf or if it's a problem in JACK/ALSA/Pipewire so putting that disclaimer ahead.

  9. silikeite commented on Oct 29, 2026

    @silikeite

    #579810 (for packages attempting to connect via JACK) might also be caused by this, reverting the affected packages to unstable prior to the patchelf upgrade fixes the affected packages.

    Not skilled enough myself though to prove prove if the issue is due to patchelf or if it's a problem in JACK/ALSA/Pipewire so putting that disclaimer ahead.

    Was able to prove that the issue is patchelf-related by reverting only patchelf to 15.2 on the affected apps.

  10. added a commit that references this issue on Oct 30, 2026
  11. DADA30000 commented on Oct 30, 2026

    @DADA30000

    when will patchelf finally be fixed in upstream and updated in nixpkgs? seems like a very-very slow reaction time for a dependency that's like at the core of nixpkgs and affects many-many packages.
    especially considering new release is kinda close already

  12. corngood commented on Oct 30, 2026

    @corngood
    ContributorAuthor

    when will patchelf finally be fixed in upstream and updated in nixpkgs? seems like a very-very slow reaction time for a dependency that's like at the core of nixpkgs and affects many-many packages.

    There's some discussion of the patchelf release here: NixOS/patchelf#672 (comment)

    I'm sure it'll quickly go into staging after that. The fact that it's at the core of nixpkgs is why it need to go through staging.

  13. domenkozar commented on Oct 31, 2026

    @domenkozar
    Member

    I've released 0.19.3 that addresses most of these issues:

    Case Version / architecture 0.19.3 result Verification / limits
    GNAT bootstrap 16.1.0-1 Fixed Executable rewrite and loader checks pass
    CUDA libcufile / gdsio 1.19.1.55 Fixed Repatching regression checks pass
    CUDA nvcc / cicc 12.9.86 Fixed Repatching regression checks pass; no full CUDA workload
    NVIDIA utilities / nvidia-smi 615.78.08 Fixed Patching and startup checks pass; no GPU workload
    NVIDIA nvidia-powerd 615.78.08 Environment limited Filesystem exception creating /var/log/nvtopps; controls fail identically
    Radeon GPU Profiler 2.7.1 Fixed Patching and loader checks pass
    .NET apphost 2.1.30 Pass Shared failure case underlying qbittorrent-cli/naps2 reports; full packages not rebuilt
    Grpc.Tools 2.83.0, x86_64 + AArch64 Fixed Exact interpreter/add-needed/add-rpath sequence passes; clean readelf after every operation
    Android CMake / Ninja 3.22.1 / 1.10.2 Fixed Reported patching/startup reproductions pass
    ARM GNU toolchain 15.3.rel1 / compiler 15.3.1 Fixed Checked executable rewrite/startup failures pass; no complete compiler bootstrap
    Official Node.js 24.22.1, x86_64 + AArch64 Pass Patched binaries execute and print expected versions
    Cursor bundled Node.js 24.5.0, x86_64 + AArch64 Pass Patched binaries execute and print expected versions
    Cursor static objects Four ELF inputs Expected rejection Static objects reject interpreter changes
    Insync executable 3.9.11.60043 Fixed --help passes after all eight RPATH lengths, 50–6400 bytes; 0.19.2 crashed in seven
    Insync QtWebEngineProcess.debug Debug-only ELF Still fails data offset extends past file end; retain package workaround to skip/remove this object
    OpenCode 2.0.32, x86_64 + AArch64 Fixed Exact official npm binaries, integrity verified; initial and repeated rewrites execute successfully; 0.19.2 and initial release candidate segfaulted
    REAPER 7.82, x86_64 Pass Main/plugin-host loader checks pass; full interface starts and registers JACK input/output ports
    Pianoteq Trial 9.2.1, x86_64 Fixed Startup passes; JACK MIDI input produces captured nonzero audio
    Pianoteq Trial 9.2.1, AArch64 Pass Executes with dependency closure; controls also pass this ARM sequence
    Renoise Demo 3.5.4, x86_64 Pass Main/plugin-server loader checks pass; full interface starts and registers JACK stereo output ports
    Audacity 4.0.0, x86_64 Pass Repatched native executable records through JACK; PortAudio stream checks also pass
    Bitwig helper 6.1.4 Fixed Previously reproduced helper regression remains fixed
    Bitwig main / JACK 6.1.4 Limited coverage Main application reaches EULA screen; JACK behavior remains unverified because EULA was not accepted
  14. vcunat commented on Oct 31, 2026

    @vcunat
    Member

    It's a complicated situation.

    In the meantime I reverted patchelf back to 0.15.2 in the current staging-next cycle (as cross-linked above by GitHub). Stable 26.11 is to be released in 2-3 weeks for now, which is pretty close for such a core package like patchelf is here. Let's update the default to 0.19.3 right after the branch-off (in a couple weeks).

  15. limwa commented on Oct 31, 2026

    @limwa
    Contributor

    It's a complicated situation.

    In the meantime I reverted patchelf back to 0.15.2 in the current staging-next cycle (as cross-linked above by GitHub). Stable 26.11 is to be released in 2-3 weeks for now, which is pretty close for such a core package like patchelf is here. Let's update the default to 0.19.3 right after the branch-off (in a couple weeks).

    Should we start creating PRs targeting staging-next to revert the commits above?

  16. vcunat commented on Oct 31, 2026

    @vcunat
    Member

    I had thought about it but I'd wait a bit until we have binaries. And then it should be fairly easy.

  17. domenkozar commented on Oct 31, 2026

    @domenkozar
    Member

    It's a complicated situation.

    In the meantime I reverted patchelf back to 0.15.2 in the current staging-next cycle (as cross-linked above by GitHub). Stable 26.11 is to be released in 2-3 weeks for now, which is pretty close for such a core package like patchelf is here. Let's update the default to 0.19.3 right after the branch-off (in a couple weeks).

    Sounds good to me!

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

    5.scope: tracking

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions