Page 2 of 2

Re: MadExcept not detecting crash

Posted: Wed Sep 27, 2017 6:52 am
by jmarder
madshi wrote: 2) The test program from jmarder is interesting. Basically it shows that crashes inside of a custom "AllocateHwnd()" window proc aren't always caught by madExcept. I've analyzed this problem in detail and it seems that the exception is bypassing all of Delphi's own RTL exception handling somehow, so madExcept never gets access to it, and even Windows's "SetUnhandledExceptionFilter()" API doesn't work. It looks like a bug in the RTL to me
Well, the AllocateHwnd() function is just 12 lines of plain Windows API code. Why do you think it is a bug in the RTL? I would volunteer to open an issue at Embaracdro's issue tracker, but I need more details to do so.
madshi wrote: Fortunately, the problem seems to be limited to AllocateHwnd(), and it's easy enough to manually solve by adding a "try .. except madExcept.HandleException() end" block around the AllocateHwnd() window proc.
Unfortunately it is not that easy. AllocateHwnd() is used in several places in the VCL where I can't add this. AllocateHwnd() is also used in many 3rd party libraries where this exception hadnling is also missing and where you can't easily reference MadExcept as not every Delphi Developer has it installed.

Re: MadExcept not detecting crash

Posted: Wed Sep 27, 2017 8:27 am
by madshi
Oh cool, I didn't know those PE options yet!

Re: MadExcept not detecting crash

Posted: Thu Oct 19, 2017 8:44 pm
by jmarder
Is there any news on the AllocateHwnd() issue?

Re: MadExcept not detecting crash

Posted: Tue Nov 14, 2017 7:45 am
by jmarder
I recently had a very similar case when using the Windows Ribbon Framework for Delphi. When a Command was fired, within this event handler exactly the same happened: App crash instead of MadExcept dialog when an exception occurred. The same applies for Windows Shell change notifications. I think it would be important to address this issue in MadExcept itself.