File: asan.sh

package info (click to toggle)
neovim 0.10.4-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 63,144 kB
  • sloc: ansic: 255,334; python: 1,470; lisp: 1,213; sh: 1,103; makefile: 363; xml: 78; ruby: 6
file content (25 lines) | stat: -rwxr-xr-x 703 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

# Helper script to build and run neovim with Address Sanitizer enabled.
# You may read more information in src/nvim/README.md in the section "Build
# with ASAN".

shopt -s nullglob

root_path=$(git rev-parse --show-toplevel)
log_path=$(mktemp -d)
export CC='clang'

# Change to detect_leaks=1 to detect memory leaks (slower).
export ASAN_OPTIONS="detect_leaks=0:log_path=$log_path/asan"

make -C "$root_path" CMAKE_EXTRA_FLAGS="-DENABLE_ASAN_UBSAN=ON"
VIMRUNTIME="$root_path"/runtime "$root_path"/build/bin/nvim

# Need to manually reset terminal to avoid mangled output, nvim does not
# properly restore the terminal when it crashes.
tput reset

for i in "$log_path"/*; do
  cat "$i"
done