Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installed binaries of lean-4.14.0-linux do not work #6392

Closed
2 of 3 tasks
divyaranjan1905 opened this issue Dec 15, 2024 · 16 comments
Closed
2 of 3 tasks

Installed binaries of lean-4.14.0-linux do not work #6392

divyaranjan1905 opened this issue Dec 15, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@divyaranjan1905
Copy link

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

Downloading the latest 4.14 release, unzipping and executing the binaries does not work as expected.

Steps to Reproduce

  1. Download the latest release for Linux
  2. Unzip, and go to bin directory.
  3. Do ./lean, and you'll get: zsh: no such file or directory: ./lean

Expected behavior: Lean should run and show the version of 4.14

Actual behavior: The binary does not run and isn't detected.

Versions

Lean 4.1.4.0
Target: x86_64-unknown-linux-gnu

Additional Information

Here's what I went through in my terminal:

[divya@lambda Downloads]$ cd lean-4.14.0-linux
[divya@lambda lean-4.14.0-linux]$ ls
bin  include  lib  LICENSE  LICENSES  share  src
[divya@lambda lean-4.14.0-linux]$ cd bin
[divya@lambda bin]$ ls
cadical  clang  lake  ld.lld  lean  leanc  leanmake  llvm-ar
[divya@lambda bin]$ ./lean
zsh: no such file or directory: ./lean
[divya@lambda bin]$ ./lean --version
zsh: no such file or directory: ./lean
[divya@lambda bin]$ ls -a -l
total 6024
drwxr-xr-x 1 divya users      92 Dec  1 22:55 .
drwxr-xr-x 1 divya users      72 Dec  1 22:55 ..
-rwxr-xr-x 1 divya users 1287328 Jan  1  1970 cadical
-rwxr-xr-x 1 divya users  125968 Dec  1 22:44 clang
-rwxr-xr-x 1 divya users    9232 Dec  1 22:55 lake
-rwxr-xr-x 1 divya users 4604904 Dec  1 22:44 ld.lld
-rwxr-xr-x 1 divya users    6288 Dec  1 22:54 lean
-rwxr-xr-x 1 divya users   33576 Dec  1 22:54 leanc
-rwxr-xr-x 1 divya users     839 Dec  1 22:43 leanmake
-rwxr-xr-x 1 divya users   80824 Dec  1 22:44 llvm-ar
@divyaranjan1905 divyaranjan1905 added the bug Something isn't working label Dec 15, 2024
@divyaranjan1905
Copy link
Author

divyaranjan1905 commented Dec 15, 2024

I am on GNU/Guix, if that matters, running upstream Linux of 6.11.10

@hargoniX
Copy link
Contributor

The binaries do work on hundreds of Linux machines so the Guix part is likely the culprit here.

What does ldd on the binary give you and do you have the shared objects that it asks you for installed.

@divyaranjan1905
Copy link
Author

divyaranjan1905 commented Dec 17, 2024

The binaries do work on hundreds of Linux machines so the Guix part is likely the culprit here.

Maybe, but Guix is just another GNU/Linux distribution, so what could be the culprit?

What does ldd on the binary give you and do you have the shared objects that it asks you for installed.

[divya@lambda bin]$ ldd lean
	linux-vdso.so.1 (0x00007f4bd50dc000)
	libInit_shared.so => /home/divya/Downloads/lean-4.14.0-linux/bin/./../lib/lean/libInit_shared.so (0x00007f4bd50ce000)
	libleanshared_1.so => /home/divya/Downloads/lean-4.14.0-linux/bin/./../lib/lean/libleanshared_1.so (0x00007f4bd50ca000)
	libleanshared.so => /home/divya/Downloads/lean-4.14.0-linux/bin/./../lib/lean/libleanshared.so (0x00007f4bcfe00000)
	libpthread.so.0 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libpthread.so.0 (0x00007f4bd50c5000)
	libdl.so.2 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libdl.so.2 (0x00007f4bd50c0000)
	libm.so.6 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libm.so.6 (0x00007f4bcfd20000)
	libc.so.6 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libc.so.6 (0x00007f4bcfb42000)
	librt.so.1 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/librt.so.1 (0x00007f4bd50b9000)
	/lib64/ld-linux-x86-64.so.2 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/ld-linux-x86-64.so.2 (0x00007f4bd50de000)

@hargoniX
Copy link
Contributor

hargoniX commented Dec 17, 2024

Okay that looks acceptable, can you run:

strace -e trace=file -o strace.log /path/to/lean

and show us the output of strace.log? I would expect that some file related system call is going to give us an error here.

As to what the culprit could be, this error does not mean that "the binary isn't detected", it usually means that something in the early initialization of the process is going wrong. The most likely reason here is that it is looking for some shared object and not finding it. The reason that this might be is that of course Guix has a non standard layout for everything so while it might have the specific file that the binary is looking for somewhere, it might not have it in the right location.

@divyaranjan1905
Copy link
Author

This is the output in strace.log:

execve("/home/divya/Downloads/lean-4.14.0-linux/bin/lean", ["/home/divya/Downloads/lean-4.14."...], 0x7ffe93a0af90 /* 93 vars */) = -1 ENOENT (No such file or directory)
+++ exited with 1 +++

@hargoniX
Copy link
Contributor

Okay so it fails even before starting to play with shared objects, execve returns ENOENT when the file actually doesn't exist (which is not the case here) or when it doesn't find the ELF interpreter. What does readelf -a /path/to/lean give us? There should be a line with [Requesting program interpreter: .... in the output.

@divyaranjan1905
Copy link
Author

divyaranjan1905 commented Dec 17, 2024

Here's the entire output, and indeed it does have a request for the interpreter:

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Position-Independent Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x1760
  Start of program headers:          64 (bytes into file)
  Start of section headers:          4496 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         11
  Size of section headers:           64 (bytes)
  Number of section headers:         28
  Section header string table index: 26

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .interp           PROGBITS         00000000000002a8  000002a8
       000000000000001c  0000000000000000   A       0     0     1
  [ 2] .note.ABI-tag     NOTE             00000000000002c4  000002c4
       0000000000000020  0000000000000000   A       0     0     4
  [ 3] .dynsym           DYNSYM           00000000000002e8  000002e8
       0000000000000108  0000000000000018   A       7     1     8
  [ 4] .gnu.version      VERSYM           00000000000003f0  000003f0
       0000000000000016  0000000000000002   A       3     0     2
  [ 5] .gnu.version_r    VERNEED          0000000000000408  00000408
       0000000000000020  0000000000000000   A       7     1     4
  [ 6] .gnu.hash         GNU_HASH         0000000000000428  00000428
       000000000000002c  0000000000000000   A       3     0     8
  [ 7] .dynstr           STRTAB           0000000000000454  00000454
       000000000000012b  0000000000000000   A       0     0     1
  [ 8] .rela.dyn         RELA             0000000000000580  00000580
       00000000000000c0  0000000000000018   A       3     0     8
  [ 9] .rela.plt         RELA             0000000000000640  00000640
       0000000000000060  0000000000000018  AI       3    22     8
  [10] .rodata           PROGBITS         00000000000006a0  000006a0
       0000000000000004  0000000000000004  AM       0     0     4
  [11] .eh_frame_hdr     PROGBITS         00000000000006a4  000006a4
       000000000000002c  0000000000000000   A       0     0     4
  [12] .eh_frame         PROGBITS         00000000000006d0  000006d0
       000000000000008c  0000000000000000   A       0     0     8
  [13] .text             PROGBITS         0000000000001760  00000760
       00000000000000f8  0000000000000000  AX       0     0     16
  [14] .init             PROGBITS         0000000000001858  00000858
       000000000000001b  0000000000000000  AX       0     0     4
  [15] .fini             PROGBITS         0000000000001874  00000874
       000000000000000d  0000000000000000  AX       0     0     4
  [16] .plt              PROGBITS         0000000000001890  00000890
       0000000000000050  0000000000000000  AX       0     0     16
  [17] .init_array       INIT_ARRAY       00000000000028e0  000008e0
       0000000000000008  0000000000000000  WA       0     0     8
  [18] .fini_array       FINI_ARRAY       00000000000028e8  000008e8
       0000000000000008  0000000000000000  WA       0     0     8
  [19] .dynamic          DYNAMIC          00000000000028f0  000008f0
       0000000000000210  0000000000000010  WA       7     0     8
  [20] .got              PROGBITS         0000000000002b00  00000b00
       0000000000000028  0000000000000000  WA       0     0     8
  [21] .data             PROGBITS         0000000000003b28  00000b28
       0000000000000010  0000000000000000  WA       0     0     8
  [22] .got.plt          PROGBITS         0000000000003b38  00000b38
       0000000000000038  0000000000000000  WA       0     0     8
  [23] .bss              NOBITS           0000000000003b70  00000b70
       0000000000000049  0000000000000000  WA       0     0     8
  [24] .comment          PROGBITS         0000000000000000  00000b70
       00000000000000cc  0000000000000001  MS       0     0     1
  [25] .symtab           SYMTAB           0000000000000000  00000c40
       00000000000002d0  0000000000000018          27    20     8
  [26] .shstrtab         STRTAB           0000000000000000  00000f10
       00000000000000f5  0000000000000000           0     0     1
  [27] .strtab           STRTAB           0000000000000000  00001005
       0000000000000186  0000000000000000           0     0     1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  D (mbind), l (large), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000000040 0x0000000000000040
                 0x0000000000000268 0x0000000000000268  R      0x8
  INTERP         0x00000000000002a8 0x00000000000002a8 0x00000000000002a8
                 0x000000000000001c 0x000000000000001c  R      0x1
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x000000000000075c 0x000000000000075c  R      0x1000
  LOAD           0x0000000000000760 0x0000000000001760 0x0000000000001760
                 0x0000000000000180 0x0000000000000180  R E    0x1000
  LOAD           0x00000000000008e0 0x00000000000028e0 0x00000000000028e0
                 0x0000000000000248 0x0000000000000248  RW     0x1000
  LOAD           0x0000000000000b28 0x0000000000003b28 0x0000000000003b28
                 0x0000000000000048 0x0000000000000091  RW     0x1000
  DYNAMIC        0x00000000000008f0 0x00000000000028f0 0x00000000000028f0
                 0x0000000000000210 0x0000000000000210  RW     0x8
  GNU_RELRO      0x00000000000008e0 0x00000000000028e0 0x00000000000028e0
                 0x0000000000000248 0x0000000000000720  R      0x1
  GNU_EH_FRAME   0x00000000000006a4 0x00000000000006a4 0x00000000000006a4
                 0x000000000000002c 0x000000000000002c  R      0x4
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     0x0
  NOTE           0x00000000000002c4 0x00000000000002c4 0x00000000000002c4
                 0x0000000000000020 0x0000000000000020  R      0x4

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .interp 
   02     .interp .note.ABI-tag .dynsym .gnu.version .gnu.version_r .gnu.hash .dynstr .rela.dyn .rela.plt .rodata .eh_frame_hdr .eh_frame 
   03     .text .init .fini .plt 
   04     .init_array .fini_array .dynamic .got 
   05     .data .got.plt .bss 
   06     .dynamic 
   07     .init_array .fini_array .dynamic .got 
   08     .eh_frame_hdr 
   09     
   10     .note.ABI-tag 

Dynamic section at offset 0x8f0 contains 33 entries:
  Tag        Type                         Name/Value
 0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:$ORIGIN/../lib/lean]
 0x0000000000000001 (NEEDED)             Shared library: [libInit_shared.so]
 0x0000000000000001 (NEEDED)             Shared library: [libleanshared_1.so]
 0x0000000000000001 (NEEDED)             Shared library: [libleanshared.so]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000006ffffffb (FLAGS_1)            Flags: PIE
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000007 (RELA)               0x580
 0x0000000000000008 (RELASZ)             192 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffff9 (RELACOUNT)          3
 0x0000000000000017 (JMPREL)             0x640
 0x0000000000000002 (PLTRELSZ)           96 (bytes)
 0x0000000000000003 (PLTGOT)             0x3b38
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000006 (SYMTAB)             0x2e8
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000005 (STRTAB)             0x454
 0x000000000000000a (STRSZ)              299 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x428
 0x0000000000000019 (INIT_ARRAY)         0x28e0
 0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x28e8
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000000000000c (INIT)               0x1858
 0x000000000000000d (FINI)               0x1874
 0x000000006ffffff0 (VERSYM)             0x3f0
 0x000000006ffffffe (VERNEED)            0x408
 0x000000006fffffff (VERNEEDNUM)         1
 0x0000000000000000 (NULL)               0x0

Relocation section '.rela.dyn' at offset 0x580 contains 8 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
0000000028e0  000000000008 R_X86_64_RELATIVE                    1790
0000000028e8  000000000008 R_X86_64_RELATIVE                    17e0
000000003b30  000000000008 R_X86_64_RELATIVE                    3b30
000000002b00  000100000006 R_X86_64_GLOB_DAT 0000000000000000 __libc_start_main@GLIBC_2.2.5 + 0
000000002b08  000200000006 R_X86_64_GLOB_DAT 0000000000000000 __gmon_start__ + 0
000000002b10  000300000006 R_X86_64_GLOB_DAT 0000000000000000 __register_frame_info + 0
000000002b18  000400000006 R_X86_64_GLOB_DAT 0000000000000000 __cxa_finalize@GLIBC_2.2.5 + 0
000000002b20  000500000006 R_X86_64_GLOB_DAT 0000000000000000 __deregister_fram[...] + 0

Relocation section '.rela.plt' at offset 0x640 contains 4 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000003b50  000300000007 R_X86_64_JUMP_SLO 0000000000000000 __register_frame_info + 0
000000003b58  000400000007 R_X86_64_JUMP_SLO 0000000000000000 __cxa_finalize@GLIBC_2.2.5 + 0
000000003b60  000500000007 R_X86_64_JUMP_SLO 0000000000000000 __deregister_fram[...] + 0
000000003b68  000600000007 R_X86_64_JUMP_SLO 0000000000000000 lean_main + 0
No processor specific unwind information to decode

Symbol table '.dynsym' contains 11 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND [...]@GLIBC_2.2.5 (2)
     2: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__
     3: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __register_frame_info
     4: 0000000000000000     0 FUNC    WEAK   DEFAULT  UND [...]@GLIBC_2.2.5 (2)
     5: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __deregister_fra[...]
     6: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND lean_main
     7: 0000000000001760    38 FUNC    GLOBAL DEFAULT   13 _start
     8: 0000000000003b28     0 NOTYPE  WEAK   DEFAULT   21 data_start
     9: 00000000000006a0     4 OBJECT  GLOBAL DEFAULT   10 _IO_stdin_used
    10: 0000000000003b28     0 NOTYPE  GLOBAL DEFAULT   21 __data_start

Symbol table '.symtab' contains 30 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000000002c4    32 OBJECT  LOCAL  DEFAULT    2 __abi_tag
     2: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtbegin.c
     3: 0000000000001790    71 FUNC    LOCAL  DEFAULT   13 __do_init
     4: 0000000000003b70     1 OBJECT  LOCAL  DEFAULT   23 __do_init.__init[...]
     5: 00000000000006d0     0 OBJECT  LOCAL  DEFAULT   12 __EH_FRAME_LIST__
     6: 0000000000003b78    64 OBJECT  LOCAL  DEFAULT   23 __do_init.__object
     7: 00000000000017e0    97 FUNC    LOCAL  DEFAULT   13 __do_fini
     8: 0000000000003bb8     1 OBJECT  LOCAL  DEFAULT   23 __do_fini.__finalized
     9: 00000000000028e0     8 OBJECT  LOCAL  DEFAULT   17 __init
    10: 00000000000028e8     8 OBJECT  LOCAL  DEFAULT   18 __fini
    11: 0000000000003b30     8 OBJECT  LOCAL  HIDDEN    21 __dso_handle
    12: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS lean.cpp
    13: 0000000000001850     5 FUNC    LOCAL  HIDDEN    13 main
    14: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtend.c
    15: 00000000000006d0     4 OBJECT  LOCAL  HIDDEN    12 __EH_FRAME_LIST_END__
    16: 0000000000003b38     0 NOTYPE  LOCAL  HIDDEN    22 _GLOBAL_OFFSET_TABLE_
    17: 00000000000028f0     0 NOTYPE  LOCAL  HIDDEN    19 _DYNAMIC
    18: 0000000000001858     0 FUNC    LOCAL  HIDDEN    14 _init
    19: 0000000000001874     0 FUNC    LOCAL  HIDDEN    15 _fini
    20: 0000000000001760    38 FUNC    GLOBAL DEFAULT   13 _start
    21: 0000000000003b28     0 NOTYPE  WEAK   DEFAULT   21 data_start
    22: 00000000000006a0     4 OBJECT  GLOBAL DEFAULT   10 _IO_stdin_used
    23: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __libc_start_main
    24: 0000000000003b28     0 NOTYPE  GLOBAL DEFAULT   21 __data_start
    25: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__
    26: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __register_frame_info
    27: 0000000000000000     0 FUNC    WEAK   DEFAULT  UND __cxa_finalize
    28: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __deregister_fra[...]
    29: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND lean_main

Histogram for `.gnu.hash' bucket list length (total of 1 bucket):
 Length  Number     % of total  Coverage
      0  0          (  0.0%)
      1  0          (  0.0%)      0.0%
      2  0          (  0.0%)      0.0%
      3  0          (  0.0%)      0.0%
      4  1          (100.0%)    100.0%

Version symbols section '.gnu.version' contains 11 entries:
 Addr: 0x00000000000003f0  Offset: 0x000003f0  Link: 3 (.dynsym)
  000:   0 (*local*)       2 (GLIBC_2.2.5)   1 (*global*)      1 (*global*)   
  004:   2 (GLIBC_2.2.5)   1 (*global*)      1 (*global*)      1 (*global*)   
  008:   1 (*global*)      1 (*global*)      1 (*global*)   

Version needs section '.gnu.version_r' contains 1 entry:
 Addr: 0x0000000000000408  Offset: 0x00000408  Link: 7 (.dynstr)
  000000: Version: 1  File: libc.so.6  Cnt: 1
  0x0010:   Name: GLIBC_2.2.5  Flags: none  Version: 2

Displaying notes found in: .note.ABI-tag
  Owner                Data size 	Description
  GNU                  0x00000010	NT_GNU_ABI_TAG (ABI version tag)
    OS: Linux, ABI: 3.2.0

@hargoniX
Copy link
Contributor

I'm gonna go ahead and guess that /lib64/ld-linux-x86-64.so.2 does not exist on Guix? If so that is the issue here.

@divyaranjan1905
Copy link
Author

It does though, as ldd lean shows:

[divya@lambda]:~/Downloads/lean-4.14.0-linux/bin
$ ldd lean
	linux-vdso.so.1 (0x00007fa5e2076000)
	libInit_shared.so => /home/divya/Downloads/lean-4.14.0-linux/bin/./../lib/lean/libInit_shared.so (0x00007fa5e2068000)
	libleanshared_1.so => /home/divya/Downloads/lean-4.14.0-linux/bin/./../lib/lean/libleanshared_1.so (0x00007fa5e2064000)
	libleanshared.so => /home/divya/Downloads/lean-4.14.0-linux/bin/./../lib/lean/libleanshared.so (0x00007fa5dce00000)
	libpthread.so.0 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libpthread.so.0 (0x00007fa5e205f000)
	libdl.so.2 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libdl.so.2 (0x00007fa5e205a000)
	libm.so.6 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libm.so.6 (0x00007fa5dcd20000)
	libc.so.6 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libc.so.6 (0x00007fa5dcb42000)
	librt.so.1 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/librt.so.1 (0x00007fa5e2053000)
	/lib64/ld-linux-x86-64.so.2 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/ld-linux-x86-64.so.2 (0x00007fa5e2078000)
[divya@lambda]:~/Downloads/lean-4.14.0-linux/bin
$ ls /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/
audit	  ld-linux-x86-64.so.2	libc_malloc_debug.so.0	libm.so		    libnss_db.so	libpthread.a	 libthread_db.so.1
crt1.o	  libanl.a		libc_nonshared.a	libm.so.6	    libnss_db.so.2	libpthread.so.0  libutil.a
crti.o	  libanl.so		libc.so			libmvec.so	    libnss_dns.so.2	libresolv.so	 libutil.so.1
crtn.o	  libanl.so.1		libc.so.6		libmvec.so.1	    libnss_files.so.2	libresolv.so.2	 locale
gconv	  libBrokenLocale.so	libdl.a			libnsl.so.1	    libnss_hesiod.so	librt.a		 Mcrt1.o
gcrt1.o   libBrokenLocale.so.1	libdl.so.2		libnss_compat.so    libnss_hesiod.so.2	librt.so.1	 rcrt1.o
grcrt1.o  libc_malloc_debug.so	libmemusage.so		libnss_compat.so.2  libpcprofile.so	libthread_db.so  Scrt1.o

@hargoniX
Copy link
Contributor

Right, then something with my understanding of how the system works here is wrong. The execve manpage clearly states that ENOENT happens iff:

       ENOENT The file pathname or a script or ELF interpreter does not exist.

so unless there is another condition present which is not documented in the manpage the ELF interpreter must be at fault here.

One thing we could try to be sure that it is not Guix messing up the elf interpreter is to run

patchelf --set-interpreter /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/ld-linux-x86-64.so.2 /path/to/lean

and observing whether this still errors and in particular if it does still error, observe in strace whether it still errors in execve. If it does I have no idea what to do anymore.

@divyaranjan1905
Copy link
Author

Oh, @hargoniX the patchelf command somehow worked. ./lean --version now works as expected. What exactly is going on here?

@nomeata
Copy link
Collaborator

nomeata commented Dec 17, 2024

It sounds to me that debugging this requires guix specific knowledge. @divyaranjan1905 have you already tried getting help on guix channels? I would assume it's a common problem when running non-guix specific binaries on guix.

@divyaranjan1905
Copy link
Author

@nomeata Hello, I can surely do. I do have knowledge of how Guix works, I am just unsure as to what exactly the binary might be looking for. Is it that the binary can't set /lib64/ld-linux-x86-64.so.2 as the ELF interpreter?

@divyaranjan1905
Copy link
Author

Patching the binaries with patchelf resolves the issue and has it working as usual. The binaries aren't built for Guix thus they can't find the ELF interpreter in the right path. Closing.

@nomeata
Copy link
Collaborator

nomeata commented Dec 17, 2024

The nix guys have a patched elan that patches the downloaded lean binaries as they are unpacked. Maybe guix needs something similar?

@divyaranjan1905
Copy link
Author

The nix guys have a patched elan that patches the downloaded lean binaries as they are unpacked. Maybe guix needs something similar?

The problem is, Guix doesn't encourage packaging anything that's based on pre-built binaries. It can be done, but probably not in the official repository. I might make a separate channel for this, thanks for the debugging anyways. It was helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants