madExcept not working on 64 bit build

delphi package - automated exception handling

madExcept not working on 64 bit build

Postby santiago » Thu Jun 30, 2016 10:31 pm

Hi madschi,

not too long ago we purchased the company license for madExcept.
Just ran into one problem.
We are now switching from XE-2 to XE-10.

madExcept works well in XE-10 Win32 builds.
We just created a Win64 build of our software (XE-10 only).
The problem is that the madExcept box does not appear, but the standard delphi exception box shows up.
The source code for Win32/Win64 is basically the same. Win64 is just a new build configuration.

We can build our software with the Delphi IDE (XE-10) or via MS-BUILD. For the later case we use the madExceptPatch.exe tool.
madExcept works well for Win32 version (IDE or MS-Build built), but the Win64 build does not work in either case.

We manually link in the madExcept code in our base package (bpl) and distribute the madExcept bpl's along with our product:


Code: Select all
requires
...
  madBasic_,
  madDisAsm_,
  madExcept_;


I looked in the registry [HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\17.0\Known Packages] and found this:
Image

I imagine these entries originate from the madCollection installer. They do refer to the 32 bit versions of the bpl.
Maybe this is somehow causing a conflict? I don't think so (as they are irrelevant for MS-BUILD) but I can't think of any thing else.

Any idea what could be wrong? Does anything specific need to be done to enable madExcept for Win64 builds?

Thank you!

** EDIT **

The build configurations settings are identical except for the obvious x86-x64 differences.
santiago
 
Posts: 40
Joined: Thu May 05, 2016 6:01 pm

Re: madExcept not working on 64 bit build

Postby madshi » Tue Jul 12, 2016 9:51 pm

Have you tried compiling within the IDE as a test to check if it's working correctly then?

The "Known Packages" are those loaded by the IDE and the IDE is a 32bit process, so everything is correct there.

When compiling with MS-Build, you need to manually make sure that the compiler and linker options are set correctly. Basically you need to enable most of the compiler debug switches (except for stack frames, which are not needed), but you can disable all the linker debug options. Except for the map file which needs to be set to detailed.

One thing worth trying:

1) Create an empty file "madExceptWizard.txt" on your desktop.
2) Run madExceptPatch.exe as you usually do for the 64bit build.
3) Zip the text file and attach it here, then I can have a look.
madshi
Site Admin
 
Posts: 9431
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept not working on 64 bit build

Postby santiago » Tue Jul 12, 2016 11:26 pm

Hello madshi,

yes the problem happens if we compile from either the IDE or via MS-BUILD. 32 bit builds work fine in either case.

I did the following.
I copied the following files into a folder which I will upload for you:

madExceptPatch.exe
CoreBpl.mes (MES file we use for the Core.bpl file which required _madExcept,bpl)
Corex64.map (linker map file generated for 64 bit build)
Corex86.map (linker map file generated for 32 bit build)
madExceptWizard.txt (empty file which needs to have the map file appended to it)

I opened a command prompt and cd'd into this folder.
I then ran:

Code: Select all
C:\Temp\deleteMe\madExcept>madExceptPatch.exe madExceptWizard.txt CoreBpl.mes Corex64.map

Result:
map file appended

Code: Select all
C:\Temp\deleteMe\madExcept>madExceptPatch.exe madExceptWizard.txt CoreBpl.mes Corex86.map

Result:
map file appended

however in both cases the madExceptWizard.txt remainded 0 bytes in size.

You can download the zipped folder from here:
https://www.dropbox.com/s/nfjxytqa7lsw77e/madExcept.zip?dl=0

Thx!
santiago
 
Posts: 40
Joined: Thu May 05, 2016 6:01 pm

Re: madExcept not working on 64 bit build

Postby madshi » Wed Jul 13, 2016 7:15 am

Please don't add madExceptWizard.txt as a parameter to madExceptPatch. Simply run madExceptPatch exactly the same way as you always did. Does the madExceptWizard.txt file fill then?
madshi
Site Admin
 
Posts: 9431
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept not working on 64 bit build

Postby santiago » Wed Jul 13, 2016 2:58 pm

Hello madschi,

got it ;-).

Here is the link to the file. This is after compiling with MS-BUILD and running madExceptPatch.exe as part of the build process.

I ran it twice one for 64 bit build and once for 32 bit build.

64-bit:
https://www.dropbox.com/s/qc8o40rl2c9x4dn/madExceptWizardx64.txt?dl=0

32-bit:
https://www.dropbox.com/s/xmm06ued3x4etnj/madExceptWizardx86.txt?dl=0

Thanks!
santiago
 
Posts: 40
Joined: Thu May 05, 2016 6:01 pm

Re: madExcept not working on 64 bit build

Postby madshi » Wed Jul 13, 2016 4:00 pm

Ok, now can you please send me (madshi (at) gmail (dot) com) your 32bit + 64bit EXEs and BPLs (those BPLs where you've enabledmadExcept)? I don't plan to actually execute them I just need to look at their resource sections and dll imports. Please RAR them, with a password that also encrypts the file names, then rename the extension to .dat, otherwise gmail will refuse to accept the attachment. Thanks!

P.S: I mean everything full patched with madExceptPatch.exe, so that you *think* they should work, but only the 32bit works but not the 64bit.
madshi
Site Admin
 
Posts: 9431
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept not working on 64 bit build

Postby madshi » Wed Jul 13, 2016 7:42 pm

Ok, having checked all your files, it all looks "correct" to me, so right now I've no idea why exception catching doesn't seem to work. Have you tried raising a simple test exception, e.g. a "raise Exception.Create('test')" in a button click event? That doesn't work, either?

Is there any chance you could try to reproduce this problem in a brand new test project somehow? If I could reproduce it on my PC, it should be easy to fix.
madshi
Site Admin
 
Posts: 9431
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept not working on 64 bit build

Postby santiago » Wed Jul 13, 2016 8:00 pm

Hello madschi,

yes I that is exactly how I was testing :-)

Code: Select all
procedure TApplicationManager.CloseActiveJob;
begin
  raise Exception.Create('Testing madExcept');


In 32 bit builds the madExcept box shows, but not on the 64 bit build.

Am relieved that all seems to be correct, as I have double checked everything multiple times trying to find the error.

I will create a new test groupproject setup in a similar way. Hopefully I can reproduce the error there.
I'll get back to you as soon as I have something.

Thx!
santiago
 
Posts: 40
Joined: Thu May 05, 2016 6:01 pm

Re: madExcept not working on 64 bit build

Postby madshi » Wed Jul 13, 2016 8:08 pm

Great - let me know!
madshi
Site Admin
 
Posts: 9431
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept not working on 64 bit build

Postby santiago » Mon Jul 18, 2016 4:34 pm

madschi,

I just emailed you a sample project. In that project the 32 bit build works fine, however the madExcept box does not show up on the 64 bit build.

Thanks!!
santiago
 
Posts: 40
Joined: Thu May 05, 2016 6:01 pm

Re: madExcept not working on 64 bit build

Postby madshi » Mon Jul 18, 2016 5:30 pm

Thanks, I received the email. Might take a couple of days until I find time for this, though. Busy with some other stuff atm.
madshi
Site Admin
 
Posts: 9431
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept not working on 64 bit build

Postby santiago » Mon Jul 25, 2016 1:50 pm

Hello madschi,
have you had any chance to look into the issue yet? Were you able to reproduce it?

Thx!
santiago
 
Posts: 40
Joined: Thu May 05, 2016 6:01 pm

Re: madExcept not working on 64 bit build

Postby madshi » Mon Aug 01, 2016 9:32 am

Sorry for taking so long. Was busy with another task which I wanted to complete first.

So here's a new build, which I think should fix the problem:

http://madshi.net/madCollectionBeta.exe (installer 2.7.15.6)

It was a simple 1-line-fix... :oops:
madshi
Site Admin
 
Posts: 9431
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept not working on 64 bit build

Postby santiago » Mon Aug 01, 2016 2:33 pm

I installed version 2.7.15.6 and it now works.

Thanks!!!
santiago
 
Posts: 40
Joined: Thu May 05, 2016 6:01 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 2 guests