Engine robustness review fixes: crash-log repeats, teardown reserve, mutator gate, OOM dump safety
Native crash logger - Per-address slots keep hit counts and a last-write tick; a repeat relogs at powers of two, after 30 s, or for any non-AV code. The oldest noise slot is evicted when the table is full. - The logger checks its dedupe first, caches the module table, and opens the log handle once at install. Managed-noise bucket (coreclr, clrjit, System.Private.CoreLib). Main-thread queue - The action ring (ActionRing) rejects non-teardown work during a world transition and reserves its top 32 slots for teardown, so a stop is never lost behind held work. IsTeardownKind is shared by the enqueue and drain sides. ActionRing.TryPeekAt lets the cast drain's StopQueuedAtOrBefore walk the ring it no longer owns directly; the walk now checks every queued entry, since an entry's time is taken before the ring's lock. - MutatorGate: every AC-mutating helper opens with the same gate, AcMainThreadQueue.MustQueue(teardown: X); IsDraining and ShouldDefer added; teardown helpers are exempt from the hold. tools\check_offthread_mutators.py accepts MustQueue as the gate (it asks MainThreadGuard.IsOnMainThread itself). - MasteryFeed and VaultFeed pause during a transition. The heading slot drops a stale heading; the overlay select is kept. - RequestId never merges into an entry queued at or before the last transition hold; EnqueueRequestId returns false during a transition. - 0xF751 PlayerTeleport starts the 5 s settle window. - Cast slot: the queue time and Pending are published with Volatile.Write (a plain 64-bit store can tear on x86 and the drain reads both without the lock); the stop-wait flag is reset before the publishing store. Appraisals - Appraisal data survives a client release for 10 min (bounded at 4096); evicted on server delete (0xF747) and at session clear. 0xF747 is detected in SmartBox dispatch, independent of capture. Dumps - Dump start/end markers in the log; the launcher holds its wedge kill while a dump is in progress (DumpInProgressRule). The in-progress flag is cleared only when the writer thread exits. - The OOM dump triggers only on the main thread with AC's exact text, before stacks are built. Dumps are pruned only after a successful write, and other live clients' dumps are kept. CrashDump reads the file length before Delete. - ExitProcess/RtlExitUserProcess detours forward crash codes first. - The message box count is decremented first in a finally; 30 s safety reset when no box is visible on the main thread. - UsageStats counts the loader's CoreCLR fatal-error dumps (Logs\dumps\clr_*.dmp) as crashes alongside crash_*.dmp. Tests: EngineRobustnessTests, CrashLogFilterTests, UsageStatsTests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
55f7497065
commit
8c7201dc25
41 changed files with 1797 additions and 448 deletions
|
|
@ -163,7 +163,7 @@ internal static class CommandInterpreterHooks
|
|||
// motion graph the CSequence-AV corruption class kills. Off-thread
|
||||
// callers marshal through the action ring (drained post-tick,
|
||||
// gesture-gated) like every other mutator.
|
||||
if (!MainThreadGuard.IsOnMainThread())
|
||||
if (AcMainThreadQueue.MustQueue(teardown: !enabled))
|
||||
return AcMainThreadQueue.EnqueueSetAutoRun(enabled);
|
||||
int n = System.Threading.Interlocked.Increment(ref _setAutoRunCalls);
|
||||
if (!TryBindDelegates())
|
||||
|
|
@ -269,7 +269,7 @@ internal static class CommandInterpreterHooks
|
|||
|
||||
public static bool SetMotion(uint motion, bool enabled)
|
||||
{
|
||||
if (!MainThreadGuard.IsOnMainThread())
|
||||
if (AcMainThreadQueue.MustQueue(teardown: !enabled))
|
||||
return AcMainThreadQueue.EnqueueSetMotion(motion, enabled); // same off-thread class as SetAutoRun
|
||||
if (!TryBindDelegates() || _setMotion == null)
|
||||
return false;
|
||||
|
|
@ -287,7 +287,7 @@ internal static class CommandInterpreterHooks
|
|||
|
||||
public static bool StopCompletely()
|
||||
{
|
||||
if (!MainThreadGuard.IsOnMainThread())
|
||||
if (AcMainThreadQueue.MustQueue(teardown: true))
|
||||
return AcMainThreadQueue.EnqueueStopCompletely(); // same off-thread class as SetAutoRun
|
||||
if (!TryBindDelegates() || _stopCompletely == null)
|
||||
return false;
|
||||
|
|
@ -305,7 +305,7 @@ internal static class CommandInterpreterHooks
|
|||
|
||||
public static bool TurnToHeading(float headingDegrees)
|
||||
{
|
||||
if (!MainThreadGuard.IsOnMainThread())
|
||||
if (AcMainThreadQueue.MustQueue(teardown: false))
|
||||
return AcMainThreadQueue.EnqueueTurnToHeading(headingDegrees); // same off-thread class as SetAutoRun
|
||||
int n = System.Threading.Interlocked.Increment(ref _turnToHeadingCalls);
|
||||
if (!TryBindDelegates() || _turnToHeading == null)
|
||||
|
|
@ -398,7 +398,7 @@ internal static class CommandInterpreterHooks
|
|||
|
||||
public static bool TapJump()
|
||||
{
|
||||
if (!MainThreadGuard.IsOnMainThread())
|
||||
if (AcMainThreadQueue.MustQueue(teardown: false))
|
||||
return AcMainThreadQueue.EnqueueTapJump();
|
||||
if (!TryBindDelegates())
|
||||
return false;
|
||||
|
|
@ -419,7 +419,7 @@ internal static class CommandInterpreterHooks
|
|||
|
||||
public static bool CommenceJump()
|
||||
{
|
||||
if (!MainThreadGuard.IsOnMainThread())
|
||||
if (AcMainThreadQueue.MustQueue(teardown: false))
|
||||
return AcMainThreadQueue.EnqueueCommenceJump();
|
||||
if (!TryBindDelegates())
|
||||
return false;
|
||||
|
|
@ -437,7 +437,7 @@ internal static class CommandInterpreterHooks
|
|||
|
||||
public static bool DoJump(bool autonomous)
|
||||
{
|
||||
if (!MainThreadGuard.IsOnMainThread())
|
||||
if (AcMainThreadQueue.MustQueue(teardown: false))
|
||||
return AcMainThreadQueue.EnqueueDoJumpAutonomous(autonomous);
|
||||
if (!TryBindDelegates())
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue