scripts: cros_fuzz sets handle_sigtrap

Set handle_sigtrap=1 in sanitizer environment parameters in the
cros_fuzz shell.

This makes fuzzing more developer-friendly as by default the
sigtrap (int3) isn't intercepted by sanitizers, but that's how
Chromium's CHECK and LOG(FATAL) macros report errors.

BUG=b:254864841
TEST=create fuzzer which hits CHECK failure, run it under cros_fuzz shell, verify it prints stack trace and saves testcase on failure

Change-Id: I19318f4681f3f13081d64063473ec9066794d43c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4091623
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Tested-by: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
diff --git a/scripts/cros_fuzz_unittest.py b/scripts/cros_fuzz_unittest.py
index 764bd6e..c0ef936 100644
--- a/scripts/cros_fuzz_unittest.py
+++ b/scripts/cros_fuzz_unittest.py
@@ -190,9 +190,12 @@
             cros_fuzz.GetFuzzerSysrootPath(FUZZ_TARGET).sysroot,
         ]
         self.expected_extra_env = {
-            "ASAN_OPTIONS": "log_path=stderr:detect_odr_violation=0",
-            "MSAN_OPTIONS": "log_path=stderr:detect_odr_violation=0",
-            "UBSAN_OPTIONS": "log_path=stderr:detect_odr_violation=0",
+            "ASAN_OPTIONS": "log_path=stderr:detect_odr_violation=0:"
+            "handle_sigtrap=1",
+            "MSAN_OPTIONS": "log_path=stderr:detect_odr_violation=0:"
+            "handle_sigtrap=1",
+            "UBSAN_OPTIONS": "log_path=stderr:detect_odr_violation=0:"
+            "handle_sigtrap=1",
         }
 
     def _Helper(self):