Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible obscure causes for Abstract Error in Delphi?

Tags:

delphi

fastmm

In a Delphi 7 project we installed FastMM. Soon after that we noticed one of the forms started to issue Abstract Error message on close. I have debugged this extensively and I can't find the reason so far. The usual reason for this error message doesn't seem to apply here. The application doesn't define abstract classes. I also searched the form for a possible use of TStrings or something like that. Most importantly, we didn't (well, we think we didn't) make any changes to this form. It just broke.

  1. Are there some other possible causes for this error besides trying to call unimplemented method?
  2. Is there some possibilty that FastMM has enabled some obscure bug in the application, that remained hidden until now?

If the answer to these questions is no, then I'll just continue to search for an unimplemented method call, relieved that I am not missing something else.

like image 781
Escape Velocity Avatar asked Aug 12 '12 18:08

Escape Velocity


People also ask

What is abstract error?

Class AbstractMethodErrorThrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.

How do I show error messages in Delphi?

To simply display the system standard error dialog, you can use MessageDlg : MessageDlg('Error Message', mtError, [mbOK], 0); The caption of the window in this case is simply "Error".

What is an abstract method in Delphi?

In Delphi terms, it is called an abstract method. It is an abstraction of the method, forcing the child classes (the car models) to flesh out the details of the method for itself. An example For our example, we will keep it simple. We'll look at the class of polygons, such as triangles, squares, pentagons, and so on.

What is an abstract error in Java?

"Abstract" means something like "I feel something's wrong here, I just can't tell you what". The "Abstract error" means that a method is called in an object, and there is no code to do it. Abstract methods are used in base classes, classes that are not meant to be used as-is.

What is abstract error in TList?

The "Abstract error" means that a method is called in an object, and there is no code to do it. Abstract methods are used in base classes, classes that are not meant to be used as-is. You find TComboboxStrings and many, many more), while TList has none of them.

How do I create an abstract member property in Delphi?

Delphi does not support abstract member properties directly. To implement an abstract property, make use of abstract methods. That is, you can read a GetPropertyX abstract function and write to a SetPropertyX abstract procedure. In effect, creating an abstract property.


1 Answers

If there is memory corruption then all sort of errors can be raised and it is very difficult to find the cause.

To answer your questions: 1) Yes abstract error can also be caused by memory corruption, and 2) Yes enabling FastMM can make bugs visible that normally pass unnoticed (but should still be fixed).

Some general advice for finding memory errors:

  1. Try "FullDebugMode" setting in FastMM.
  2. Make sure everything you Create is matched with a Free.
  3. Make sure nothing is freed more than once.
  4. Make sure an object is not used after it has been freed (or before it has been created).
  5. Turn on hints and warnings (and fix them when they occur).
like image 95
Ville Krumlinde Avatar answered Oct 05 '22 10:10

Ville Krumlinde