Delphi 7 exception thrown

I have really complex legacy code that I worked on to cope with the collection of large pieces of data. I could not find the exact cause of the failures, and I try to solve it in different ways or at least restore it well. The last thing I did was to compromise the code in

try
  ...
except
  cleanup();
end;

to force myself to behave. But cleaning is never done. In what circumstances does the exception not get? This may be due to a memory overflow or something, as the application collects quite a lot of data.

Oh and the exception that I received before adding trywas "Access Violation" (what else?), And the CPU window indicates very low addresses. Any ideas or pointers would be greatly appreciated!

+3
source share
7 answers

A "very low address" probably means that someone was trying to call a virtual method on an object that was not actually there (i.e. there was a "zero"). For instance:

TStringList (zero) .clear;

The first part is very mysterious. I do not know how this can happen.

I think you should try to catch this exception with madExcept . This has not failed me yet. (Disclaimer: I do not use D7.)

+9
source

A crashed stack or a stack overflow can cause irreparable damage to the structures in the stack that structured exception handling (SEH) on Windows uses to look up the actual exception handlers.

(, , ) , "" , . clobbered, OS, , , .

: , .

+7

. , , , , . , - " " . , , . FastMM4 - .

http://sourceforge.net/projects/fastmm/

d7 .

/ , , .

, 0x00001000 , nil. myStringList: = ; myStringList.Clear;

, .

, / , , . Controls.pas; mmsys.pas ..

DLL, . - / / DLL.

MadExcept , ... , , , , .

- , ? , , .

.

+2

COM-, safecall. / EOleException, try/except . EOleException .

try
...
except
on E: EOleException do
...
end;

, , . , , delphi.

IDE delhi. e .

+1

, Barry...

, . ,

try
  OutputDebugString('entering part abc');
  ... // part abc code here
except
  OutputDebugString('horror in part abc');
  raise;
end;
...   
try
  OutputDebugString('entering in part xyz');
  ... // part xyz code here
except
  OutputDebugString('horror in part xyz');
  raise;
end;

DebugView ... ( GUI, ).
, , .

+1

, DLL COM-? , , FPUExcpetion - , Delphi. Delphi , FPUExcpetion ​​, , NAN. . math.pas FPUExceptionmask

0

, madExcept . , DLL try. .

( @Gung , ), ' . SysUtils ( ) DPR, Catching goodness. , - , , .

0

Source: https://habr.com/ru/post/1698084/


All Articles