Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

delphi package - automated exception handling
Post Reply
obones
Posts: 66
Joined: Fri May 15, 2009 11:47 am

Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

Post by obones »

Hello,

I have a very strange situation here, happening on only one of the computers I'm using and to none of my colleagues.
We are all using Delphi 10.4.2 but in my case, here is what happens:

Start Delphi
Open a project
Run with debugging
Hit a breakpoint or stop on an exception
IDE freezes for dozens of seconds
F8 to step once
IDE freezes for dozens of seconds
F8 to step once
IDE freezes for dozens of seconds
Debugged application is killed and WerFault is creating a dump.

After going through lots of possible solutions (AV, Firewall, new PC), I finally figured out that all I had to do is remove this package from the known packages key in the registry:

"C:\\Program Files (x86)\\madCollection\\madExcept\\BDS21\\win32\\madExceptWizard_.bpl"="madExceptWizard 3.1.8 - www.madshi.net"

I have no idea what's happening in that package, and why it started happening about 6 months ago but I'm more than willing to help you identify the source of the issue.

What would you suggest I try to understand where the issue is coming from?

Regards
Olivier
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Re: Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

Post by madshi »

Unfortunately, I've no idea what the issue could be, and it would be extremely time consuming trying to figure this out. So my suggestion would be to use an ugly workaround:

1) Remove the package from the IDE.
2) Instead setup a "post build event" in the project settings, where you call "madExceptPatch.exe pathToYourExeFile".

This should do pretty much the same as the madExceptWizard_.bpl package does. This package basically also internally registers for a post build event and then calls madExceptPatch.exe internally.

However, you're losing the madExcept settings dialog this way.
uko
Posts: 25
Joined: Thu May 29, 2008 2:14 pm

Re: Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

Post by uko »

I have a problem on Delphi 11.3 (28.0.47991.2819) / madExcept 5.1.2 that sounds very similar:

steps to reproduce:
- start IDE
- create new VCL application
- save project
- Build with Shift + F9
- run with F9 ! (this seems to be required)
- close all
- create a second new VCL application
- save project (different folder)
- Build with Shift + F9

--> new the build lasts about 1 minute (and on Taskmanager I can see madexceptpatch.exe running)

using that steps I can always reproduce the problem (also with different real world projects)

Here is the relevant part of the madExceptWizard log file:

10:18:42-119 current project: "D:\Dev-Delphi XE11\Testprojekte\Test_ME_1\Project1.dproj"
10:18:42-120 AfterCompile, succeeded: +
10:18:42-121 root: "D:\Dev-Delphi XE11\Testprojekte\Test_ME_1\Project1"
10:18:42-122 isDpk: -
10:18:42-123 binary: "D:\Dev-Delphi XE11\Testprojekte\Test_ME_1\Win32\Debug\Project1.exe"
10:18:42-124 map file: "D:\Dev-Delphi XE11\Testprojekte\Test_ME_1\Win32\Debug\Project1.map"
10:18:42-125 PatchBinary, compileSucceeded: +, binary: "D:\Dev-Delphi XE11\Testprojekte\Test_ME_1\Win32\Debug\Project1.exe", root: "D:\Dev-Delphi XE11\Testprojekte\Test_ME_1\Project1"
10:18:42-149 binary successfully opened
10:19:42-156 Warning: Mapping binary file failed (259).
10:19:42-158 PatchBinary done
10:19:42-159 AfterCompile done
10:19:42-160 AfterCompile event, succeeded: +, isCodeInsight: -

edit: I deactivated anti virus software to see if this is the reason but no, also without any protection it fails

HTH,
Ulrich
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Re: Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

Post by madshi »

Does this only happen if you create a new project? Or does it also happen if you restart the Delphi IDE, then switch between the 2 newly created projects and compile them alternatingly?
uko
Posts: 25
Joined: Thu May 29, 2008 2:14 pm

Re: Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

Post by uko »

no, I can see this also when restarting IDE, loading the first proj, build and run it, then closing and loading the second project.
When I only load and build the projects but do not run the first one on debugger, everything is fine.
obones
Posts: 66
Joined: Fri May 15, 2009 11:47 am

Re: Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

Post by obones »

Ah I found it!

And I'm glad to say that madExcept is not the culprit, but sad that I wasted your time.
Basically, I'm configuring my debug desktop to show the "Threads" pane by default. And this is actually an issue with Delphi's debugger under Windows 11:

https://blogs.embarcadero.com/windows-1 ... udio-11-1/

This appears to be fixed in 11.3 but was not backported to 10.4.2

madExcept was just helping seeing this issue much more often, but it's not strictly required for it to be there to stumble on it.

Sorry for all the noise
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Re: Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

Post by madshi »

No problem at all, I'm happy to hear that madExcept is innocent... :D
uko
Posts: 25
Joined: Thu May 29, 2008 2:14 pm

Re: Unstable debug in 10.4.2 when madExceptWizard_.bpl is loaded

Post by uko »

Great! I just retested this on Delphi 11.3 compiling all using 64 Bit and the problem is gone too. It reappears as soon as I build AND RUN a 32 Bit application and then change the project: now independent of 32 or 64Bit the new project fails to patch. So also 11.3 has a problem on this area (beside: this I'm on Windows 10)
And this was exactly the situation that lead me to that problem.

But good to know how to work around it.
Post Reply