Subject: bug#38055: closed (Re: none)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 11 Nov 2019 09:29:02 +0000

Your bug report

#38055: patchelf: Assertion failed when setting interpreter

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
38055: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38055
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: none
From: Efraim Flashner <[email-masked]>
To: Ludovic Courtès <[email-masked]>
Cc: [email-masked], Ivan Vilata i Balaguer <[email-masked]>
Date: Mon, 11 Nov 2019 11:27:30 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Some inline comments added. Patch pushed.

-- 
Efraim Flashner   <[email-masked]>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Subject: patchelf: Assertion failed when setting interpreter
From: Ivan Vilata i Balaguer <[email-masked]>
To: [email-masked]
Date: Sun, 3 Nov 2019 23:56:14 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi, I'm using patchelf 0.8 from Guix commit 7f81cce3 on Debian Sid.  When
trying to patch the `go` binary from
<https://dl.google.com/go/go1.12.3.linux-amd64.tar.gz>, I get the following
error:

    ivan@sax /tmp/tmps2Cv6w [env]$ patchelf --print-interpreter $SHELL
    /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib/ld-linux-x86-64.so.2
    ivan@sax /tmp/tmps2Cv6w [env]$ patchelf --set-interpreter $(patchelf --print-interpreter $SHELL) /tmp/tmps2Cv6w/golang/bin/go
    patchelf: patchelf.cc:701: void ElfFile<Elf_Ehdr, Elf_Phdr, Elf_Shdr, Elf_Addr, Elf_Off, Elf_Dyn, Elf_Sym>::rewriteSectionsExecutable() \
     [with Elf_Ehdr = Elf64_Ehdr; Elf_Phdr = Elf64_Phdr; Elf_Shdr = Elf64_Shdr; Elf_Addr = long unsigned int; Elf_Off = long unsigned int; \
     Elf_Dyn = Elf64_Dyn; Elf_Sym = Elf64_Sym]: Assertion `(off_t) rdi(hdr->e_shoff) >= startOffset' failed.
    Aborted

(I know Go is packed for Guix, my need arises from trying to build an
unrelated project which relies on binary Go for its build process.)

It may be the problem described here regarding Go-produced binaries:
<https://github.com/NixOS/patchelf/issues/66>.  It seems to be fixed in
patchelf 0.10, and indeed trying the same operation with patchelf 0.10 from
Debian does succeed to patch the binary.

As an aside, I tried to build `--with-source` for 0.10 and it succeeds to
compile, but tests fail to pass.

Thank you very much!

-- 
Ivan Vilata i Balaguer -- https://elvil.net/