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 compression broken for Windows native images produced with 22.x #4340

Closed
axelfontaine opened this issue Feb 20, 2022 · 13 comments
Closed
Assignees

Comments

@axelfontaine
Copy link

Describe the issue
See upx/upx#559
And #4051 (comment)

as originally reported by @joerg-wille

I face the exact same issue as well.

@rubyFeedback
Copy link

rubyFeedback commented Feb 20, 2022

Would be kind of cool to generate binaries for windows, from linux as such, too. :D (A bit like the libui project came up with cross-platform native GUI).
(For me upx works very well on linux; then again most everything in regards to compiling something works better for me on linux. Sorry for the semi-off topic pass-by comment here.)

@fernando-valdez fernando-valdez self-assigned this Feb 23, 2022
@david-sitsky
Copy link

Hi - I have been hit by this exact issue with GraalVM 22.0.0.2 Java 11 CE on Windows 10. The upx/upx#559 issue describes some workarounds for changes in the GraalVM source code. For an end-user, are there any command-line arguments to native-image which will disable the use of WindowsImageHeapProviderFeature? Are there any other workarounds?

@david-sitsky
Copy link

I can confirm using 7zip to remove the com/oracle/svm/core/windows/WindowsImageHeapProviderFeature.class entry within the lib/svm/builder/svm.jar file fixes my issue. It would be nice if this can be solved in the official distribution though.

chirontt added a commit to chirontt/lwjgl3-demos that referenced this issue Aug 2, 2022
as per discussion in oracle/graal#4340.

The UPX-compressed native image will make the demos work properly
in Windows, while the uncompressed one crashes when trying to load
some .dll files at runtime.
@sanshengshui
Copy link

I have been hit by this exact issue with GraalVM 22.1.0 Java 11 CE on Windows10.

@sebthom
Copy link

sebthom commented Aug 5, 2022

We are also hitting this issue.

@pejovica @peter-hofer you developed/approved PR #4051 which breaks the compatibility with apparently any kind of exe compression as explained here upx/upx#559 (comment) would be great to get your feedback on this issue. @fernando-valdez does not seem to be active on github so I wonder why he got this issue assigned. Is anyone actively developing graalvm actually monitoring/aware of this issue?

chirontt added a commit to chirontt/lwjgl3-helloworld-native that referenced this issue Aug 8, 2022
as per discussion in oracle/graal#4340.

The UPX-compressed native image of the helloworld app will work properly
in Windows, while the uncompressed one crashes when trying to load
some .dll files at runtime.
ikappaki added a commit to ikappaki/clojure-lsp that referenced this issue Sep 29, 2022
Uses workaround for UPX issue with 22.2.0, see
oracle/graal#4340
ericdallo pushed a commit to clojure-lsp/clojure-lsp that referenced this issue Oct 1, 2022
Uses workaround for UPX issue with 22.2.0, see
oracle/graal#4340

Co-authored-by: ikappaki <[email protected]>
@ArloL
Copy link

ArloL commented Oct 25, 2022

Removing WindowsImageHeapProviderFeature does not work for 22.3.0 since the code was moved to WindowsFeature with 020e5ed.

I unsuccessfully tried removing WindowsImageHeapProvider.class and WindowsFeature.class. Any other ideas?

@ikappaki
Copy link

Hi @fernando-valdez,

You appear to be assigned to this issue, woudl it be possible to provide us with an indication whether this is likely to be looked at or perhaps suggest otherwise? We are currently stuck on older graalvm versions on MS-Windows waiting for a resolution on this issue.

Thanks

@markus-oberhumer
Copy link

While investigating UPX issues upx/upx#559 and upx/upx#670 we noticed that sometimes using a low compression level actually makes the compressed exe work.

Could you try if using upx -1 or upx -2 makes any difference in your case?

@sadaaithal
Copy link

@markus-oberhumer I can confirm that both upx -1 and upx -2 works for me. Without the flag, the compressed exe just fails with ERROR CODE 193

@theotherp
Copy link

For me upx -1 does not work (and neither does upx -2.

@oubidar-Abderrahim
Copy link
Member

If this issue is still relevant in the latest GraalVM versions, please create a new issue for it and follow the template provided. Thank you

@oubidar-Abderrahim oubidar-Abderrahim closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2024
@BullyWiiPlaza
Copy link

BullyWiiPlaza commented Jan 28, 2024

If this issue is still relevant in the latest GraalVM versions, please create a new issue for it and follow the template provided. Thank you

Hello, I used GraalVM Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30) from here with upx 4.2.2 and the issue persisted. Why do we need a new issue if this one can be re-opened?

@sean-scott-lr
Copy link

sean-scott-lr commented Feb 20, 2024

I am unable to use upx with a graal native image on OSX aarch as well. ( no level from 1 to best work )
GraalVM CE 21.0.2+13.1
upx 4.1.1

echo $?
127

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