You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Setting interpreter before rpath results in broken binary #674
I can reproduce this on both my desktop and laptop running NixOS with patchelf 0.19.2 and the NixOS-packaged NVIDIA driver.
I also narrowed the failure down to how the interpreter and RPATH are patched:
Applying --set-interpreter and --set-rpath in a single patchelf invocation produces an executable that segfaults.
Applying the same changes in separate invocations, with --set-rpath first and --set-interpreter second, works.
Applying either change individually also works.
On my desktop, this affects nvidia-smi from NVIDIA driver 595.104.02 on an RTX 3080. The original, unpatched executable works, while the Nix-packaged binary segfaults, including when invoked through the Nix dynamic loader explicitly.
I also reproduced the issue on my laptop after updating to the latest available NVIDIA driver. This makes a driver-version-specific explanation less likely and points toward the ELF rewriting performed by patchelf, as you have indicated.
I also hit this on NixOS (patchelf 0.19.2, nvidia-smi from driver 615.78.08), reported downstream in NixOS/nixpkgs#576412.
In the broken binary the new read-only LOAD segment overlaps the RW one, so .dynamic ends up mapped read-only and ld.so crashes with SEGV_ACCERR in dl_main. Running --set-rpath and --interpreter as separate calls avoids it, same as described above.
Looks like they got it fixed upstream. I tested nvidia-smi with both the current Nixpkgs Patchelf and a local build of the latest upstream version. The current version segfaults, but the upstream build works. Just need to wait for the fix to make it into Nixpkgs.
Activity
TPi-Home commentedon Oct 20, 2026
I can reproduce this on both my desktop and laptop running NixOS with patchelf 0.19.2 and the NixOS-packaged NVIDIA driver.
I also narrowed the failure down to how the interpreter and RPATH are patched:
Applying --set-interpreter and --set-rpath in a single patchelf invocation produces an executable that segfaults.
Applying the same changes in separate invocations, with --set-rpath first and --set-interpreter second, works.
Applying either change individually also works.
On my desktop, this affects nvidia-smi from NVIDIA driver 595.104.02 on an RTX 3080. The original, unpatched executable works, while the Nix-packaged binary segfaults, including when invoked through the Nix dynamic loader explicitly.
I also reproduced the issue on my laptop after updating to the latest available NVIDIA driver. This makes a driver-version-specific explanation less likely and points toward the ELF rewriting performed by patchelf, as you have indicated.
❯ patchelf --version
patchelf 0.19.2
DanielTallon commentedon Oct 20, 2026
I also hit this on NixOS (patchelf 0.19.2, nvidia-smi from driver 615.78.08), reported downstream in NixOS/nixpkgs#576412.
In the broken binary the new read-only LOAD segment overlaps the RW one, so
.dynamicends up mapped read-only and ld.so crashes with SEGV_ACCERR indl_main. Running--set-rpathand--interpreteras separate calls avoids it, same as described above.(Investigated with help from Claude Code.)
b1tflyyyy commentedon Oct 20, 2026
the same with nvidia-powerd service, reported here NixOS/nixpkgs#576435
TPi-Home commentedon Oct 20, 2026
I've opened Nixpkgs PR #576397 to apply this workaround.
I haven't isolated the underlying cause, but I wanted to link the reports in case this is useful for investigating the issue.
TPi-Home commentedon Oct 20, 2026
Looks like they got it fixed upstream. I tested
nvidia-smiwith both the current Nixpkgs Patchelf and a local build of the latest upstream version. The current version segfaults, but the upstream build works. Just need to wait for the fix to make it into Nixpkgs.fix(trilium): patch its bundled node with patchelf 0.15
gcc-arm-embedded-{13,14,15}: set RPATH before the interpreter
prusnak commentedon Oct 23, 2026
gcc-arm-embedded workaround merged in NixOS/nixpkgs#577189
fix(nix): patch patchelf so pm's Linux binaries survive autoPatchelf
fix(nix): patch patchelf so pm's Linux binaries survive autoPatchelf
fix(nix): patch patchelf so pm's Linux binaries survive autoPatchelf
fix(nixtop): anydesk runs again and the shell glibc check does not abort
nix: update all inputs
phoenixd: build with patchelf 0.15.2 (segfault in ld.so)
3 remaining items
fix(hermes): rebuild v0.22.5's pm pins with a fixed patchelf
fix(hermes): rebuild v0.22.5's pm pins with a fixed patchelf
fix(hermes): rebuild v0.22.5's pm pins with a fixed patchelf
hermes-agent: run Hermes Agent on nebula from a vendored sub-flake
hermes-agent: run Hermes Agent on nebula from a vendored sub-flake
Work around patchelf 0.19.2 breaking gcc-arm-embedded
Fix nixpkgs patchelf regression (0.15.2 default) via overlay + float …
hermes: hermes-agent 44ec783 for brotlicffi 1.2.1.0, pm packages buil…
hermes: hermes-agent 44ec783 for brotlicffi 1.2.1.0, pm packages buil…
hermes: hermes-agent 44ec783 for brotlicffi 1.2.1.0, pm packages buil…
hermes-agent: build pm packages with nixpkgs' patchelf while it is ol…
[ABLD-525] Point Bazel-built FIPS Go binaries to the embedded OpenSSL (…
feat(etra): hermes-agent comes from the upstream flake
fix(nix): apply the patchelf fix only to patchelf 0.19.0-0.19.2
fix(hermes-agent): carry the patchelf 0.19 version guard (#224)