madExceptPatch on IDE compile is not always performed

delphi package - automated exception handling
Post Reply
x3mike
Posts: 8
Joined: Fri Apr 26, 2013 12:50 pm

madExceptPatch on IDE compile is not always performed

Post by x3mike »

Hello,

I have a strange problem, when I compile some larger project of mine, the exe is not patched after the compilation within the IDE all the time. This results in not bugreport handled exceptions.
When I manually use "madExceptPatch" afterwards the exe gets patched and madExcept works as expected. The compiled exe has 67MB in size.

For some testing I created a new project containing a single empty form and here all works fine.

How can I ensure the application gets patched?

Regards,
Michael
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExceptPatch on IDE compile is not always performed

Post by madshi »

I've had two other customers report the same problem recently. It seems that when your exe is very big and the IDE has a very strongly fragmented memory range, mapping the full exe into the IDE process fails, resulting in a failure to perform the patching. A workaround would be to run madExceptPatch as a post-build event. But of course that's not very nice. I'll see if I can do something about this for the next build.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExceptPatch on IDE compile is not always performed

Post by madshi »

I've now implemented a workaround: If patching fails inside of the IDE process, madExcept instead automatically starts the "madExceptPatch.exe" helper tool to do the patching. You shouldn't even notice the difference, except that the problem should hopefully be gone now:

http://madshi.net/madCollection.exe (madExcept 4.0.7, installer 2.7.6.0)
Jürgen Bauer
Posts: 3
Joined: Wed Jun 26, 2013 9:58 am

Re: madExceptPatch on IDE compile is not always performed

Post by Jürgen Bauer »

Hello,
I have a similar Problem with my application which has a exe size of about 100 mb.
Even if I call the external tool madExceptPatch.exe, my application is not patched.
All exceptions are reported "normally" not via madExcept.

Any idea?

Thanks!

Bye,
Jürgen
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExceptPatch on IDE compile is not always performed

Post by madshi »

What does madExceptPatch report? Any warnings/errors?
Jürgen Bauer
Posts: 3
Joined: Wed Jun 26, 2013 9:58 am

Re: madExceptPatch on IDE compile is not always performed

Post by Jürgen Bauer »

There are no warnings/Errors reported.
But the application does not show the madExcept screen when exceptions are raised.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExceptPatch on IDE compile is not always performed

Post by madshi »

Hmmmm... Are we talking about Delphi or BCB? Can you send me your EXE file and the matching MAP file (if it's Delphi, for BCB please send me the TDS file). I don't need to be able to execute your EXE, just need to be able to run madExceptPatch myself on your EXE.
Jürgen Bauer
Posts: 3
Joined: Wed Jun 26, 2013 9:58 am

Re: madExceptPatch on IDE compile is not always performed

Post by Jürgen Bauer »

I am using Delphi XE4.
How can I send you my application?
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExceptPatch on IDE compile is not always performed

Post by madshi »

Maybe you can upload it somewhere (e.g. Mediafire) and then send me a link via email?

When creating the EXE you want to send to me, please disable madExcept first, to make sure that your EXE is not yet touched by madExcept at all. Then please zip up the EXE, the map file and the "mes" file.
bwdirks
Posts: 19
Joined: Wed Feb 04, 2015 7:07 pm

Re: madExceptPatch on IDE compile is not always performed

Post by bwdirks »

I'm using madExcept 4.0.11 and I'm still getting this error after doing a full build of my application in XE7:
[madExcept Warning] Starting external madExceptPatch tool failed.

I downloaded your DLL injector tool and followed your instructions and this is what I got when I compiled again:
"C:\Users\Public\Documents\Embarcadero\Studio\15.0\tools\madExceptPatch.exe" "C:\DOCSTORE\CarePlans\DSSCarePlans.exe" "C:\Source Code\CarePlans\v0.0.0.1\DSSCarePlans.mes" /dontCheckRtl

All of those paths are correct so why am I still getting this error?
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExceptPatch on IDE compile is not always performed

Post by madshi »

FJWIW: The problem reported by bwdirks was solved via email: The "Tools" subdirectory was missing. Suspected cause: Too long library path? Manually creating the folder with the madExceptPatch tool inside solved the issue.
Post Reply