From d1733c6aa7c4fbad83cf3e6b25ce0a76acd30c68 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 4 Nov 2024 17:15:48 -0800 Subject: [PATCH] Abort rather than exiting "normally" if an autoupdate step crashes. (#4483) This avoids producing an LSan leak report for the objects that got leaked by the crash, which would otherwise scroll all the useful information about the crash off the terminal. --- testing/file_test/file_test_base.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/file_test/file_test_base.cpp b/testing/file_test/file_test_base.cpp index 3f317585bee4..d2a2094f7385 100644 --- a/testing/file_test/file_test_base.cpp +++ b/testing/file_test/file_test_base.cpp @@ -1015,7 +1015,9 @@ static auto RunAutoupdate(llvm::StringRef exe_path, pool.wait(); if (crashed) { - return EXIT_FAILURE; + // Abort rather than returning so that we don't get a LeakSanitizer report. + // We expect to have leaked memory if one or more of our tests crashed. + std::abort(); } llvm::errs() << "\nDone!\n"; return EXIT_SUCCESS;