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

Regular Linux binary doesn't run? #2188

Closed
timcanham opened this issue Jun 4, 2017 · 6 comments
Closed

Regular Linux binary doesn't run? #2188

timcanham opened this issue Jun 4, 2017 · 6 comments

Comments

@timcanham
Copy link

timcanham commented Jun 4, 2017

  • Your Windows build number: Microsoft Windows [Version 10.0.15063]

  • WSL: Linux TIM-ACER-LAPTOP 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

  • What you're doing and what's happening: I am trying to run this installer:

http://software-dl.ti.com/ccs/esd/CCSv7/CCS_7_1_0/exports/CCS7.1.0.00016_linux-x64.tar.gz

  • What's wrong / what should be happening instead: I was hoping the binary would run and install the tool. Instead I get this error:
[8] ./ccs_setup_linux64_7.1.0.00016.bin
./ccs_setup_linux64_7.1.0.00016.bin: Exec format error. Binary file not executable.
  • Strace of the failing command, if applicable: (If <cmd> is failing, then run strace -o strace.txt -ff <cmd>, and post the strace.txt output here)
[13] strace -o strace.txt -ff ./ccs_setup_linux64_7.1.0.00016.bin
strace: exec: Exec format error

I'm wondering if I'm missing something basic about compatibility with regular Ubuntu.

@sunjoong
Copy link

sunjoong commented Jun 4, 2017

@timcanham - It looks like to duplicate of #330 because...

sunjoong@SUNJOONG-DESKTOP ~/temp/CCS7.1.0.00016_linux-x64 $ objdump -x -p ccs_setup_linux64_7.1.0.00016.bin

ccs_setup_linux64_7.1.0.00016.bin:     file format elf64-x86-64
ccs_setup_linux64_7.1.0.00016.bin
architecture: i386:x86-64, flags 0x00000102:
EXEC_P, D_PAGED
start address 0x0000000000470878

Program Header:
    LOAD off    0x0000000000000000 vaddr 0x0000000000300000 paddr 0x0000000000300000 align 2**20
         filesz 0x00000000001719d6 memsz 0x00000000001719d6 flags r-x
    LOAD off    0x00000000001503d0 vaddr 0x00000000006503d0 paddr 0x00000000006503d0 align 2**20
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
0x65041580 off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**2
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags --- aa80

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
SYMBOL TABLE:
no symbols


sunjoong@SUNJOONG-DESKTOP ~/temp/CCS7.1.0.00016_linux-x64 $

It's not a regular file but a UPX compressed file. You could decompress with upx -d command after install it like #2121 (comment).

@timcanham
Copy link
Author

This is what I get:

[20] upx -d ccs_setup_linux64_7.1.0.00016.bin
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2013
UPX 3.91        Markus Oberhumer, Laszlo Molnar & John Reiser   Sep 30th 2013

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
upx: ccs_setup_linux64_7.1.0.00016.bin: NotPackedException: not packed by UPX

Unpacked 0 files.

@sunjoong
Copy link

sunjoong commented Jun 4, 2017

@timcanham - Yes, I could not unpack it either. But it looks like a UPX paced file;

root@SUNJOONG-DESKTOP:~/CCS7.1.0.00016_linux-x64# hexdump -C ccs_setup_linux64_7.1.0.00016.bin | grep -C 1 UPX
001000a0  00 00 00 00 00 00 00 00  00 00 10 00 00 00 00 00  |................|
001000b0  d2 86 5b 0b 55 50 58 21  6c 11 0d 16 00 00 00 00  |..[.UPX!l.......|
001000c0  a8 20 14 00 a8 20 14 00  00 02 00 00 97 00 00 00  |. ... ..........|
--
00171340  69 73 20 66 69 6c 65 20  69 73 20 70 61 63 6b 65  |is file is packe|
00171350  64 20 77 69 74 68 20 74  68 65 20 55 50 58 20 65  |d with the UPX e|
00171360  78 65 63 75 74 61 62 6c  65 20 70 61 63 6b 65 72  |xecutable packer|
00171370  20 68 74 74 70 3a 2f 2f  75 70 78 2e 73 66 2e 6e  | http://upx.sf.n|
00171380  65 74 20 24 0a 00 24 49  64 3a 20 55 50 58 20 33  |et $..$Id: UPX 3|
00171390  2e 39 31 20 43 6f 70 79  72 69 67 68 74 20 28 43  |.91 Copyright (C|
001713a0  29 20 31 39 39 36 2d 32  30 31 33 20 74 68 65 20  |) 1996-2013 the |
001713b0  55 50 58 20 54 65 61 6d  2e 20 41 6c 6c 20 52 69  |UPX Team. All Ri|
001713c0  67 68 74 73 20 52 65 73  65 72 76 65 64 2e 20 24  |ghts Reserved. $|
--
00171c50  40 6a 20 22 24 78 54 d8  25 e4 9f 4b 20 cb 02 fa  |@j "$xT.%..K ...|
00171c60  1e 00 00 00 00 00 55 50  58 21 00 00 00 00 00 00  |......UPX!......|
00171c70  55 50 58 21 0d 16 0e 0a  4c cb d1 da 81 d9 fa a6  |UPX!....L.......|
00171c80  08 2f 00 00 69 02 00 00  a8 20 14 00 49 15 00 f6  |./..i.... ..I...|
root@SUNJOONG-DESKTOP:~/CCS7.1.0.00016_linux-x64#

There is a "packed with the UPX executable packer" text in hexdump but...

root@SUNJOONG-DESKTOP:~/CCS7.1.0.00016_linux-x64# upx --file-info ccs_setup_linux64_7.1.0.00016.bin
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2013
UPX 3.91        Markus Oberhumer, Laszlo Molnar & John Reiser   Sep 30th 2013

ccs_setup_linux64_7.1.0.00016.bin [amd64-linux.elf, linux/ElfAMD]
  11466699 bytes, not compressed by UPX
root@SUNJOONG-DESKTOP:~/CCS7.1.0.00016_linux-x64#

Why does this happen? I don't know yet :(. Sorry.

I think you could consult "packed with the UPX executable packer" text in hexdump but "not compressed by UPX" output in upx file info with https://github.com/upx/upx/issues .

Or...

You could run ccs_setup_linux64_7.1.0.00016.bin on real linux system, not on WSL, and then compress it again with tar on real linux system and decompress that with tar in WSL. I mean... follow number 1 and 2 of README_FIRST.txt file on real linux system and then number 4 and 5 on WSL.

@timcanham
Copy link
Author

I actually tried installing the app on a regular Linux box. I tarred it up and copied it over, and I got similar errors. Very weird. I'm actually most interested in running the compilers it installs rather than the GUI itself.

@sunjoong
Copy link

sunjoong commented Jun 5, 2017

I got similar errors.

@timcanham - I guess you might see it with ccs_update_7.1.0.00016_linux64.bin; You look like to meet ccs_update_7.1.0.00016_linux64.bin after avoiding ccs_setup_linux64_7.1.0.00016.bin. It looks like ccs_setup_linux64_7.1.0.00016.bin is so-called self-extractable compressed file and that might extract files including /ccsv7/install_scripts/install_drivers.sh, and install_drivers.sh might execute ccs_update_7.1.0.00016_linux64.bin but ccs_update_7.1.0.00016_linux64.bin is also an upx compressed file.

Hmm... WSL does not support upx compressed file yet. I can't imagine other workaround except modifying install_scripts after fully understanding it.

@benhillis
Copy link
Member

I've verified that this binary is running with the fix for #330, marking as a duplicate.

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

No branches or pull requests

3 participants