summaryrefslogtreecommitdiffstats
path: root/toolkit/crashreporter/test/unit/test_crash_win64cfi_not_a_pe.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/crashreporter/test/unit/test_crash_win64cfi_not_a_pe.js')
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_win64cfi_not_a_pe.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/toolkit/crashreporter/test/unit/test_crash_win64cfi_not_a_pe.js b/toolkit/crashreporter/test/unit/test_crash_win64cfi_not_a_pe.js
new file mode 100644
index 0000000000..5fcbee9cbe
--- /dev/null
+++ b/toolkit/crashreporter/test/unit/test_crash_win64cfi_not_a_pe.js
@@ -0,0 +1,20 @@
+add_task(async function run_test() {
+ // Test that minidump-analyzer gracefully handles corrupt PE files.
+ let exe = do_get_file("test_crash_win64cfi_not_a_pe.exe");
+ ok(exe);
+
+ // Perform a crash. The PE used for unwind info should fail, resulting in
+ // fallback behavior, calculating the first frame from thread context.
+ // Further frames would be calculated with either frame_pointer or scan trust,
+ // but should not be calculated via CFI. If we see CFI here that would be an
+ // indication that either our alternative EXE was not used, or we failed to
+ // abandon unwind info parsing.
+ await do_x64CFITest(
+ "CRASH_X64CFI_ALLOC_SMALL",
+ [
+ { symbol: "CRASH_X64CFI_ALLOC_SMALL", trust: "context" },
+ { symbol: null, trust: "!cfi" },
+ ],
+ ["--force-use-module", exe.path]
+ );
+});