Skip to content

Commit

Permalink
doc: add ASAN build instructions
Browse files Browse the repository at this point in the history
PR-URL: #32436
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
  • Loading branch information
gengjiawen authored and targos committed Apr 11, 2020
1 parent bc7f819 commit 9ee2afa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ file a new issue.
* [Running Coverage](#running-coverage)
* [Building the documentation](#building-the-documentation)
* [Building a debug build](#building-a-debug-build)
* [Building an ASAN build](#building-an-asan-build)
* [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds)
* [Windows](#windows)
* [Prerequisites](#prerequisites)
Expand Down Expand Up @@ -490,6 +491,22 @@ $ gdb /opt/node-debug/node core.node.8.1535359906
$ backtrace
```

#### Building an ASAN build

[ASAN](https://github.com/google/sanitizers) can help detect various memory
related bugs. ASAN builds are currently only supported on linux.
If you want to check it on Windows or macOS or you want a consistent toolchain
on Linux, you can try [Docker](https://www.docker.com/products/docker-desktop)
(using an image like `gengjiawen/node-build:2020-02-14`).

The `--debug` is not necessary and will slow down build and testing, but it can
show clear stacktrace if ASAN hits an issue.

``` console
$ ./configure --debug --enable-asan && make -j4
$ make test-only
```

#### Troubleshooting Unix and macOS builds

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

0 comments on commit 9ee2afa

Please sign in to comment.