This error looks like you are using FastMM for memory management.
The error indicates that you are referring a pointer that has been cleared by FastMM with the DebugFillDWord value.
It means that you are using an interface that references to an object that has already been freed.
It also means you have not enabled CatchUseOfFreedInterfaces.
In order to change those, and to debug, you cannot do with the stock FastMM that comes with Delphi.
You will need to download FastMM (version 4.94).
After download:
Like gabr already mentions, inside FastMM4Options.inc, make sure you enable FullDebugMode and CatchUseOfFreedInterfaces (which disables CheckUseOfFreedBlocksOnShutdown, but you are not interested in the latter right now).
You might want to enable RawStackTraces as well; that depends if your current stack trace is good enough.
When you have done these settings, then run your app with FastMM through the debugger and put a breakpoint on this method inside the FastMM4 unit:
procedure TFreedObject.InterfaceError;
I have modified my FastMM4 unit a bit to get me more context info; I can share that with you (I have already mailed it to the FastMM4 team, but it has not been included in the official sources yet).
I wrote a pretty dense blog article on debugging using FastMM that might help you.
Drop a note here if that needs further explanation :-)
Good luck, and let us know if you need further directions.
–jeroen
Edit: 20100701 – emphasised the bits mentioned in Brian’s comment.






Paul Thornton said
We eventually found our bug. It was an incorrect weak reference in a reverse linked list of interfaced objects. Is it possible to post your FastMM changes ready for next time we run into a similar issue?
jpluimers said
I don’t have a demo in my current repository, but in the old better office repository is a demo: http://bo.codeplex.com/SourceControl/latest#Native/Delphi/Apps/InterfaceConstParmetersAndPrematureFreeing/
It hasn’t been adapted to the official code changes that have been incorporated in FastMM some 5 years ago. It’s easier to find them back in my GIT copy of the official SVN repository. Here is the FastMM change-set: https://bitbucket.org/jeroenp/fastmm/commits/982d11370164d89ef124f02d45080210700ca11a
You need the
FullDebugModeCallBacksconditional define.