1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-07 07:28:57 +00:00
6502bench/PluginCommon
Andy McFadden 195c93a94a Reboot sandbox when required
Another chapter in the never-ending AppDomain security saga.

If a computer goes to sleep while SourceGen is running with a project
open, life gets confusing when the system wakes up.  The keep-alive
timer fires and a ping is sent to the remote AppDomain, successfully.
At the same time, the lease expires on the remote side, and the objects
are discarded (apparently without bothering to query the ILease object).
This failure mode is 100% repeatable.

Since we can't prevent sandbox objects from disappearing, we have to
detect and recover from the problem.  Fortunately we don't keep any
necessary state on the plugin side, so we can just tear the whole
thing down and recreate it.

The various methods in ScriptManager now do a "health check" before
making calls into the plugin AppDomain.  If the ping attempt fails,
the AppDomain is "rebooted" by destroying it and creating a new one,
reloading all plugins that were in there before.  The plugin binaries
*should* still be in the PluginDllCache directory since the ping failure
was due to objects being discarded, not AppDomain shutdown, and Windows
doesn't let you mess with files that hold executable code.

A new "reboot security sandbox" option has been added to the DEBUG
menu to facilitate testing.

The PluginManager's Ping() method gets called more often, but not to
the extent that performance will be affected.

This change also adds a finalizer to DisasmProject, since we're relying
on it to shut down the ScriptManager, and it's relying on callers to
invoke its cleanup function.  The finalizer throws an assertion if the
cleanup function doesn't get called.

(Issue #82)
2020-07-19 13:20:18 -07:00
..
AddressTranslate.cs Switch to left-handed coordinate system 2020-03-14 13:59:08 -07:00
Interfaces.cs Consolidate wireframe data validation 2020-04-23 11:25:45 -07:00
Matrix33.cs Switch to left-handed coordinate system 2020-03-14 13:59:08 -07:00
PlSymbol.cs Optionally treat BRKs as two-byte instructions 2019-10-09 14:55:56 -07:00
PluginCommon.csproj Initial file commit 2018-09-28 10:05:11 -07:00
PluginException.cs Expand the set of things SetInlineDataFormat accepts 2019-10-05 19:51:34 -07:00
PluginManager.cs Reboot sandbox when required 2020-07-19 13:20:18 -07:00
Util.cs Add support for points in wireframe meshes 2020-04-11 11:23:16 -07:00
Vector3.cs Tweak Vector3 and VisWireframe 2020-03-10 20:59:45 -07:00
VisBitmap8.cs Add NES visualization generator 2020-05-14 15:34:05 -07:00
VisWireframe.cs Consolidate wireframe data validation 2020-04-23 11:25:45 -07:00