← Back to issue list

patchelf creates unloadable non-PIE riscv64 executables

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1943963
Type
issue
State
closed
Author
~xnox
Labels
riscv64
Created
Updated
Closed

Current evaluation

Riscv64 patchelf corruption was fixed by using the safe ET_DYN rewrite path for non-PIE executables, merged in snapcraft PR #3588 (commit d6a8ffe9a).

Resolution: closed resolved

Reason: Commit d6a8ffe9a, merged through PR #3588, adds riscv64-specific patchelf patches that prevent ELF headers from being shifted below the allowed load address.

Evaluated by: mr-cal-bot

No scores available.

Issue body

$ snap run --shell snapcraft $ cd /snap/snapcraft/current $ strace -f -s9999 ./usr/bin/python3.8 execve("./usr/bin/python3.8", ["./usr/bin/python3.8"], 0x3ffffa00b0 /* 52 vars */) = -1 EPERM (Operation not permitted) +++ killed by SIGSEGV +++ Segmentation fault (core dumped) I don't know why executing python3.8 from inside snapcraft snap is denied with EPERM. Is seccomp somehow broken?

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Riscv64 patchelf corruption was fixed by using the safe ET_DYN rewrite path for non-PIE executables, merged in snapcraft PR #3588 (commit d6a8ffe9a).
stealth/space-bunny-alpha — closed resolved Fixed by adding a riscv64 PatchELF patch in canonical/snapcraft#3588 (commit d6a8ffe9a, merged as bf99dbdb2), preventing non-PIE ELF headers from being shifted below mmap_min_addr.
stealth/space-bunny-alpha — closed resolved Non-PIE riscv64 binaries no longer load below mmap_min_addr; Snapcraft integrated the PatchELF fix in canonical/snapcraft#3588 (d6a8ffe9a).
stealth/space-bunny-alpha — closed resolved Resolved by Snapcraft#3588 (commit d6a8ffe9a, merged as bf99dbdb2), which patched Patchelf’s riscv64 load-address handling behind the unloadable non-PIE executables.
stealth/space-bunny-alpha — closed stale Closed without a documented fix; no PR, commit, or maintainer explanation is linked. Potential riscv64 patchelf commits were found, but none is confirmed to resolve this report.
stealth/space-bunny-alpha — closed stale The riscv64 non-PIE python3.8 loading failure was closed without a documented fix, comment, or linked change; the report appears stale.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments, likely abandoned. The report describes a segfault running python3.8 in a riscv64 snapcraft snap, potentially caused by patchelf or seccomp.
qwen/qwen3.6-35b-a3b — — Abandoned without resolution. The report details a snapcraft python3.8 execution failure on riscv64, potentially involving patchelf or seccomp, but received no comments and was closed.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments. The report describes patchelf generating non-PIE riscv64 binaries that fail to load due to EPERM and SIGSEGV.
qwen3.6-35b-a3b-mtp-q6 — — Closed without comments or resolution. The report describes a seccomp EPERM error running python3.8 via snapcraft on riscv64. No fix was provided, indicating the issue was abandoned.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#3588 (confidence 99%)

    Merged the patchelf changes that route non-PIE executables through the safe library rewrite path on riscv64.

Related issues

Issue Project State Summary Similarity
#3588 snap: patch patchelf on riscv64 (CRAFT-566) snapcraft merged Merged PR #3588 via commit bf99dbdb2, conditionally patching PatchELF on riscv64 while leaving other architectures unchanged.
75%
#1669 patchelf with ld-linux from the future snapcraft closed Resolved by commit bdaf0b7f1, which added Snapcraft handling for PatchELF and ELF files when the built glibc/linker does not match the base.
71%
#1873 elf: cleaner patchelf experience snapcraft merged Merged as df6992224: Snapcraft now prefers system Patchelf outside snaps and copies target files to avoid hard-link patching conflicts.
70%