Page 1 of 1

Small amount of Exceptions ignoring try except blocks..

PostPosted: Mon Jan 14, 2019 10:16 am
by agrotz
Hi there,

we noticed that a small amount (~1%) of specific exceptions can not be handled by try-except-blocks ...
e.g.

Code: Select all
    if FileExists(FileRun.Directory + FileRun.FileName) then
    begin
      try
       FileRun.Execute
      except
       on e:Exception do
       begin
         MessageDlg(Format(rs_SiGeFail,[FileRun.Directory + FileRun.FileName,E.Message]), mtInformation, [mbOK], 0);
       end;
      end;
    end else
      MessageDlg(Format(rs_FileNotFound, [FileRun.Directory + FileRun.FileName]), mtWarning, [mbOK], 0);


Well, we expected that every exception raised from FileRun.Execute will be handled by the try-except block .. but it's not.

Code: Select all
date/time          : 2018-09-19, 15:19:32, 4ms
operating system   : Windows 7 x64 Service Pack 1 build 7601
system language    : German
system up time     : 8 hours 14 minutes
program up time    : 2 minutes 34 seconds
processors         : 4x Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
physical memory    : 12815/16253 MB (free/total)
free disk space    : (C:) 40,16 GB (D:) 197,18 GB
display mode       : 1920x1080, 32 bit
process id         : $204c
allocated memory   : 174,79 MB
largest free block : 1,95 GB
executable         : productprg.exe
exec. date/time    : 2018-07-12 16:43
version            : 7.0.0.16
compiled with      : Delphi 10.1 Berlin
madExcept version  : 4.0.20
callstack crc      : $251c1764, $3338599f, $6058db08
exception number   : 1
exception class    : Exception
exception message  : Zugriff verweigert.

main thread ($283c):
02e2e484 +140 productprg.exe Vcl.ExtActns     529  +0 TCustomFileRun.ExecuteTarget
004dd8fb +033 productprg.exe System.Classes           TComponent.ExecuteAction
006513e6 +01a productprg.exe Vcl.Forms                ProcessExecute
006514a4 +020 productprg.exe Vcl.Forms                TCustomForm.CMActionExecute
0067ff2a +2be productprg.exe Vcl.Controls             TControl.WndProc
00684a75 +5e9 productprg.exe Vcl.Controls             TWinControl.WndProc
0064c3ed +64d productprg.exe Vcl.Forms                TCustomForm.WndProc
0170d8b1 +019 productprg.exe dxRibbonForm    2203  +2 TdxCustomRibbonForm.WndProc
0094d6a2 +00a productprg.exe cxControls     12234  +1 TcxWindowProcLinkedObject.DefaultProc
00d9763f +02f productprg.exe dxShadowWindow   358  +7 TdxShadowWindow.OwnerWindowWndProc
0094d6a2 +00a productprg.exe cxControls     12234  +1 TcxWindowProcLinkedObject.DefaultProc
026d6c68 +00c productprg.exe dxSkinsForm     1251  +2 TdxSkinWinController.DefWndProc
026d71be +00a productprg.exe dxSkinsForm     1476  +2 TdxSkinCustomFormController.DefWndProc
026d82da +072 productprg.exe dxSkinsForm     2110 +15 TdxSkinCustomFormController.WndProc
0094d6a2 +00a productprg.exe cxControls     12234  +1 TcxWindowProcLinkedObject.DefaultProc
029820e9 +01d productprg.exe dxUIAdorners    4431  +3 TdxBadges.OwnerWindowWndProc
0094d6a2 +00a productprg.exe cxControls     12234  +1 TcxWindowProcLinkedObject.DefaultProc
0297e311 +035 productprg.exe dxUIAdorners    2267  +3 TdxGuideLayeredWindow.OwnerWindowWndProc
0094d966 +00a productprg.exe cxControls     12345  +1 TcxWindowProcLinkedObjectList.WndProc
0067fb64 +024 productprg.exe Vcl.Controls             TControl.Perform
0065772b +023 productprg.exe Vcl.Forms                TApplication.DispatchAction
00654ef7 +46f productprg.exe Vcl.Forms                TApplication.WndProc
004deb88 +014 productprg.exe System.Classes           StdWndProc
76ed0137 +02b ntdll.dll                             KiUserCallbackDispatcher
758f96c0 +047 USER32.dll                            SendMessageW
0067ac3c +018 productprg.exe Vcl.Controls             SendAppMessage
00549c18 +098 productprg.exe Vcl.ActnList             TCustomAction.Execute
030c7c58 +184 productprg.exe Haupt           5061 +22 TfrmHaupt.acStartExecute
004dde2b +00f productprg.exe System.Classes           TBasicAction.Execute
00549c06 +086 productprg.exe Vcl.ActnList             TCustomAction.Execute
004ddc97 +013 productprg.exe System.Classes           TBasicActionLink.Execute
016344ce +056 productprg.exe dxBar          23558  +5 TdxBarItem.DoClick
01634447 +03b productprg.exe dxBar          23545  +5 TdxBarItem.DirectClick
01666f27 +11f productprg.exe dxBar          47457 +29 TdxBarItemControl.ControlUnclick
0166ac16 +05a productprg.exe dxBar          49588  +6 TdxBarButtonControl.ControlUnclick
01672103 +0eb productprg.exe dxBar          53263 +18 TCustomdxBarControl.DoLButtonUp
0163abee +0de productprg.exe dxBar          26641 +24 TdxBarControl.DoLButtonUp
0167099a +02a productprg.exe dxBar          52555  +6 TCustomdxBarControl.WMLButtonUp
01631fbd +031 productprg.exe dxBar          22288  +8 TdxBarDockedControl.WMLButtonUp
0067ff2a +2be productprg.exe Vcl.Controls             TControl.WndProc
00684a75 +5e9 productprg.exe Vcl.Controls             TWinControl.WndProc
01671593 +1bb productprg.exe dxBar          52908 +40 TCustomdxBarControl.WndProc
0163c823 +163 productprg.exe dxBar          27513 +52 TdxBarControl.WndProc
00684094 +02c productprg.exe Vcl.Controls             TWinControl.MainWndProc
004deb88 +014 productprg.exe System.Classes           StdWndProc
758f7885 +00a USER32.dll                            DispatchMessageW
00655b17 +0f3 productprg.exe Vcl.Forms                TApplication.ProcessMessage
00655b5a +00a productprg.exe Vcl.Forms                TApplication.HandleMessage
00655e8d +0c9 productprg.exe Vcl.Forms                TApplication.Run
75b0343b +010 kernel32.dll                          BaseThreadInitThunk


we have no special handler for handled-exceptions active...
so i guess it muss be a bug of mad-except or a disturbance of an other application like an AV ?

Re: Small amount of Exceptions ignoring try except blocks..

PostPosted: Mon Jan 14, 2019 1:38 pm
by madshi
Most probably "TCustomFileRun.ExecuteTarget" has a try..except block internally which then calls Application.HandleException, or something like that?