Recent

Author Topic: Lazarus MacOS app and UPX  (Read 1415 times)

jermen

  • New member
  • *
  • Posts: 7
Lazarus MacOS app and UPX
« on: March 30, 2020, 04:19:10 am »
Hello,

I am having issues with my Lazarus apps compressed with UPX under MacOS Mojave and Catalina.
This issue is only happening recently and seems to be tied to Lazarus apps (version 2.0.6?).  I had version 2.0.4 before and did not have issues, not sure if issue is linked to Lazarus or an OS update.  I have tried building an app from Xcode (swift) and am not having this issue.  Also noticed that the issues are only happening with x86_64 apps, i386 are not having the same problem.

When I compile my apps then compress them using upx (ex: upx "app name") and try to run the app from Finder, the app opens and closes right away.  If I uncompress the app using upx "app name" -d, it works again.

I know this could be an issue with UPX and there is a ticket open for that, however the version hasn't changed and am not having the issue with apps build outside of Lazarus.

If anybody can help it would be appreciated!

Thanks

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Lazarus MacOS app and UPX
« Reply #1 on: March 30, 2020, 04:28:36 am »
you need to either of:
1) see the system log. It will likely keep the log of the crash
2) run the application from Terminal. The error will likely be put into stderr or stdout, so you'll see it in Terminal window
3) try run the app via lldb debugger (again from Terminal)
« Last Edit: March 30, 2020, 04:37:28 am by skalogryz »

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: Lazarus MacOS app and UPX
« Reply #2 on: March 30, 2020, 09:37:05 am »
UPX is a somewhat controversial topic. Did you already exhaust the suggestions given in https://wiki.freepascal.org/Size_Matters? The LazPlanet post http://lazplanet.blogspot.com/2013/03/how-to-reduce-exe-file-size-of-your.html may also be interesting for you. Maybe that you don't need UPX at all.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11351
  • FPC developer.
Re: Lazarus MacOS app and UPX
« Reply #3 on: March 30, 2020, 06:26:58 pm »
you need to either of:
1) see the system log. It will likely keep the log of the crash
2) run the application from Terminal. The error will likely be put into stderr or stdout, so you'll see it in Terminal window
3) try run the app via lldb debugger (again from Terminal)

And most importantly, report it to UPX. Why is problem with a 3rd party tool on this forum?

Also all historic UPX usage was on Dos (go32v2) and windows 32-bit. There is not much practically known about  other targets.
« Last Edit: March 30, 2020, 06:44:49 pm by marcov »

440bx

  • Hero Member
  • *****
  • Posts: 3921
Re: Lazarus MacOS app and UPX
« Reply #4 on: March 30, 2020, 06:34:28 pm »
I am having issues with my Lazarus apps compressed with UPX under MacOS Mojave and Catalina.
if the reason for using UPX is to save disk space, in the era of multi-terabyte drives, it just seems to be a way of looking for problems for a rather measly (and likely rather inconsequential) gain.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

jermen

  • New member
  • *
  • Posts: 7
Re: Lazarus MacOS app and UPX
« Reply #5 on: April 03, 2020, 11:26:41 pm »
I wish I could avoid using UPX but the application needs to run from a flash drive with 4 Mb size, using UPX I was able to keep it at around 2 Mb.


And most importantly, report it to UPX. Why is problem with a 3rd party tool on this forum?

Also all historic UPX usage was on Dos (go32v2) and windows 32-bit. There is not much practically known about  other targets.

I have tried with other apps not build using Lazarus and have no issues with UPX, cannot 100% pinpoint this to Lazarus but there seems to be some link.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Lazarus MacOS app and UPX
« Reply #6 on: April 03, 2020, 11:34:12 pm »
I have tried with other apps not build using Lazarus and have no issues with UPX, cannot 100% pinpoint this to Lazarus but there seems to be some link.

Hi!

But that is the problem of UPX and not the problem of fpc/Lazarus. So ask them.

Winni

jermen

  • New member
  • *
  • Posts: 7
Re: Lazarus MacOS app and UPX
« Reply #7 on: April 03, 2020, 11:55:51 pm »
you need to either of:
1) see the system log. It will likely keep the log of the crash
2) run the application from Terminal. The error will likely be put into stderr or stdout, so you'll see it in Terminal window
3) try run the app via lldb debugger (again from Terminal)

Thanks, will give this a try when I get a minute

 

TinyPortal © 2005-2018