Skip to content

Commit eab3662

Browse files
docs: Describe how to get ASan stacktraces (#351)
1 parent cfc13b1 commit eab3662

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/Development.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- [Formatting](#formatting)
99
- [IDE integration](#ide-integration)
1010
- [Debugging](#debugging)
11-
- [UBSan stacktraces](#ubsan-stacktraces)
11+
- [Stacktraces](#stacktraces)
1212
- [Attaching a debugger](#attaching-a-debugger)
1313
- [Debugging on Linux](#debugging-on-linux)
1414
- [Inspecting Clang ASTs](#inspecting-clang-asts)
@@ -112,15 +112,18 @@ need to reload the editor).
112112

113113
## Debugging
114114

115-
### UBSan stacktraces
115+
### Stacktraces
116116

117-
The default mode of UBSan will not print stack traces on failures.
117+
The default modes of ASan and UBSan do not print stack traces on failures.
118118
I recommend maintaining a parallel build of LLVM
119119
at the same commit as in [fetch_deps.bzl](/fetch_deps.bzl).
120-
UBSan needs a `llvm-symbolizer` binary on `PATH`
121-
to print stack traces, which can provided via the separate build.
120+
Both sanitizers need access to `llvm-symbolizer` to print stack traces,
121+
which can provided via the separate build.
122122

123123
```bash
124+
# For ASan
125+
ASAN_SYMBOLIZER_PATH="$PWD/../llvm-project/build/bin/llvm-symbolizer" ASAN_OPTIONS=symbolize=1 <scip-clang invocation>
126+
# For UBSan
124127
PATH="$PWD/../llvm-project/build/bin:$PATH" UBSAN_OPTIONS=print_stacktrace=1 <scip-clang invocation>
125128
```
126129

0 commit comments

Comments
 (0)