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

upx 3.96 mips: static binary not properly executed (runs forever) #387

Closed
develBuzz opened this issue Jul 16, 2020 · 2 comments
Closed

upx 3.96 mips: static binary not properly executed (runs forever) #387

develBuzz opened this issue Jul 16, 2020 · 2 comments

Comments

@develBuzz
Copy link

develBuzz commented Jul 16, 2020

Upload of files not working:
https://drive.google.com/file/d/1izEeUYWLczkspAD4XysVoAV8O_6N4TKN/view?usp=sharing

What's the problem (or question)?

I'm using upx on debian 10.4 (amd64) to compress a binary for openwrt on a WNDR3700v4 (mips 32-bit).
Afer copying the file to my router, the binary compressed with upx-3.96 isn't executed properly. it runs forever and eating nearly all of my CPU-time.
If i'm compressing the same file with upx-3.95 it runs fine and the proccess will finish within a second.

Tested this with different versions of the binary and it's always the same result.

Here is some kind of log for my testings:

With upx 3.95 (after copying the file to the router)

  1. ls -al
    -rwxr-xr-x 1 root root 2.3M Jul 16 09:41 dnscrypt-proxy-upx-3.95

  2. file dnscrypt-proxy-upx-3.95
    dnscrypt-proxy-upx-3.95: ELF 32-bit MSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, no section header

  3. ./dnscrypt-proxy-upx-3.95 -config /etc/config/dnscrypt-proxy.toml -check
    [2020-07-16 07:45:23] [NOTICE] dnscrypt-proxy 2.0.44
    [2020-07-16 07:45:23] [NOTICE] Source [public-resolvers] loaded
    [2020-07-16 07:45:23] [NOTICE] Source [relays] loaded
    [2020-07-16 07:45:23] [NOTICE] Configuration successfully checked

With upx 3.96 (after copying the file to the router)

  1. ls -al
    -rwxr-xr-x 1 root root 2.3M Jul 16 09:41 dnscrypt-proxy-upx-3.96 (same timestamp due to copy)

  2. file dnscrypt-proxy-upx-3.96
    dnscrypt-proxy-upx-3.96: ELF 32-bit MSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, no section header

  3. ./dnscrypt-proxy-upx-3.96 -config /etc/config/dnscrypt-proxy.toml -check

    after some time htop shows:
    pid:2657 user:root pri:20 ni:0 virt:12280 res:5960 shr:988 cpu:96,2 mem:4,8 time+:3:46.85
    command ./dnscrypt-proxy-upx-3.96 -config /etc/config/dnscrypt-proxy.toml -check

What should have happened?

The same as with upx 3.95, programm should finish within a short time frame.

Do you have an idea for a solution?

No.

How can we reproduce the issue?

It might be enough to have a device with mips 32-bit support.

  1. upx-3.96 --lzma dnscrypt-proxy-upx-3.96
  2. copy file to target system
  3. run ./dnscrypt-proxy-upx-3.96 -config /etc/config/dnscrypt-proxy.toml -check

Please tell us details about your environment.

upx-3.95 --version
upx 3.95
NRV data compression library 0.84
UCL data compression library 1.03
zlib data compression library 1.2.3
LZMA SDK version 4.43
Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2018 John F. Reiser
Copyright (C) 2002-2018 Jens Medoch
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
Copyright (C) 1999-2006 Igor Pavlov
UPX comes with ABSOLUTELY NO WARRANTY; for details type 'upx-3.95 -L'.

upx-3.96 --version
upx 3.96
NRV data compression library 0.84
UCL data compression library 1.03
zlib data compression library 1.2.3
LZMA SDK version 4.43
Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2020 John F. Reiser
Copyright (C) 2002-2020 Jens Medoch
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
Copyright (C) 1999-2006 Igor Pavlov
UPX comes with ABSOLUTELY NO WARRANTY; for details type 'upx-3.96 -L'.

  • Host Operating System and version: debian 10.4 amd64
    Linux deb-61 4.19.0-9-amd64 README File points to old URL #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux

  • Host CPU architecture:
    AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx

  • Target Operating System and version:
    OpenWRT 19.07.3 for Netgear WNDR3700v4
    Linux owrt_e_master 4.14.180 #0 Sat May 16 18:32:20 2020 mips GNU/Linux

  • Target CPU architecture:
    Atheros AR9344 rev 2,
    cpu: MIPS 74Kc V4.12

Upload of files not working:
https://drive.google.com/file/d/1izEeUYWLczkspAD4XysVoAV8O_6N4TKN/view?usp=sharing

@jreiser
Copy link
Collaborator

jreiser commented Jul 18, 2020

This is the same as #342 and #339 which was fixed on the devel branch:

commit 4fb1d41be8acd16849fab9622f35903d3fc4a7d9
Date:   Sat Feb 8 19:55:08 2020 -0800

see also

commit 16b18e939641663806ae4862114b4b556883c7de
Date:   Tue May 26 14:49:25 2020 -0700

Pre-built UPX may be available under https://github.com/upx/upx-automatic-builds/branches

@develBuzz
Copy link
Author

develBuzz commented Jul 18, 2020

Thank you, i searched open issues only. I'm closing it.

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

No branches or pull requests

2 participants