How do I turn off the fault tolerant heap?

徘徊边缘 提交于 2019-11-26 19:49:14

问题


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?


回答1:


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)




回答2:


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




回答3:


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

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH\ExclusionList

Works for me.




回答4:


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

see also:How to reset Program Compatibility Assistant for testing




回答5:


"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.




回答6:


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.




回答7:


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.




回答8:


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.




回答9:


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.



来源:https://stackoverflow.com/questions/5020418/how-do-i-turn-off-the-fault-tolerant-heap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!