External Exception EEFFACE in Delphi
在使用Delphi 2009调试我的应用程序时,我有时会发生以下异常:
(来源:beholdgenealogy.com) sub>
这只是偶尔发生,但在按下OK之后,我的IDE和程序都可能会冻结。如果我很幸运,我有时可以在Delphi中进行File / SaveAll,但有时候我不能。无论哪种方式我都被卡住,然后我唯一能做的就是使用Windows任务管理器来关闭Delphi。当然,如果我无法SaveAll,那么我将丢失自上次保存以来所做的所有编辑。
我安装了所有Delphi 2009更新,包括Update 4.我还安装了IDE Fix Pack 2009 2.9。
EurekaLog为我捕获了错误,错误报告给出了以下调用堆栈:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | Call Stack Information: ----------------------------------------------------------------------------------------------------------- |Address |Module |Unit |Class |Procedure/Method |Line | ----------------------------------------------------------------------------------------------------------- |Running Thread: ID=5068; Priority=0; Class=; [Main] | |---------------------------------------------------------------------------------------------------------| |205669C6|dbkdebugide120.bpl |Debug.pas |TDebugger |DBKWndProc |11598[6] | |777DE49A|ntdll.dll | | |KiUserExceptionDispatcher | | |7705E0CB|kernel32.dll | | |RaiseException | | |03E8E3E8|dcc120.dll |WRITEOBJ.OBJ | |C62_0 | | |03E3066D|dcc120.dll |SYMTAB.OBJ | |MakeOverloadedPropertyList| | |03E3064C|dcc120.dll |SYMTAB.OBJ | |MakeOverloadedPropertyList| | |03E30D76|dcc120.dll |SYMTAB.OBJ | |EnterMethod | | |03E30D6C|dcc120.dll |SYMTAB.OBJ | |FindBaseClassMethod | | |03DE8D30|dcc120.dll |DECL.OBJ | |PatchConstRecordParameter | | |777DE590|ntdll.dll | | |RtlLeaveCriticalSection | | |03DBBF70|dcc120.dll |BROWCMGR.OBJ | |PutToAddress | | |03DBC436|dcc120.dll |BROWCMGR.OBJ | |GetNearestSymName | | |777DE550|ntdll.dll | | |RtlEnterCriticalSection | | |219C5BDA|win32debugide120.bpl|Win32Debug.pas |TWin32LinkUnit |GetCppDebugHook |1923[3] | |219C5BB8|win32debugide120.bpl|Win32Debug.pas |TWin32LinkUnit |GetCppDebugHook |1920[0] | |219C644E|win32debugide120.bpl|Win32Debug.pas |TWin32Process |DoLinkUnitCreated |2198[10] | |50001CE4|rtl120.bpl |System.pas | |InterlockedIncrement |3200[0] | |5000CD59|rtl120.bpl |System.pas |TInterfacedObject |_AddRef |21759[1] | |2055F40F|dbkdebugide120.bpl |Debug.pas |TProcess |LinkUnitCreated |8454[1] | |2055F408|dbkdebugide120.bpl |Debug.pas |TProcess |LinkUnitCreated |8453[0] | |2055CEC7|dbkdebugide120.bpl |Debug.pas |TEvaluatorCallback|ntfyLinkUnitDelta |7167[7] | |77050DF0|kernel32.dll | | |VirtualProtect | | |50003FE4|rtl120.bpl |System.pas | |_ReallocMem |3512[0] | |500093F6|rtl120.bpl |System.pas | |_LStrSetLength |15889[38]| |50004508|rtl120.bpl |System.pas | |Move |4414[0] | |5001DDB9|rtl120.bpl |SysUtils.pas | |StrLCopy |7852[5] | |5007E559|rtl120.bpl |UxTheme.pas | |DrawThemeTextEx |5226[2] | |5007E524|rtl120.bpl |UxTheme.pas | |DrawThemeTextEx |5224[0] | |2110A98D|vclactnband120.bpl |ThemedActnCtrls.pas|TThemedMenuButton |DoDrawText |488[23] | |50009E88|rtl120.bpl |System.pas | |_UStrClr |16961[0] | |2110A9A2|vclactnband120.bpl |ThemedActnCtrls.pas|TThemedMenuButton |DoDrawText |490[25] | |75FC7BFE|USER32.dll | | |CallNextHookEx | | |20AA9C5E|designide120.bpl |DeskUtil.pas | |SetFocusHook |435[4] | |210E8B83|vclactnband120.bpl |ActnMenus.pas | |CallWindowHook |741[20] | |50057F7D|rtl120.bpl |Classes.pas |TComponent |UpdateAction |11881[1] | |50006EE4|rtl120.bpl |System.pas | |_CallDynaInst |10209[0] | |501EA802|vcl120.bpl |Forms.pas | |ProcessUpdate |6739[1] | |50006F3C|rtl120.bpl |System.pas |TObject |InheritsFrom |10281[0] | |50006E1A|rtl120.bpl |System.pas | |_IsClass |10107[1] | |50006E0C|rtl120.bpl |System.pas | |_IsClass |10106[0] | |501EA870|vcl120.bpl |Forms.pas | |TraverseClients3 |6756[5] | |501EA818|vcl120.bpl |Forms.pas | |TraverseClients3 |6751[0] | |501EA88A|vcl120.bpl |Forms.pas | |TraverseClients3 |6756[5] | |50047748|rtl120.bpl |Classes.pas |TList |Get |3366[0] | |501C865E|vcl120.bpl |Controls.pas |TWinControl |GetControl |8473[4] | |50006F3C|rtl120.bpl |System.pas |TObject |InheritsFrom |10281[0] | |50006E1A|rtl120.bpl |System.pas | |_IsClass |10107[1] | |501C8668|vcl120.bpl |Controls.pas |TWinControl |GetControlCount |8478[0] | |501EA87B|vcl120.bpl |Forms.pas | |TraverseClients3 |6756[5] | |501EA818|vcl120.bpl |Forms.pas | |TraverseClients3 |6751[0] | |501EA8E2|vcl120.bpl |Forms.pas |TCustomForm |CMActionUpdate |6778[11] | |501C565A|vcl120.bpl |Controls.pas |TControl |WndProc |6642[91] | |501C5388|vcl120.bpl |Controls.pas |TControl |WndProc |6551[0] | |501C9CE7|vcl120.bpl |Controls.pas |TWinControl |WndProc |9336[136]| |75FC7C2B|USER32.dll | | |CallNextHookEx | | |75FCC477|USER32.dll | | |InvalidateRect | | |75FCC41E|USER32.dll | | |InvalidateRect | | |75FCC49D|USER32.dll | | |CallWindowProcW | | |75FCC487|USER32.dll | | |CallWindowProcW | | |205669A5|dbkdebugide120.bpl |Debug.pas |TDebugger |DBKWndProc |11595[3] | |500591DC|rtl120.bpl |Classes.pas | |StdWndProc |12703[8] | |75FC9467|USER32.dll | | |IsWindowVisible | | |75FC8B0B|USER32.dll | | |DispatchMessageW | | |75FC8B01|USER32.dll | | |DispatchMessageW | | |501EEABD|vcl120.bpl |Forms.pas |TApplication |ProcessMessage |9660[30] | |501EE9A0|vcl120.bpl |Forms.pas |TApplication |ProcessMessage |9630[0] | |501EEB02|vcl120.bpl |Forms.pas |TApplication |HandleMessage |9690[1] | |501EEAF8|vcl120.bpl |Forms.pas |TApplication |HandleMessage |9689[0] | |501EEE2D|vcl120.bpl |Forms.pas |TApplication |Run |9827[26] | |501EED64|vcl120.bpl |Forms.pas |TApplication |Run |9801[0] | |004259E6|bds.exe |bds.dpr | |bds |198[8] | |770CECC9|kernel32.dll | | |BaseThreadInitThunk | | ----------------------------------------------------------------------------------------------------------- |
如您所见,所有调用堆栈都在Delphi和Windows中。它根本不连接到程序中的任何行。
我查看了网页:外部异常EEFFACE并将其从德语翻译成英语,但它似乎是在谈论Delphi C ++,而我根本不使用C ++。
我的问题是我不知道是什么导致这种情况,因为它不会一直发生。我甚至不知道在哪里寻找它或如何追踪它。
有人知道这是什么以及我如何追踪它或至少阻止它发生?
EurekaLog的Alex发布了这个以回应我在他们论坛上的查询:
I think it may be a bug in Delphi's
debugger. Possibly related to
evaluation tooltips or something
similar.See for yourself - we have an C++
exception in system module (EEFFACE is
a special code for VCL exception. When
VCL encounters an unknown C++
exception - it wraps it into
EExternalException object with code =
EEFFACE) and call stack includes
Delphi debugger's units:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |205669C6|dbkdebugide120.bpl |Debug.pas |TDebugger |DBKWndProc |11598[6] | |7705E0CB|kernel32.dll | | |RaiseException | | |03E8E3E8|dcc120.dll |WRITEOBJ.OBJ | |C62_0 | | |03E3066D|dcc120.dll |SYMTAB.OBJ | |MakeOverloadedPropertyList| | |03E3064C|dcc120.dll |SYMTAB.OBJ | |MakeOverloadedPropertyList| | |03E30D76|dcc120.dll |SYMTAB.OBJ | |EnterMethod | | |03E30D6C|dcc120.dll |SYMTAB.OBJ | |FindBaseClassMethod | | |03DE8D30|dcc120.dll |DECL.OBJ | |PatchConstRecordParameter | | |03DBBF70|dcc120.dll |BROWCMGR.OBJ | |PutToAddress | | |03DBC436|dcc120.dll |BROWCMGR.OBJ | |GetNearestSymName | | |219C5BDA|win32debugide120.bpl|Win32Debug.pas |TWin32LinkUnit |GetCppDebugHook |1923[3] | |219C5BB8|win32debugide120.bpl|Win32Debug.pas |TWin32LinkUnit |GetCppDebugHook |1920[0] | |219C644E|win32debugide120.bpl|Win32Debug.pas |TWin32Process |DoLinkUnitCreated |2198[10] | |50001CE4|rtl120.bpl |System.pas | |InterlockedIncrement |3200[0] | |5000CD59|rtl120.bpl |System.pas |TInterfacedObject |_AddRef |21759[1] | |2055F40F|dbkdebugide120.bpl |Debug.pas |TProcess |LinkUnitCreated |8454[1] | |2055F408|dbkdebugide120.bpl |Debug.pas |TProcess |LinkUnitCreated |8453[0] | |2055CEC7|dbkdebugide120.bpl |Debug.pas |TEvaluatorCallback|ntfyLinkUnitDelta |7167[7] | |
I think that you should post this
description to Embarcadero's Quality
Central.Try to disable"IDE integration"
check-box (it's located in IDE's
"EurekaLog"/"EurekaLog IDE Options"
menu) and run your application - see
if there will be a change in behavior.
我现在已经向Quality Central提交了一份报告:
http://qc.embarcadero.com/wc/qcmain.aspx?d=81881
希望通过这些信息,Embarcadero将能够在未来的版本中防止这种情况发生。
4年后我回到这个问题,并意识到几个月前,我找到了解决方案,所以我在这里发布给其他可能遇到此问题的人。
问题和解决方案在Olaf Monien的博客中提供,在2009/07/22的帖子中标题为Delphi 2009 / Windows 7/64 bit Debugger Crash Workaround。
奥拉夫对那篇文章的指示对我来说非常有效,问题就不复存在了。我在评论他的博客文章时感谢他。
正如@rossmcm在他的评论中指出的那样,奥拉夫的博客文章不再存在,但该帖子仍然可以在互联网档案馆找到。相反,请查看Chris Miller关于该问题的信息,其中包括现在在Embarcadero拥有永久住所的补丁工具的链接。
这显然是Delphi评估器(它是编译器的一部分)中发生的事情。奇怪的是,如果它实际上是通过writeobj.c,那肯定是不对的。如果您可以使用测试用例重现此问题,请在QualityCentral(http://qc.embarcadero.com)中报告。
EEFFACE是C ++使用的SEH异常代码,它正在"泄漏"到某些Delphi代码(在本例中为IDE本身)。当异常代码不是Delphi生成的异常或硬件相关异常时,Delphi只是将其映射到EExternalException。
这不是一个确切的答案,但可以通过描述我的经验来帮助您克服错误。
当我访问Windows Vista和7时,我经常收到此错误。相同的代码从未在Windows XP上收到该错误消息。我可以在dpr文件的第一行放置一个断点,并发现在为我的应用程序创建启动画面时似乎总是会出现这种情况。我尝试了各种其他方法来执行启动画面,但它们最终导致在调试时出现EEFFACE错误。
所以为了克服这个问题,我现在提出来
1 | if DebugHook = 0 then |
当我创建并访问启动画面时。我正在调试时,我的应用程序的启动画面现在不会出现,但至少我不再得到EEFFACE错误了。
似乎"外部异常"不是Delphi的错误,我之前遇到过这个例外,它可能是主板或硬件的问题,因为该程序在其他机器上运行良好。
几个星期以来,我一直在与EEFFACE斗争。终于发现原因是这条指令:
1 | PDFForgePDF.CopyPDFFile(pdffile,pdfcreatorfile,1,1); |
变量pdffile和pdfcreatorfile的内容是相同的....
也许这可以帮助一些像我这样的穷人......
最近我遇到了这个,它与Delphi IDE有某种关系。以下代码最终在ShellExecute行的此异常中结束:
1 2 | url:='https://translate.google.com/#hu/en/%C3%A1'; ShellExecute(0,PChar('open'),PChar(url),nil,nil,SW_SHOWNORMAL); |
但这不是:
1 2 3 | url:='https://translate.google.com/#hu/en/%C3%A1'; ShowMessage(url); ShellExecute(0,PChar('open'),PChar(url),nil,nil,SW_SHOWNORMAL); |
但是,如果我在IDE之外运行我的应用程序,没有ShowMessage额外行,一切都很好。我不知道它是否有帮助,但也许在需要调试的其他情况下也许这个"技巧"可能会有所帮助。
系统:DELL Optiplex,intel Core2Duo,Win7 x64,Delphi 7