FTH: Fault tolerant heap shim applied to current process. This is usually due to previous crashes.

In testing the Lexing plugin on windows, I am suddenly facing the notion that Xojo is not able to load the Lexing plugin because of the FTH shim. How can I solve this? Yes, I do experience crashes of Xojo both on Mac and Windows, which is normal during development of a plugin. The LOG I get is the following:

00000001	10:30:16.422 PM	[7056] FTH: (7056): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***	
00000002	10:30:27.362 PM	[7056] Loaded: RBAddressBook.xojo_plugin	
00000003	10:30:27.564 PM	[7056] Loaded: RBAppearancePak.xojo_plugin	
00000004	10:30:27.646 PM	[7056] Loaded: RBCrypto.xojo_plugin	
00000005	10:30:27.700 PM	[7056] Loaded: RBGameInput.xojo_plugin	
00000006	10:30:27.776 PM	[7056] Loaded: RBGUIKit.xojo_plugin	
00000007	10:30:27.832 PM	[7056] Loaded: RBGZip.xojo_plugin	
00000008	10:30:27.919 PM	[7056] Loaded: RBHTMLViewer.xojo_plugin	
00000009	10:30:27.964 PM	[7056] Loaded: RBInternetEncodings.xojo_plugin	
00000010	10:30:30.406 PM	[7056] Loaded: RBOpenGLSurface.xojo_plugin	
00000011	10:30:30.536 PM	[7056] Loaded: RBREALSQLDatabase.xojo_plugin	
00000012	10:30:30.624 PM	[7056] Loaded: RBRegEx.xojo_plugin	
00000013	10:30:30.738 PM	[7056] Loaded: RBScript.xojo_plugin	
00000014	10:30:30.803 PM	[7056] Loaded: RBShell.xojo_plugin	
00000015	10:30:31.004 PM	[7056] Loaded: RBSQLiteDatabase.xojo_plugin	
00000016	10:30:31.087 PM	[7056] Loaded: RBSSL.xojo_plugin	
00000017	10:30:31.548 PM	[7056] Loaded: RBXML.xojo_plugin	
00000018	10:30:39.659 PM	[7056] Loading plugins...	
00000019	10:30:41.232 PM	[7056] A dynamic link library (DLL) initialization routine failed. 	
00000020	10:30:41.232 PM	[7056] [XOJO] Unable to load plugin Lexing Plugin.xojo_plugin	
00000021	10:30:41.307 PM	[7056] in Script InstallPlugin with plugin version 13	
00000022	10:30:42.405 PM	[7056] Loaded: Scripts.xojo_plugin	
00000023	10:31:25.703 PM	[7056] Command "NewProject" handled by App	

You can see what the FTH is doing in RegEdit by going to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH\State - you’ll see a list of EXEs that it’s being applied to. You can delete these keys to turn it back off again. Note that FTH may reenable itself if you have more crashes.

There’s also an exclusion list in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExclusionList but I’ve not tried using that.

Thanks for this info. Apparently, on Windows-10, removal of this key does not have any effect. As soon as Xojo is launched, with or without the plugin, it is immediately tagged with the FTH as seen in debugView and the registry. I assumed that the FTX was causing the problem of Xojo not being able to load the plugin.

Nonetheless, for an obscure reason the plugin fails to load on windows. Basically, it suddenly caused the failed dll initialization routine.

Can’t even see the message string in PluginEntry() using DebugView.

Where is the [Cashed] plugin stored on windows?

[5580] RBLibrary.CheckForPluginChanges 1 - needsToRecompile = true
[5580] RBLibrary.CheckForPluginChanges failed to remove [Cached]

Completely at loss…

Ridiculous but true for Xojo macOS:

default	16:23:56.097784 -0700	Xojo	in textColor of the Lexing Plugin
default	16:23:56.098986 -0700	Xojo	in textColor of the Lexing Plugin
default	16:23:56.100369 -0700	Xojo	PluginEntry of the Lexing plugin
default	16:23:56.100461 -0700	Xojo	Registered the base class XSColor
default	16:23:56.100514 -0700	Xojo	Registered the subclass SemanticColor

and for Xojo windows:

00000017 4:22:36.448 PM [9816] Loading plugins... 00000018 4:22:36.831 PM [9816] windowTextColor of the Lexing plugin 00000019 4:22:36.831 PM [9816] windowTextColor of the Lexing plugin 00000020 4:22:36.831 PM [9816] REALPluginMain 00000021 4:22:36.831 PM [9816] PluginEntry of the Lexing plugin 00000022 4:22:36.831 PM [9816] PluginEntry of the Lexing plugin 00000023 4:22:36.831 PM [9816] Install Lexing Plugin 00000024 4:22:36.831 PM [9816] Registered the base class XSColor 00000025 4:22:36.831 PM [9816] Registered the subclass SemanticColor 00000026 4:22:37.143 PM [9816] Loaded: Lexing Plugin.xojo_plugin

Loading the plugin, causes Xojo to use functions defined in the plugin… On the Mac, the plugin function interrogates the name of the NSColor and uses creates a REALstring. On windows the plugin also creates a REALstring for “windowTextColor”. The creation of a REALstring is of course premature, because the resolver in PluginMain for REALBuildString has not resolved it yet.

I am not sure how to handle this, or that I have to handle it, or that this is a bug in RBLibrary. Hopefully, Xojo can provide a quick answer.
To tackle this I went through numerous crashes on macOS (fortunately!), while on windows, xojo did not provide string output messages, even before the culprit (REALBuildString) was called.