46

I've recently started seeing this line in my Visual Studio 2005 output window when launching my application:
FTH: (7156): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***

I've tried turning off the fault tolerant heap using the instructions here:
http://msdn.microsoft.com/en-us/library/dd744764(VS.85).aspx

I'm running Windows 7 64-bit edition, so I have made the changes to both the 32-bit and 64-bit registries, and run the "Rundll32.exe fthsvc.dll,FthSysprepSpecialize" command using both the 32-bit and 64-bit versions of Rundll32.exe.

However, after rebooting I am still getting the fault tolerant heap when trying to debug my application!

This is a real problem since it masks the bug I am trying to reproduce, and it also kills performance.

Does anyone have any other suggestions how to disable the fault tolerant heap?

trincot
  • 317,000
  • 35
  • 244
  • 286
MJW
  • 461
  • 1
  • 4
  • 3

10 Answers10

49

To disable it for a single application

Go to the HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER versions of Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\your_application.exe and delete the Fault­Tolerant­Heap entry.

From here (actually here)

Lars Truijens
  • 42,837
  • 6
  • 126
  • 143
  • 4
    This solution work for me, but I only needed to delete the FTH of the HKEY_LOCAL_MACHINE. – Angie Quijano May 06 '16 at 22:33
  • This only turns it off once it's been enabled. It doesn't stop it from getting enabled again, which is what's really needed... – Glenn Maynard Jan 19 '18 at 03:36
  • 1
    @GlennMaynard As @Aaron pointed out, after you remove the application from FTH list, disable it from adding new entries to its list by setting this to zero: `HKEY_LOCAL_MACHINE\Software\Microsoft\FTH\Enabled` – Punitto Moe Jun 05 '22 at 17:42
8

Set this registry value to 0: HKEY_LOCAL_MACHINE\Software\Microsoft\FTH\Enabled

Aaron Klotz
  • 11,287
  • 1
  • 28
  • 22
5

You can add the name of your executable to the ExclusionList.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH\ExclusionList

Works for me.

j0k
  • 22,600
  • 28
  • 79
  • 90
Joren Boulanger
  • 131
  • 2
  • 3
  • 1
    This solution didn't work for me. Did you add the entire path of your executable? or just the executable name? – Angie Quijano May 06 '16 at 21:23
  • @AngieQuijano In the beginning it didn't work for me either, but when I deleted and recompiled my exe file it worked (it didn't work to just recompile it, I had to delete it). – Donald Duck Aug 18 '18 at 17:52
  • 1
    @DonaldDuck Deleting the exe didn't work for me (Windows 10). I had to rename it. – Paulo Carvalho Aug 26 '20 at 23:16
2

You can edit the application manifest to excluding your program from PCA

see also:How to reset Program Compatibility Assistant for testing

Sheng Jiang 蒋晟
  • 15,125
  • 2
  • 28
  • 46
  • Many thanks for your answer. Unfortunately, modifying the application manifest as you suggested and resetting the PCA made no difference. – MJW Feb 17 '11 at 22:07
2

you can clear the list of applications tracked by FTH without stopping this service by following these steps:

  1. Click the Start menu.
  2. Right-click Computer and click Manage.
  3. Click Event Viewer -> Applications and Services Logs -> Microsoft -> Windows -> Fault-Tolerant-Heap.
  4. View FTH Events.

you will find file named operational by right click and choose clear log, then you can run you program again and warning message will disappear, it worked with me without restarting operating system.

2

On Windows 10 the registry location is:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH

You can remove you executable from the list in:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH\State

or you can run this command from an elevated command prompt

Rundll32.exe fthsvc.dll,FthSysprepSpecialize

You may need to reboot your machine

Henrik Høyer
  • 1,225
  • 1
  • 19
  • 27
1

"Rundll32.exe fthsvc.dll,FthSysprepSpecialize" looks to only clear the list of currently flagged applications. if your application still causes oddities, the FTH should still step in and take over.

as already mentioned:

Set this registry value to 0: HKEY_LOCAL_MACHINE\Software\Microsoft\FTH\Enabled

this should disable FTH for the whole system.

Steve Czetty
  • 6,147
  • 9
  • 39
  • 48
atlas
  • 11
  • 1
0

I had to rename the file as well because the registry entries associated with this key were empty of applicable data. I expect that they populate if you have a misbehaving application. But in my case I was debugging my own application within Visual Studio. So in that case, it was my process that was somehow loading the FTH whether the FTH Service was running or not. And in fact I had no applications listed that were previously tagged as misbehaving.

But I had to follow these instructions:

http://billroper.livejournal.com/960825.html

because it wouldn't let me rename the file until I took ownership and made sure I had full control.

0

I had similar issue when running a Unit test using (Microsoft::VisualStudio::CppUnitTestFramework). Somehow I had violated some heap allocation, and next time I tried to debug I received the message : "Fault tolerant heap shim applied to current process. This is usually due to previous crashes. " and the debug environment froze.

To get it to work again, I had to remove test case, recompile and add it again and recompile, then I could set breakpoint and step into the test.

serup
  • 3,676
  • 2
  • 30
  • 34
-1

Also ran into this. Renaming/deleting AcXtrnal.dll inside Windows\AppPatch seems to work for me. I like how this Microsoft recommended action (which I did first) does nothing.