graal icon indicating copy to clipboard operation
graal copied to clipboard

UPX compression broken for Windows native images produced with 22.x

Open axelfontaine opened this issue 2 years ago • 5 comments

Describe the issue See https://github.com/upx/upx/issues/559 And https://github.com/oracle/graal/pull/4051#issuecomment-1036002461

as originally reported by @joerg-wille

I face the exact same issue as well.

axelfontaine avatar Feb 20 '22 09:02 axelfontaine

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.)

rubyFeedback avatar Feb 20 '22 17:02 rubyFeedback

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 avatar Mar 29 '22 03:03 david-sitsky

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.

david-sitsky avatar Mar 31 '22 00:03 david-sitsky

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

sanshengshui avatar Aug 05 '22 14:08 sanshengshui

We are also hitting this issue.

@pejovica @peter-hofer you developed/approved PR https://github.com/oracle/graal/pull/4051 which breaks the compatibility with apparently any kind of exe compression as explained here https://github.com/upx/upx/issues/559#issuecomment-1032047038 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?

sebthom avatar Aug 05 '22 14:08 sebthom

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

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

ArloL avatar Oct 25 '22 17:10 ArloL

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

ikappaki avatar Nov 24 '22 22:11 ikappaki

While investigating UPX issues https://github.com/upx/upx/issues/559 and https://github.com/upx/upx/issues/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?

markus-oberhumer avatar Oct 28 '23 11:10 markus-oberhumer

@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

sadaaithal avatar Nov 14 '23 23:11 sadaaithal

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

theotherp avatar Nov 20 '23 20:11 theotherp

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 avatar Jan 16 '24 11:01 oubidar-Abderrahim

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?

BullyWiiPlaza avatar Jan 28 '24 14:01 BullyWiiPlaza

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

sean-scott-lr avatar Feb 20 '24 19:02 sean-scott-lr