You are not logged in.
Pages: 1
Delphi compiler throw a _TExitDllException during load/unload a x64 dll compiled by delphi (as far as I understand from System.pas sources - to set correct exitcode).
This exception is catches inside system.pas, but TSynLog put it to log, so I got many EXC log entries during executable terminates.
I can't use a TSynLog.ExceptionIgnore because there is no exception class for such errors and on the TSynLog level I see it as EExternalException
May be someone know a workaround?
Offline
Yes, it's a problem for me too, for x64.
Offline
If EExternalException is all you can get out of those exceptions, then there is no way to use current ExceptionIgnore implementation without breaking existing code. But this feature could easily be implemented, based on Exception.Message parsing. Following idea is for discussion:
- Problem is that EExternalException is all you have over here.
- Adding EExternalException to TSynLogFamily.ExceptionIgnore is a bad idea because we want to exclude some special EExternalExceptions, not all.
- I'd suggest to add following public function to TSynLogFamily:
procedure AddExceptionIgnoreWithCallback(const aExceptionClass: TClass; const aIgnoreCallback: TSynLogIgnoreExceptionCallback);
with TSynLogIgnoreExceptionCallback being defined as:
TSynLogIgnoreExceptionCallback=function(const aMessage: string):boolean;
AddExceptionIgnoreDetailed can use some kind of DynArray for storing records with Callback function pointer and Exception fields. That private DynArray can be easisly checked for EExternalException class matches, then function(aMessage:String):boolean callback will be called to check for exclusion. Your custom function would look like:
function MyExceptionTextMatch(const aMessage:string):boolean;
begin
result:=aMessage='whatever, leftstr(), ....';
end;
What do you think?
Last edited by oz (2016-10-08 10:13:57)
Offline
Please try http://synopse.info/fossil/info/898216c88a
Edit: perhaps http://synopse.info/fossil/info/d79d2be862 is better...
Note that this issue does not exist any more since Delphi XE6, which get rid of this _TExitDllExecption, which made a memory leak!
Offline
Arnaud, you're a magician! Now my log files is clean from errors. Thanks a lot!
The x64 Delphi project is a big pain for me: XE2 can't debug x64 under Win8, lucky me, we already had bought one license for XE4, so I can use it for debugging x64 BUT regular expressions (TRegExp) is broken in XE4 (we try to use a PCRE directly). And now you note about a memory leak up to XE5....
Looks like the time for me to switch to the Free Pascal (or spend $1,405.00 for Delphi 10.1 Berlin)
Offline
Pages: 1