How do I disable the fault-tolerant heap?


A while back, I linked to a talk by Silviu Calinoiu on the fault-tolerant heap. But what if you don't want the fault-tolerant heap? For example, during program development, you probably want to disable the fault-tolerant heap for your program: If the program is crashing, then it should crash so you can debug it!

Method 1 is to disable the fault-tolerant heap globally. While this prevents the fault-tolerant heap from auto-activating in the future, it does not go back and undo activations that were enabled in the past. In other words, you have to remember to do this before your application crashes for the first time.

Therefore, you probably want to combine Method 1 with Method 2 on the same page, where it gives instructions on how to reset the list of applications for which the fault-tolerant heap is enabled.

Mario Raccagni provides a third way of disabling the fault tolerant heap, this time for one specific process instead of globally. His explanation is in Italian, so you get to exercise your translation skills.

tl;dr version: 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.

Comments (10)
  1. Mike Edenfield says:

    Best part of Mario's article: watching Google try to translate "Il Debug è lentisssssssiiiiimo."

  2. Henning Makholm says:

    I'd love to combine Method 1 with Method 2, but … what is Method 2, actually? Did a paragraph fall out?

  3. Aaron.E says:

    @Henning

    Method 2, from the MSDN link:  Rundll32.exe fthsvc.dll,FthSysprepSpecialize

  4. Anonymous Coward says:

    Well, I guess we cannot really call ourselves literate as programmers if we aren't fluent in Italian.

  5. Roger says:

    Software that (accidentally/maliciously) does this in their installation would fail Win2k8R2 logo cert right?

  6. Nick Lowe says:

    Method 3: If you can, develop under Server 2008 R2 which does not have the fault-tolerant heap! :)

  7. Worf says:

    #Aaron.C: Is that function a proper prototype for Rundll32? Or is it gonna cause some future developer some pain in maintaining rundll32 because it's been hacked to do things it really shouldn't?

    And by "future developer", I really mean Raymond.

    blogs.msdn.com/…/10208136.aspx

    blogs.msdn.com/…/58973.aspx

  8. voo says:

    @Worf I'd hope that an official KB wouldn't use a method explicitly forbidden by the documentation, but who knows – they could just assume Raymond will fix it anyhow ;)

  9. petes says:

    Oh, the irony!  My Windows 7 machine blue-screened while watching Silviu's video!

  10. 640k says:

    Couldn't visual studio do this automatically for exes it compiles?

    [I guess I don't understand what you're saying. Are you saying that every VS-complied EXE should disable the fault-tolerant heap? -Raymond]

Comments are closed.