Delphi application enters into endless loop of Access Violation exceptions - how to catch the trace with MadExcept which generates reports endlessly?

99 views Asked by At

There is uncertain, probabilistic situation when my Delphi application stops and enters into endless loop of generating and presenting Access Violation exceptions - the exception dialogs just pops up one over another. When I have compiled application with madExcept on, then exception messages are not show, of course, but the madExcept progress dialogs for generating bug report is being shown again and again. I have no chance to see any single report.

My question is - how can I configure madExcept or somehow other trace this situation.

I tried madExcept check-out "on exception auto actions - various actions - automatically save bug report - only if bug report doesn'g get sent" or "on exception auto actions - application control - automatically continue application" but without result. I didn't managed to find such automatically saved buf reports on my disk (where are they saved?) and the application continued to run.

What else can I do?

My exception is generated probabilistically in the event code which works quite good the first 10-20 seconds after trying it. Here is the code (it is Delphi 6 application, from around millenium age):

procedure TInvoiceForm.DataGridHotTrackNode(Sender: TObject;
  AHotTrackInfo: TdxTreeListHotTrackInfo; var ACursor: TCursor);
var
  HitInfo: TdxTreeListHitInfo;
  GridPoint: TPoint;
  AColumn: TdxDBTreeListColumn;
  ARow: Integer;
  Tmp: String;
begin
  if IsPopupShowing then Exit;
  IsPopupShowing := True;
  try
    GridPoint := DataGrid.ScreenToClient(Mouse.CursorPos);

    HitInfo:=DataGrid.GetHitInfo(GridPoint);

    if ( (HitInfo.hitType = htColumn) or (HitInfo.hitType = htLabel) ) then begin
      if Assigned(HitInfo.Node) then
        if {Assigned(HitInfo.Node.Values[HitInfo.Column])} (1=1) then begin
          try
            if HitInfo.Column<HitInfo.Node.CountValues then
              if not VarIsNull(HitInfo.Node.Values[HitInfo.Column]) then
                Tmp:=HitInfo.Node.Values[HitInfo.Column]
              else
                Tmp:=''
            else
              Tmp:='';
          except
            on E: Exception do begin
              Tmp:='';
            end;
          end;

          if PopupForm <> nil then
            FreeAndNil(PopupForm);

          PopupForm := TForm.Create(nil);
          try
            // Configure PopupForm based on the Node information
            // ...

            if Assigned(PopupForm) then
            PopupForm.Caption:=Tmp;

            if Assigned(PopupForm) then
            PopupForm.Position := poDesigned;

            if Assigned(PopupForm) then
            PopupForm.Left := Mouse.CursorPos.X; // Adjust as needed

            if Assigned(PopupForm) then
            PopupForm.Top := Mouse.CursorPos.Y;  // Adjust as needed

            if Assigned(PopupForm) then
            PopupForm.Show;
          except
            FreeAndNil(PopupForm);
          end;
        end;
    end else begin
      if Assigned(PopupForm) then
        FreeAndNil(PopupForm);
    end;
  finally
    IsPopupShowing := False; 
  end;
end;

It seems to me that all the guards are here. I have made even the guard against concurrent running of events, although it should never happen anyway because Delphi applications have just one main UI thread.

p.s. I am trying to create popup window for the cells of TdxDBGrid, this popup dialog should popup and close automatically when the user moves the mouse inside/outside the particular cells.

1

There are 1 answers

0
AmigoJack On
  • tab on exception auto actions, category various actions, checkbox automatically save bug report: tick that.
    madExcept auto action settings
  • tab save settings, category basic bug report file settings, edit box bug report file: check which filename is mentioned there and/or change to what you want.
    madExcept save settings
    The documentation even clearly says:

    You have two possibilities how a bug report can be saved: You can specify only a file name or a full file path. If you only specify a file name and the user then presses the "save bug report" button, madExcept opens a "save as" box. If you only specify a file name and the bug report shall be be saved automatically, it's saved into the same folder where the current process' executable file is stored. If you specify a full path, no "save box" is shown, even if the user presses on the "save bug report" button, instead the bug report file is directly written to the specified path.

By default the file created/continued is named bugreport.txt and it resides at the same place where your .exe runs. It can't be easier.