aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-06-30 14:57:52 +0200
committerGitHub <noreply@github.com>2021-06-30 14:57:52 +0200
commit3438959da9ef199111886a73327a34fc4531c9c4 (patch)
tree8811da4a8241ffc64befd1aee33a88c61265e3dc
parent384f9870f62f9e67fab45b717d8536d52080c473 (diff)
downloadrneovim-3438959da9ef199111886a73327a34fc4531c9c4.tar.gz
rneovim-3438959da9ef199111886a73327a34fc4531c9c4.tar.bz2
rneovim-3438959da9ef199111886a73327a34fc4531c9c4.zip
Update CONTRIBUTING.md: mention ASAN/UBSAN for runtime errors
-rw-r--r--CONTRIBUTING.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 94c371b62d..27fd2b97bb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -20,6 +20,7 @@ Reporting problems
- Update Neovim to the latest version to see if your problem persists.
- Disable plugins incrementally, to narrow down the cause of the issue.
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux).
+- Use [ASAN/UBSAN](#clang-sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
- Check `$NVIM_LOG_FILE`, if it exists.
- Include `cmake --system-information` for build-related issues.
@@ -172,7 +173,20 @@ master build. To view the defects, just request access; you will be approved.
```
git log --oneline --no-merges --grep coverity
```
+
+### Clang sanitizers (ASAN and UBSAN)
+ ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.
+ To build neovim with sanitizers enabled, use
+ ```
+ rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
+ ```
+ When running neovim, use
+ ```
+ UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
+ ```
+ If neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
+
Coding
------