Skip to content

Commit 959055f

Browse files
gengjiawentargos
authored andcommittedApr 22, 2020
doc: add ASAN build instructions
PR-URL: #32436 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
1 parent d6f6623 commit 959055f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

‎BUILDING.md

+17
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ file a new issue.
2828
* [Running Coverage](#running-coverage)
2929
* [Building the documentation](#building-the-documentation)
3030
* [Building a debug build](#building-a-debug-build)
31+
* [Building an ASAN build](#building-an-asan-build)
3132
* [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds)
3233
* [Windows](#windows)
3334
* [Prerequisites](#prerequisites)
@@ -496,6 +497,22 @@ $ gdb /opt/node-debug/node core.node.8.1535359906
496497
$ backtrace
497498
```
498499

500+
#### Building an ASAN build
501+
502+
[ASAN](https://github.com/google/sanitizers) can help detect various memory
503+
related bugs. ASAN builds are currently only supported on linux.
504+
If you want to check it on Windows or macOS or you want a consistent toolchain
505+
on Linux, you can try [Docker](https://www.docker.com/products/docker-desktop)
506+
(using an image like `gengjiawen/node-build:2020-02-14`).
507+
508+
The `--debug` is not necessary and will slow down build and testing, but it can
509+
show clear stacktrace if ASAN hits an issue.
510+
511+
``` console
512+
$ ./configure --debug --enable-asan && make -j4
513+
$ make test-only
514+
```
515+
499516
#### Troubleshooting Unix and macOS builds
500517

501518
Stale builds can sometimes result in `file not found` errors while building.

0 commit comments

Comments
 (0)
Please sign in to comment.