Possible obscure causes for Abstract Error in Delphi?

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).

"It just broke" - it was probably always broke but now you know.

I have seen problems when closing a form as part of a button event. The form gets destroyed and then the remainder of the button messages get dispatched to a no-longer existing button. The Release method avoids this by (from memory) posting a wm_close message back to the form


You could try to add u_dzAbstractHandler to your project. It should raise the abstract error where the method was called, so it is easier to debug it. Of course this only helps when the error occurs when running in the debugger.

https://osdn.net/projects/dzlib-tools/scm/svn/blobs/head/dzlib/trunk/src/u_dzAbstractHandler.pas

Tags:

Delphi

Fastmm