Registry key for Global Flags (gflags)
Asked Answered
S

1

8

I'm currently having an error while trying to remove the flag "Enable heap tagging by DLL" with the debug tool GFlags for so-called "image": the application I was debugging.

I get an "Unable to save the registry error 5". However there are no problem for other "Enable heap..." flags, they can be toggled on and off. I tried to launch the utility as Administrator but that doesn't change anything.

So I am trying to figure out what registry settings should I manually change to put things back to normal, however I do not seem to find the correct registry key about Windows Global Flags.

Or I could simply remove any global flag related to my application.

Any idea ?

I tried to find FLG_HEAP_PAGE_ALLOCS in the registry, which is the symbolic name of the more general flag "Enable page heap" as said here in MSDN. But without success.

Sitsang answered 27/8, 2014 at 17:46 Comment(0)
S
13

Delete the keys :

  • [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RADAR\HeapLeakDetection\DiagnosedApplications\MyApplication.exe]
  • [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MyApplication.exe]

Beware that it will also remove debugging configurations made with/for Application Verifier.

Secondly, maybe it's related, but on MSDN regarding gflags:

"Note: Incorrect use of this tool can degrade system performance or prevent Windows from starting, requiring you to reinstall Windows.

Important: Pool tagging is permanently enabled on Windows Server 2003 and later versions of Windows, including Windows Vista. On these systems, the Enable pool tagging check box on the Global Flags dialog box is dimmed and commands to enable or disable pool tagging fail."

Sitsang answered 27/8, 2014 at 18:8 Comment(3)
That saved my bacon - the flags were causing a crash - removed the key entries, crash goes away.Flavescent
@imekan Be aware that it does not mean that the source cause, the source of the bug, has disappeared ! Gflags reveals bugs that happens infrequently, randomly: bugs that cannot be repeated in controlled evironment. For me it's a tool for helping tracking Undefined Behaviour from C/C++ code, bugs that really do happen in real production environment but not always (or rarely) in test environment. That was my way of using gflags.Sitsang
I advise you to open the crash dump file generated at the moment of the crash, so as to check what was the code causing the trouble. Closing the eyes has never correct bugs :-) Unless you want to hide that there are bugs, which I find not the good way to react.Sitsang

© 2022 - 2024 — McMap. All rights reserved.