You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Uses RtlFailFast to trigger an unbypassable crash that guarantees WER capture.
241
+
/// </summary>
242
+
/// <remarks>
243
+
/// <para>
244
+
/// <strong>Educational Note:</strong> RtlFailFast (the underlying implementation of __fastfail)
245
+
/// is the nuclear option for crash generation. It:
246
+
/// </para>
247
+
/// <list type="bullet">
248
+
/// <item>Bypasses ALL exception handlers (including ANCM in IIS InProcess mode)</item>
249
+
/// <item>Generates a Windows Error Report that Crash Monitoring can capture</item>
250
+
/// <item>Cannot be caught, filtered, or intercepted by any managed or unmanaged code</item>
251
+
/// <item>Is what the CLR itself uses for internal fatal errors</item>
252
+
/// </list>
253
+
/// <para>
254
+
/// Use this crash type if other crash types are not being captured by Azure Crash Monitoring.
255
+
/// The error code 7 (FAST_FAIL_FATAL_APP_EXIT) is specifically designed for application crashes.
256
+
/// </para>
257
+
/// </remarks>
258
+
privatevoidExecuteNativeCrash()
259
+
{
260
+
_logger.LogCritical("Triggering RtlFailFast - this will bypass all exception handlers!");
261
+
262
+
// FAST_FAIL_FATAL_APP_EXIT (7) - Indicates a fatal application error
263
+
// This generates an unbypassable crash that Windows Error Reporting will capture
264
+
constuintFAST_FAIL_FATAL_APP_EXIT=7;
265
+
RtlFailFast(FAST_FAIL_FATAL_APP_EXIT);
266
+
}
267
+
268
+
[DllImport("ntdll.dll")]
269
+
privatestaticexternvoidRtlFailFast(uintCode);
270
+
235
271
/// <summary>
236
272
/// Allocates memory until the process runs out and crashes.
237
273
/// </summary>
@@ -311,7 +347,8 @@ public Dictionary<CrashType, string> GetCrashTypeDescriptions()
311
347
[CrashType.StackOverflow]="Triggers StackOverflowException via infinite recursion. Cannot be caught. Creates interesting stack traces for analysis.",
312
348
[CrashType.UnhandledException]="Throws an unhandled exception on a background thread, demonstrating the importance of proper exception handling.",
313
349
[CrashType.AccessViolation]="Writes to invalid memory (null pointer). Demonstrates native-level crashes common in P/Invoke or unsafe code bugs.",
314
-
[CrashType.OutOfMemory]="Allocates memory until the process crashes. Useful for learning memory dump analysis techniques."
350
+
[CrashType.OutOfMemory]="Allocates memory until the process crashes. Useful for learning memory dump analysis techniques.",
351
+
[CrashType.NativeCrash]="Uses RtlFailFast to bypass ALL exception handlers including ANCM. Guarantees WER capture - use this if other types aren't detected by Azure Crash Monitoring."
0 commit comments