WEE-41 UPX fail on Ubuntu 15.10 64-bit
- Posted by K_D_R Dec 21, 2015
- 1664 views
This is very strange. On WEE-41 and several previous versions I have experienced strange results with the Translate-Compile option.
The upx code seems to be executing prior to the translate compile code.
This is a capture of the lxterminal cosole output upon running wee.exw v. 41 in a terminal and then selecting translate and compile with only the test run after bind/shroud translate option selected:
kenneth@kenneth-desktop:~/wee/wee41$ eui wee.exw wee.exw /usr/bin/upx 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: wee: FileNotFoundException: wee Packed 0 files.
The "Run in background" option was not selected. A gnome-terminal window opened immediately and reported the progress of translation/compile operation during which time the wee.exw code page remained unshaded. Upon completion of the translation/compile process the gnome-terminal window closed. A check of the wee41 folder revealed that the file had been translated/compiled, but not packed by UPX:
kenneth@kenneth-desktop:~/wee/wee41$ ls -s total 2996 4 EuGTK 4 scintilla 48 ui_gtk.e *** 2676 wee *** 12 weeicon.e 84 parser.e 76 scintilla.e 4 updater.ex 88 wee.exw {{{ When I run the translate/compile option again. The upx function executes immediately and compresses the wee binary created by the previous run. {{{ /usr/bin/upx 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 -------------------- ------ ----------- ----------- 2740216 -> 813644 29.69% linux/ElfAMD wee Packed 1 file.
Then the wee.exw code is translated and compiled again, overwriting the previously created compressed wee binary.
On the second run the editor window shaded and remained shaded and unresponsive, even after the translation/compile task completed. I had to force the unresponsive window to close.
Bind fails in the same manner. On the first run, upx will try to compress filebase(file_name) before executing eubind, then a bound version of file_name is created which is not compressed. On the 2nd run, the previously created bound file is compressed; however execution fails with the message:
kenneth@kenneth-desktop:~/wee/wee41$ ./wee <0302>:: no Euphoria IL code to execute
I do not believe that bound euphoria programs are compressable with upx.
I edited the translate compile clause in RunStart as follows:
-- insert before RunStart in ui_gtk.e function background(sequence cmd) -- for use with system_exec(cmd[1], cmd[2]) cmd &= " &" cmd[1] = cmd cmd[2] = 1 -- the previous graphics mode is restored -- and the screen is cleared. if run_background then cmd[2] = 0 -- a beep sound will be made and the program will wait for the user to press a key before the previous graphics mode is restored. end if return cmd end function -- replaces existing translate/compile code in function RunStart. -- if run menu option "Run in Backround is not selected -- progress will be reported in the -- system default terminal emulator -- a keypress is required to proceed -- to the next process. elsif equal(lbl, "Translate and Compile") then if file_exists(filebase(file_name)) then -- else upx will execute first, -- compressing the existing file, -- and then a new file will be created, -- which will not be compressed! delete_file(filebase(file_name)) end if cmd &= get_eu_bin("euc") & ' ' & quote_spaces(file_name) cmd = background(cmd) -- requires function background(sequence cmd) if system_exec(cmd[1], cmd[2]) = 0 then -- file translated/compiled successfully cmd = "upx " & filebase(file_name) cmd = background(cmd) if system_exec(cmd[1], cmd[2]) = 0 then -- executable file packed successfully if run_testrun then cmd = "./" & filebase(file_name) cmd = background(cmd) if system_exec(cmd[1], cmd[2]) = 0 then end if end if end if end if
Perhaps it would be easier not to support upx. Or maybe add a discrete option to the Run menu.
Regards, Ken