| | Why it helps | |--------------|------------------| | Only enable MadExcept in the main EXE | Prevents duplicate hooks and confusing cross-BPL stack traces. | | Use map files for each BPL | Add every BPL’s map file in MadExcept settings → "Append map file". This replaces generic [madexceptbpl] entries with precise unit names. | | Set MadExcept BPL as first in runtime packages | Guarantees top-level exception interception. | | Disable "HandleExceptions" in BPLs | In BPL projects, set MadExcept.HandleExceptions := False so all exceptions propagate to the main EXE’s MadExcept. | | Regularly update MadExcept | Newer versions (5.x, 6.x) handle BPL chains and top-most windows better. | Part 6: Real-World Example – Fixing a “BPL Top Error” Symptom: A developer posts on a forum: “My Delphi app crashes after loading Plugin1.bpl. MadExcept shows only ‘madexceptbpl top’ in the call stack, no line numbers.”
[ExceptionBox] TopMost=1 If you are truly diving into low-level debugging (using WinDbg, IDA Pro, or Delphi’s CPU view), top may be an artifact of MadExcept’s stack frame walking logic.
One search query that has been gaining traction among enterprise Delphi developers is . At first glance, it looks like a fragmented stack trace element or a mis-typed compiler directive. But for those in the know, it represents a specific intersection of MadExcept, runtime packages (BPLs), and application performance/priority settings.
call TopOfStack -> returned 0x... In poorly symbolized call stacks, this becomes [madexceptbpl] top .
Inside madExcept.pas , there is a function called TopOfStack (or GetTopOfStack ), which returns the highest memory address of the current thread’s stack. When an exception occurs in a BPL, MadExcept sometimes logs the instruction before the crash as:
Plugin1.bpl was compiled with MadExcept enabled (embedding its own copy). The main EXE also had MadExcept. The two copies conflicted, and the stack trace was overwritten.
| | Why it helps | |--------------|------------------| | Only enable MadExcept in the main EXE | Prevents duplicate hooks and confusing cross-BPL stack traces. | | Use map files for each BPL | Add every BPL’s map file in MadExcept settings → "Append map file". This replaces generic [madexceptbpl] entries with precise unit names. | | Set MadExcept BPL as first in runtime packages | Guarantees top-level exception interception. | | Disable "HandleExceptions" in BPLs | In BPL projects, set MadExcept.HandleExceptions := False so all exceptions propagate to the main EXE’s MadExcept. | | Regularly update MadExcept | Newer versions (5.x, 6.x) handle BPL chains and top-most windows better. | Part 6: Real-World Example – Fixing a “BPL Top Error” Symptom: A developer posts on a forum: “My Delphi app crashes after loading Plugin1.bpl. MadExcept shows only ‘madexceptbpl top’ in the call stack, no line numbers.”
[ExceptionBox] TopMost=1 If you are truly diving into low-level debugging (using WinDbg, IDA Pro, or Delphi’s CPU view), top may be an artifact of MadExcept’s stack frame walking logic. madexceptbpl top
One search query that has been gaining traction among enterprise Delphi developers is . At first glance, it looks like a fragmented stack trace element or a mis-typed compiler directive. But for those in the know, it represents a specific intersection of MadExcept, runtime packages (BPLs), and application performance/priority settings. | | Why it helps | |--------------|------------------| |
call TopOfStack -> returned 0x... In poorly symbolized call stacks, this becomes [madexceptbpl] top . | | Set MadExcept BPL as first in
Inside madExcept.pas , there is a function called TopOfStack (or GetTopOfStack ), which returns the highest memory address of the current thread’s stack. When an exception occurs in a BPL, MadExcept sometimes logs the instruction before the crash as:
Plugin1.bpl was compiled with MadExcept enabled (embedding its own copy). The main EXE also had MadExcept. The two copies conflicted, and the stack trace was overwritten.