title: External Exception EEFFACE in Delphi
body: <p>While debugging my application with Delphi 2009, I sometimes get the following exception occurring:</p>
  
  <p><a href="https://i.stack.imgur.com/GSJuC.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GSJuC.gif" alt="What is this?"></a><br>
  <sub>(source: <a href="http://www.beholdgenealogy.com/img/ideexception.gif" rel="nofollow noreferrer">beholdgenealogy.com</a>)</sub>  </p>
  
  <p>This only happens occasionally, but after pressing OK, then my IDE and program both may freeze. If I am lucky I can sometimes do a File/SaveAll in Delphi, but sometimes I can't. Either way I am stuck and then the only thing I can do is use Windows Task Manager to shut down Delphi. Of course, if I was unable to SaveAll, then I lose all the edits I had made since last saving.</p>
  
  <p>I have all the Delphi 2009 Updates installed right up to and including Update 4. I also have IDE Fix Pack 2009 2.9 installed.</p>
  
  <p>The Error is trapped for me by EurekaLog, and the error report gives the following call stack:</p>
  
  <pre><code>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       |         |
  -----------------------------------------------------------------------------------------------------------
  </code></pre>
  
  <p>As you can see, all of the call stack is in Delphi and Windows. It does not connect back at all to any line in my program.</p>
  
  <p>I have looked at the webpage: <a href="http://www.audacia-software.de/de/bcb/external-exception-eefface.htm" rel="nofollow noreferrer">External Exception EEFFACE</a> and translated it from German to English, but it appears to be talking about Delphi C++ whereas I don't use C++ at all.</p>
  
  <p>My problem is I have no idea what might be causing this as it does not happen consistently. I have no idea even where to look to find it or how to track it down.</p>
  
  <p>Does someone know what this is and how I can track it down or at least prevent it from happening?</p>
  
  <hr>
  
  <p>Alex of EurekaLog posted this in response to <a href="http://news.eurekalog.com/showthread.php?t=2608" rel="nofollow noreferrer">my query on their forum</a>:</p>
  
  <blockquote>
    <p>I think it may be a bug in Delphi's
    debugger. Possibly related to
    evaluation tooltips or something
    similar.</p>
    
    <p>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:</p>
  </blockquote>
  
  <pre><code>|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] |  
  </code></pre>
  
  <blockquote>
    <p>I think that you should post this
    description to Embarcadero's Quality
    Central.</p>
    
    <p>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.</p>
  </blockquote>
  
  <hr>
  
  <p>I have now submitted a report to Quality Central at:</p>
  
  <p><a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=81881" rel="nofollow noreferrer">http://qc.embarcadero.com/wc/qcmain.aspx?d=81881</a></p>
  
  <p>Hopefully with this information, Embarcadero will be able to prevent this in future releases.</p>
  
  <hr>
  
  <p>I come back to this question over 4 years later, and realize that a few months ago, I found the solution, so I am posting it here for anyone else who may encounter this.</p>
  
  <p>The problem and solution were provided in <a href="https://stackoverflow.com/users/99158/olaf-monien">Olaf Monien</a>'s blog, in a post from 2009/07/22 titled Delphi 2009 / Windows 7 / 64 bit Debugger Crash Workaround. </p>
  
  <p>Olaf's instructions on that post worked perfectly for me, and the problem is gone. I thanked him in a comment on his blog post.</p>
  
  <p>As @rossmcm points out in his comment, Olaf's blog post is no longer there, but <a href="http://web.archive.org/web/20141027020450/http://www.monien.net/delphi-2009-windows-7-64-bit-debugger-crash-workaround" rel="nofollow noreferrer">the post can still be found on the Internet Archive</a>. Instead, check out <a href="https://web.archive.org/web/20160823111746/https://rajapet.com/2009/08/work-around-for-delphi-20072009-with.html" rel="nofollow noreferrer">Chris Miller's information about the problem (now also only available on the Internet Archive)</a> which includes a link to <a href="http://cc.embarcadero.com/item/27521" rel="nofollow noreferrer">the patch tool that now has a permanent home at Embarcadero</a>. </p>