简体   繁体   English

Delphi XE4 64bit _TExitDllException

[英]Delphi XE4 64bit _TExitDllException

Project based on COM technology. 基于COM技术的项目。 I have logged error by JCL on Delphi XE4 64Bit (SKGeneral64 is COM Dll): 我在Delphi XE4 64Bit上记录了JCL的错误(SKGeneral64是COM Dll):

ERR (ThreadID=14C8 14.02.2014 16:43:14:274) - Exception class: _TExitDllException
Exception address: 000000000536DBAE
Stack list, generated 14.02.2014 16:43:14
[000000000536DBAE] System.ExitDll + $3E
[000000000536DCF4] System.@Halt0 + $54
[000000000536D5E3] System.@StartLib + $123
[0000000005375FA2] SysInit.@InitLib + $92
[00000000056D7938] SKGeneral64.SKGeneral64 + $38
[000000007777C76C] Unknown function at RtlUserThreadStart + $26C
[000000007777C42F] Unknown function at LdrInitializeThunk + $10F
[000000007777C32E] LdrInitializeThunk + $E
----------------------------------------------------------------------------------------------------
System   : Windows 7 Professional, Version: 6.1, Build: 1DB1, "Service Pack 1"
Processor: Intel, Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz, 2960 MHz MMX
----------------------------------------------------------------------------------------------------
Module: C:\PROGRA~2\SKBKON~1\Active\Bin\SKGENE~2.DLL   Modified: 14.02.2014 16:42:37
Version: 1.0.0.0  Description: 

What the reason of it? 是什么原因呢? Could it be the cause of the memory leaks and memory fragmentation? 它可能是内存泄漏和内存碎片的原因吗?

Having done a bit of digging around, it seems that this exception is expected and is the way that a thread returns its exit code when the thread terminates. 做了一些挖掘,看起来这个异常是预期的,并且是线程在线程终止时返回其退出代码的方式。

Here's how it goes. 这是怎么回事。 A call is made to System.ExitDll which does this: 调用System.ExitDll执行此操作:

procedure ExitDll(Context: PInitContext);
var
  ResultExitCode: Integer;
begin
  Context^ := Context.OuterContext^;
  ResultExitCode := ExitCode;
  ExitCode := 0;
  //raise _TExitDllException.Create(ResultExitCode);
  _RaiseExcept(_TExitDllException.Create(ResultExitCode));
end;

That's what raises the exception. 这就是引发异常的原因。 The exception is handled in _HandleExitDllException : 该异常在_HandleExitDllException处理:

function _HandleExitDllException: Integer;
var
  ExceptionObject: TObject;
begin
  Result := -1;
  ExceptionObject := ExceptObject;
  if ExceptionObject is _TExitDllException then
    Result := _TExitDllException(ExceptionObject).ExitCode
  else
    _UnhandledException;
  _DoneExcept;
end;

This code read the exit code from the exception and returns that value to the caller. 此代码从异常中读取退出代码并将该值返回给调用者。 You can't see any code in the RTL that calls _HandleExitDllException , presumably because that is linked in magically by the compiler/linker. 您无法在RTL中看到调用_HandleExitDllException任何代码,可能是因为它由编译器/链接器神奇地链接。

Essentially this is a false positive from your error reporting software. 从本质上讲,这是您的错误报告软件的误报。 This exception is part of normal program execution. 此异常是正常程序执行的一部分。 There is nothing to worry about. 没有什么可担心的。 Apart from your error reporting code which seems to deficient. 除了您的错误报告代码似乎有缺陷。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM