Page 1 of 1

Missing Exception class and message on 64bit builds + UPX

Posted: Wed Nov 21, 2018 8:31 am
by jampeter
Hi!

I am trying to use madexcept (4.0.21) along with my 64bit executable compressed with UPX (v3.95).
My Application is compiled with Delphi 10.2.3 Tokyo.
It seems that MadExcept does not report errors correctly when I raise own exceptions (using an own exception class derived from System.SysUtils.Exception) e.g.:

Code: Select all

interface
  TMyException = class(Exception)
    constructor Create();
  end;

implementation

constructor TMyException.Create();
begin
  inherited Create('Test message ' + self.ClassName);
end;
If I raise this exception in an uncompressed executable, madexcept displays the correct information:
exception class: TMyException
exception message: Test message TMyException.

As soon as I compress the executable with UPX I receive:
exception class: UNKNOWN
exception message: UNKNOWN

For compressed 32bit executables madexcept reports the correct information.
It does not work just for 64bit compressed executables and if I raise own/derived exceptions classes.
Raising exceptions in 64bit compressed executables without using madexcept works correctly (the correct exception message is displayed) so I guess this is a bug in madexcept.
Please let me know if you need futher information.

Re: Missing Exception class and message on 64bit builds + UP

Posted: Thu Nov 29, 2018 11:40 pm
by madshi
Isn't it UPX' job to compress the EXE in such a way that the compression is completely transparent, without any effect on the application? If so, why would it be my fault, if using UPX stops madExcept from working correctly? Obviously, UPX changed something which breaks madExcept. Well, I suppose I could look into it and try to fix it, but I'm quite reluctant to consider this madExcept's fault...

Just to be sure: This problem also occurs in a brand new test project, correct? Or does it only occur in your big real project?

Re: Missing Exception class and message on 64bit builds + UP

Posted: Mon Dec 03, 2018 8:46 am
by jampeter
Yes, you can reproduce the issue with a simple new test project.
Well, I suppose I could look into it and try to fix it, but I'm quite reluctant to consider this madExcept's fault...
Yes, you are right, UPX should not break anything. Nevertheless thank you very much for taking a look at this problem.
Maybe you can fix it in your code.

Re: Missing Exception class and message on 64bit builds + UP

Posted: Wed Feb 20, 2019 1:46 pm
by jampeter