-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 output of binary 'go' file can not run on macOS #222
Comments
I can confirm that I am also seeing this issue. It appears to be an issue with the official 3.95 release, as I do not see the failure using the official 3.94 release. To reproduce I built a simple Docker image (using the following Dockerfile with FROM golang:1.10.4
RUN apt update \
&& apt install xz-utils \
&& cd /tmp \
&& wget --quiet https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz \
&& wget --quiet https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz \
&& tar -xf upx-3.94-amd64_linux.tar.xz \
&& tar -xf upx-3.95-amd64_linux.tar.xz I then ran the image with:
Inside the image, I compiled and compressed test binaries using both releases:
After exiting the image, I then ran the original and compressed binaries, resulting in the execution failure:
Additionally, I have bundled all of these files together and uploaded them in repro.tar.gz. Thank you all for the hard work on this amazing project! |
#222 modified: p_mach.cpp modified: p_mach.h modified: stub/src/amd64-darwin.macho-entry.S also *.macho-*.h, *.macho-fold.map, amd64-darwin.macho-entry.bin.dump
The tip of devel branch, 37d6a34, works for me; also tested on Mojave. A compiled version for Linux is available beginning at the upx-automatic-builds page as: https://github.com/upx/upx-automatic-builds/blob/devel-20180924-37d6a34-travis/amd64-linux-gcc-8-release/upx-git-37d6a34e5867.out . |
#222 modified: p_mach.cpp modified: stub/src/amd64-darwin.macho-main.c modified: stub/src/amd64-darwin.macho-upxmain.c also *-darwin.macho-fold.{h,map}
The tip of devel branch fixes upx -d for such 'rust' executables. |
@jreiser is there any timeline on a UPX release with this fix? |
@tammersaleh See the comment #222 (comment) of Sep.30. I'll bet you can figure out how to get the version which runs on amd64-darwin. |
@jreiser which is not what package managers will do -- they will update the package only when new release is out. |
@jreiser is there anything blocking a 3.96 release with this fix? Is there anything we can do to help this along? |
|
Thanks for the quick response @jreiser. I'll try to find some time to test the fix. I can imagine that it's a complex project to deal with, given all the different platforms you support! I'm not trying to complain or rush things, and I totally understand priority pressures. It just wasn't clear to me where this stood. Now it is, and I thank you for the clarity! |
Ok, I've used $ sha256sum bin/*
5b7a8474260b3ed09884afb0b798aa0e710cfa42b17b1dcff92e77bb38207c21 bin/gomplate_darwin-amd64 # original
dd30fde418e918dca38764d72821bb32cbe5a8836adac8412c68a61b6e9bfb19 bin/gomplate_darwin-amd64-slim # compressed
5b7a8474260b3ed09884afb0b798aa0e710cfa42b17b1dcff92e77bb38207c21 bin/gomplate_darwin-amd64-slim-decompressed # decompressed and the compressed executable works: $ bin/gomplate_darwin-amd64-slim -i '{{ print "it works!" }}'
it works! Perhaps some others can verify as well? |
It's work. Thanks for @hairyhenderson 's answer. $ go version
go version go1.11.1 darwin/amd64
$ brew install --HEAD upx
$ upx -V
upx 3.96-git-473b90419f68
UCL data compression library 1.03
zlib data compression library 1.2.11
LZMA SDK version 4.43
$ upx -o besthello hello
$ ./besthello
Hello World! |
Thanks @grtfou! |
@jreiser @markus-oberhumer - it looks like at least 2 more (myself and @grtfou) have confirmed the fix. I'll try to see if I can find more if you need more broad testing. Also @hackmac89 - I see you 👍d my comment - does that mean you can also verify the fix? Can you do so in writing? 🙂 |
@hairyhenderson I can confirm , your comment is working. I uninstalled 3.95 and installed HEAD |
@hairyhenderson yep, can confirm it´s working. |
upx currently breaks macOS binaries (see upx/upx#222)
@markus-oberhumer could a 3.96 release be cut? While shipping |
Yeah, a new release is probably a good idea. Should happen soon. |
Thanks @jreiser! I'll do that later today |
@jreiser here you go! Here is the uncompressed executable https://we.tl/t-OFgjlWIeMe Thanks! |
Just ran a bisect, and it found this commit: 4f69799. |
@hairyhenderson it works for me too now, after go upgraded to 1.14.3 while upx is still at 3.96 |
I have the same issue but with Lazarus IDE 2.0.8 x86_64. |
You can do that:
|
Thanks @steeve, I can now compress again with version 3.94 :) |
#222 go-1.14 (but not go-1.14.3 ?) modified: ../p_mach.cpp modified: ../p_mach.h modified: ../p_unix.cpp modified: ../p_unix.h modified: ../stub/src/amd64-darwin.macho-main.c modified: ../stub/amd64-darwin.macho-fold.h modified: ../stub/arm.v5a-darwin.macho-fold.h modified: ../stub/arm64-darwin.macho-fold.h modified: ../stub/tmp/amd64-darwin.macho-fold.map modified: ../stub/tmp/arm.v5a-darwin.macho-fold.map modified: ../stub/tmp/arm64-darwin.macho-fold.map
@steeve Is there a way to test different versions, ex: 3.9.5, I can't seem to find a list of formulas for upx ? |
You could find the history at https://github.com/Homebrew/homebrew-core/commits/master/Formula/upx.rb You can look for the affect commit: #222 (comment) |
Where is v3.96 for Mac OS? I don't see it in the downloads in GitHub? Thanks! |
|
@jreiser GitHub Actions provides a free public build environment for MacOS, Linux, and MSWindows. |
On macOS Big Sur 11.1: Tried using an older version via the methods specified above and figured I'll try the last version (
Current version ( |
Haven't tried compiling $ upx --version
upx 3.96
# <extra text snipped>
$ cargo new --bin hello
$ cd hello
$ cargo build --release
$ ./target/release/hello
"Hello, world!"
$ upx --all-methods ./target/release/hello
$ ./target/release/hello
[1] 40004 killed ./target/release/hello |
Issue seems to be with v3.94 of upx that comes installed by default in ubuntu-latest images of Github actions. A number of very similar issues: upx/upx#450 upx/upx#222 Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
…mediately Issue seems to be with v3.94 of upx that comes installed by default in ubuntu-latest images of Github actions. A number of very similar issues: upx/upx#450 upx/upx#222 Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
…mediately (#441) Issue seems to be with v3.94 of upx that comes installed by default in ubuntu-latest images of Github actions. A number of very similar issues: upx/upx#450 upx/upx#222 Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
upx 3.96 currently fails there. See upx/upx#222
#222 go-1.14 (but not go-1.14.3 ?) modified: ../p_mach.cpp modified: ../p_mach.h modified: ../p_unix.cpp modified: ../p_unix.h modified: ../stub/src/amd64-darwin.macho-main.c modified: ../stub/amd64-darwin.macho-fold.h modified: ../stub/arm.v5a-darwin.macho-fold.h modified: ../stub/arm64-darwin.macho-fold.h modified: ../stub/tmp/amd64-darwin.macho-fold.map modified: ../stub/tmp/arm.v5a-darwin.macho-fold.map modified: ../stub/tmp/arm64-darwin.macho-fold.map
What's the problem (or question)?
upx output binary file can not run on macOS
What should have happened?
Do you have an idea for a solution?
How can we reproduce the issue?
Please tell us details about your environment.
upx --version
):macOS High Sierra 10.13.6
x86_64
macOS High Sierra 10.13.6
x86_64
The text was updated successfully, but these errors were encountered: