mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
At present, I think if we crash from multiple threads in parallel, it can lead to the stack trace not being printed out. Using CrashRecoveryContext here seems to more successfully print a stack trace on errors, which I'm hoping will ease debugging. i.e., before: ``` ----------------------------------------------------------------------------- .Please report issues to https://github.com/carbon-language/carbon-lang/issues and include the crash backtrace. Stack dump: 0. performing autoupdate for toolchain/check/testdata/alias/no_prelude/import_order.carbon 1. Program arguments: compile --phase=check --dump-sem-ir --no-prelude-import --exclude-dump-file-prefix=/usr/local/google/home/jperkins/.cache/bazel/_bazel_jper.kins/85deb7d9d96f7e0e80b42618a55969d7/execroot/_main/bazel-out/k8-fastbuild/b.in/toolchain/install/prefix_root/lib/carbon/../../lib/carbon/core a.carbon b.carbon .CHECK failure at ./toolchain/sem_ir/ids.h:140: is_valid() CHECK failure at ./toolchain/sem_ir/ids.h:140: is_valid() external/bazel_tools/tools/test/test-setup.sh: line 328: 1151859 Aborted "${TEST_PATH}" "$@" 2>&1 ``` (EOF) after: ``` ----------------------------------------------------------------------------- Please report issues to https://github.com/carbon-language/carbon-lang/issues and include the crash backtrace. Stack dump: 0. performing autoupdate for toolchain/check/testdata/alias/no_prelude/import_order.carbon 1. Program arguments: compile --phase=check --dump-sem-ir --no-prelude-import --exclude-dump-file-prefix=/usr/local/google/home/jperkins/.cache/bazel/_bazel_jperkins/85deb7d9d96f7e0e80b42618a55969d7/execroot/_main/bazel-out/k8-fastbuild/bin/toolchain/install/prefix_root/lib/carbon/../../lib/carbon/core a.carbon b.carbon ..CHECK failure at ./toolchain/sem_ir/ids.h:140: is_valid() CHECK failure at ./toolchain/sem_ir/ids.h:140: is_valid() ......CHECK failure at ./toolchain/sem_ir/ids.h:140: is_valid() CHECK failure at ./toolchain/sem_ir/ids.h:140: is_valid() .....................................................................................CHECK failure at ./toolchain/sem_ir/ids.h:140: is_valid() .CHECK failure at ./toolchain/sem_ir/ids.h:140: is_valid() ............................ #0 0x000056045ee22d7d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/google/home/jperkins/.cache/bazel/_bazel_jperkins/85deb7d9d96f7e0e80b42618a55969d7/execroot/_main/bazel-out/k8-fastbuild/bin/toolchain/testing/file_test.runfiles/_main/toolchain/testing/file_test+0x731dd7d) ``` (elided the full stack trace)