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

WSL 1 - jsc in ubuntu 18.04 gives Exec format error #5875

Closed
fanoush opened this issue Sep 8, 2020 · 3 comments
Closed

WSL 1 - jsc in ubuntu 18.04 gives Exec format error #5875

fanoush opened this issue Sep 8, 2020 · 3 comments
Assignees
Labels

Comments

@fanoush
Copy link

fanoush commented Sep 8, 2020

Environment

Microsoft Windows [Version 10.0.19041.450]
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"

Steps to reproduce

$ jsc

Command 'jsc' not found, but can be installed with:

sudo apt install libjavascriptcoregtk-3.0-bin
sudo apt install libjavascriptcoregtk-4.0-bin
$ sudo apt-get install libjavascriptcoregtk-4.0-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libjavascriptcoregtk-4.0-18
The following NEW packages will be installed:
  libjavascriptcoregtk-4.0-18 libjavascriptcoregtk-4.0-bin
0 upgraded, 2 newly installed, 0 to remove and 119 not upgraded.
Need to get 5357 kB of archives.
After this operation, 22.1 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libjavascriptcoregtk-4.0-18 amd64 2.28.4-0ubuntu0.18.04.1 [5261 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libjavascriptcoregtk-4.0-bin amd64 2.28.4-0ubuntu0.18.04.1 [95.2 kB]
Fetched 5357 kB in 7s (758 kB/s)
Selecting previously unselected package libjavascriptcoregtk-4.0-18:amd64.
(Reading database ... 86258 files and directories currently installed.)
Preparing to unpack .../libjavascriptcoregtk-4.0-18_2.28.4-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libjavascriptcoregtk-4.0-18:amd64 (2.28.4-0ubuntu0.18.04.1) ...
Selecting previously unselected package libjavascriptcoregtk-4.0-bin.
Preparing to unpack .../libjavascriptcoregtk-4.0-bin_2.28.4-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libjavascriptcoregtk-4.0-bin (2.28.4-0ubuntu0.18.04.1) ...
Setting up libjavascriptcoregtk-4.0-18:amd64 (2.28.4-0ubuntu0.18.04.1) ...
Setting up libjavascriptcoregtk-4.0-bin (2.28.4-0ubuntu0.18.04.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
$ jsc
-bash: /usr/bin/jsc: cannot execute binary file: Exec format error
$ file /usr/bin/jsc
/usr/bin/jsc: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=e4f0544af27e01b9872758d67d14d5ee3fd45185, stripped
$ ldd /usr/bin/jsc
        linux-vdso.so.1 (0x00007fffecf78000)
        libjavascriptcoregtk-4.0.so.18 => /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18 (0x00007f4347f00000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4347b70000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f43477d0000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f43475b0000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f43471b0000)
        libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f4346e90000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4346c70000)
        libicui18n.so.60 => /usr/lib/x86_64-linux-gnu/libicui18n.so.60 (0x00007f43467c0000)
        libicuuc.so.60 => /usr/lib/x86_64-linux-gnu/libicuuc.so.60 (0x00007f4346400000)
        libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f4346060000)
        libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f4345e00000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4345be0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4349600000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f4345950000)
        libicudata.so.60 => /usr/lib/x86_64-linux-gnu/libicudata.so.60 (0x00007f4343da0000)
        libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f4343b90000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f4343970000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f4343740000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f4343520000)
        libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f43432b0000)
        libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f43430a0000)
        libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f4342e50000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4342c40000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f4342a30000)
$ strace jsc
execve("/usr/bin/jsc", ["jsc"], 0x7ffffd9eff40 /* 20 vars */) = -1 ENOEXEC (Exec format error)
fstat(2, {st_mode=S_IFCHR|0660, st_rdev=makedev(4, 3), ...}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "strace: exec: Exec format error\n", 32strace: exec: Exec format error
) = 32
getpid()                                = 1459
exit_group(1)                           = ?
+++ exited with 1 +++
$ objdump -x -f -h -p /usr/bin/jsc

/usr/bin/jsc:     file format elf64-x86-64
/usr/bin/jsc
architecture: i386:x86-64, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x000000000000d630

Program Header:
    PHDR off    0x0000000000000040 vaddr 0x0000000000000040 paddr 0x0000000000000040 align 2**3
         filesz 0x00000000000001f8 memsz 0x00000000000001f8 flags r--
  INTERP off    0x0000000000000238 vaddr 0x0000000000000238 paddr 0x0000000000000238 align 2**0
         filesz 0x000000000000001c memsz 0x000000000000001c flags r--
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**12
         filesz 0x0000000000038040 memsz 0x0000000000038040 flags r-x
    LOAD off    0x0000000000038860 vaddr 0x000000000003c860 paddr 0x000000000003c860 align 2**14
         filesz 0x00000000000017c0 memsz 0x000000000000f7a0 flags rw-
 DYNAMIC off    0x0000000000039440 vaddr 0x000000000003d440 paddr 0x000000000003d440 align 2**3
         filesz 0x0000000000000250 memsz 0x0000000000000250 flags rw-
    NOTE off    0x0000000000000254 vaddr 0x0000000000000254 paddr 0x0000000000000254 align 2**2
         filesz 0x0000000000000044 memsz 0x0000000000000044 flags r--
EH_FRAME off    0x0000000000037724 vaddr 0x0000000000037724 paddr 0x0000000000037724 align 2**2
         filesz 0x000000000000091c memsz 0x000000000000091c flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
   RELRO off    0x0000000000038860 vaddr 0x000000000003c860 paddr 0x000000000003c860 align 2**5
         filesz 0x00000000000017a0 memsz 0x00000000000017a0 flags rw-

Dynamic Section:
  PLTGOT               0x000000000003d6f0
  PLTRELSZ             0x0000000000001aa0
  JMPREL               0x000000000000a958
  PLTREL               0x0000000000000007
  RELA                 0x00000000000097e8
  RELASZ               0x0000000000001170
  RELAENT              0x0000000000000018
  RELACOUNT            0x0000000000000049
  DEBUG                0x0000000000000000
  SYMTAB               0x0000000000000298
  SYMENT               0x0000000000000018
  STRTAB               0x0000000000002e48
  STRSZ                0x0000000000006082
  GNU_HASH             0x0000000000008ed0
  NEEDED               libjavascriptcoregtk-4.0.so.18
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libpthread.so.0
  NEEDED               libc.so.6
  INIT                 0x000000000000c3f8
  FINI                 0x0000000000030674
  FINI_ARRAY           0x000000000003cb30
  FINI_ARRAYSZ         0x0000000000000008
  INIT_ARRAY           0x000000000003cb38
  INIT_ARRAYSZ         0x0000000000000008
  FLAGS                0x0000000000000008
  FLAGS_1              0x0000000000000001
  VERSYM               0x0000000000009380
  VERNEED              0x0000000000009724
  VERNEEDNUM           0x0000000000000004

Version References:
  required from libc.so.6:
    0x09691a75 0x00 02 GLIBC_2.2.5
    0x09691974 0x00 03 GLIBC_2.3.4
    0x06969194 0x00 04 GLIBC_2.14
    0x0d696914 0x00 05 GLIBC_2.4
  required from libm.so.6:
    0x09691a75 0x00 06 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x0297f861 0x00 07 GLIBCXX_3.4.11
    0x056bafd3 0x00 08 CXXABI_1.3
  required from libpthread.so.0:
    0x09691a75 0x00 09 GLIBC_2.2.5

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .interp       0000001c  0000000000000238  0000000000000238  00000238  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .note.ABI-tag 00000020  0000000000000254  0000000000000254  00000254  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .note.gnu.build-id 00000024  0000000000000274  0000000000000274  00000274  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .dynsym       00002bb0  0000000000000298  0000000000000298  00000298  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .dynstr       00006082  0000000000002e48  0000000000002e48  00002e48  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .gnu.hash     000004b0  0000000000008ed0  0000000000008ed0  00008ed0  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version  000003a4  0000000000009380  0000000000009380  00009380  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .gnu.version_r 000000c0  0000000000009724  0000000000009724  00009724  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rela.dyn     00001170  00000000000097e8  00000000000097e8  000097e8  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .rela.plt     00001aa0  000000000000a958  000000000000a958  0000a958  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .init         00000017  000000000000c3f8  000000000000c3f8  0000c3f8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 .plt          000011d0  000000000000c410  000000000000c410  0000c410  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 .text         00023092  000000000000d5e0  000000000000d5e0  0000d5e0  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 13 .fini         00000009  0000000000030674  0000000000030674  00030674  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 14 .rodata       00003bb8  0000000000030680  0000000000030680  00030680  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .eh_frame     000034ec  0000000000034238  0000000000034238  00034238  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 16 .eh_frame_hdr 0000091c  0000000000037724  0000000000037724  00037724  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 17 .data.rel.ro.local 000002d0  000000000003c860  000000000003c860  00038860  2**5
                  CONTENTS, ALLOC, LOAD, DATA
 18 .fini_array   00000008  000000000003cb30  000000000003cb30  00038b30  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 19 .init_array   00000008  000000000003cb38  000000000003cb38  00038b38  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 20 .data.rel.ro  00000900  000000000003cb40  000000000003cb40  00038b40  2**5
                  CONTENTS, ALLOC, LOAD, DATA
 21 .dynamic      00000250  000000000003d440  000000000003d440  00039440  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 22 .got          00000060  000000000003d690  000000000003d690  00039690  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 23 .got.plt      000008f8  000000000003d6f0  000000000003d6f0  000396f0  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 24 .data         00000019  000000000003e000  000000000003e000  0003a000  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 25 .tm_clone_table 00000000  000000000003e020  000000000003e020  0003a020  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 26 .bss          0000c000  0000000000040000  0000000000040000  0003a020  2**14
                  ALLOC
 27 .note.gnu.gold-version 0000001c  0000000000000000  0000000000000000  0003a020  2**2
                  CONTENTS, READONLY
 28 .gnu_debuglink 00000034  0000000000000000  0000000000000000  0003a03c  2**2
                  CONTENTS, READONLY
SYMBOL TABLE:
no symbols

Expected behavior

$ jsc
>>>

Actual behavior

$ jsc
-bash: /usr/bin/jsc: cannot execute binary file: Exec format error

btw seems to work fine in WSL 2

@fanoush
Copy link
Author

fanoush commented Sep 8, 2020

also

$ ls -l /usr/bin/jsc
-rwxr-xr-x 1 root root 239984 Jul 31 17:23 /usr/bin/jsc
$ LD_DEBUG=all jsc
-bash: /usr/bin/jsc: cannot execute binary file: Exec format error

however this works!

$ /lib64/ld-linux-x86-64.so.2 /usr/bin/jsc
>>>

@benhillis benhillis self-assigned this Sep 9, 2020
@benhillis
Copy link
Member

Thanks for posting, I will take a look at this.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants