Skip to content

Commit bfbbb80

Browse files
author
Colin Robertson
authored
Update linux-asan-configuration.md
Fix spelling error. Acrolinx all the things.
1 parent 8441c73 commit bfbbb80

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: "Configure Linux projects to use Address Sanitizer"
33
description: "Describes how to configure C++ Linux projects in Visual Studio to use Address Sanitizer."
4-
ms.date: "05/31/2019"
4+
ms.date: "06/07/2019"
55
---
66

77
# Configure Linux projects to use Address Sanitizer
88

9-
In Visual Studio 2019 version 16.1, AddressSanitizer (ASan) support is integrated into Linux projects. You can enable ASan for MSBuild-based Linux projects as well as CMake projects. It works on remote Linux systems and on Windows Subsystem for Linux (WSL).
9+
In Visual Studio 2019 version 16.1, AddressSanitizer (ASan) support is integrated into Linux projects. You can enable ASan for both MSBuild-based Linux projects and CMake projects. It works on remote Linux systems and on Windows Subsystem for Linux (WSL).
1010

1111
## About ASan
1212

@@ -19,15 +19,15 @@ ASan is a runtime memory error detector for C/C++ that catches the following err
1919
- Use after scope
2020
- Initialization order bugs
2121

22-
When ASan detects an error, it stops execution immediately. When you run an ASan-enabled program in the debugger, you see a message that describes the type of error, the memory address, and the location in the source file where the error occurred:
22+
When ASan detects an error, it stops execution immediately. If you run an ASan-enabled program in the debugger, you see a message that describes the type of error, the memory address, and the location in the source file where the error occurred:
2323

2424
![ASan error message](media/asan-error.png)
2525

2626
You can also view the full ASan output (including where the corrupted memory was allocated/deallocated) in the Debug pane of the output window.
2727

2828
## Enable ASan for MSBuild-based Linux projects
2929

30-
To enable ASan for MSBuild-based Linux projects, right-click on the project in **Solution Explorer** and select **Properties**. Next, navigate to **Configuration Properties** > **C/C++** > **Sanitizers**. ASan is enabled via compiler and linker flags and requires recompilation in order to work.
30+
To enable ASan for MSBuild-based Linux projects, right-click on the project in **Solution Explorer** and select **Properties**. Next, navigate to **Configuration Properties** > **C/C++** > **Sanitizers**. ASan is enabled via compiler and linker flags, and requires your project to be recompiled to work.
3131

3232
![Enable ASan for an MSBuild project](media/msbuild-asan-prop-page.png)
3333

@@ -37,19 +37,19 @@ You can pass optional ASan runtime flags by navigating to **Configuration Proper
3737

3838
## Enable ASan for Visual Studio CMake projects
3939

40-
To enable ASan for CMake, right click on the CMakeLists.txt file in **Solution Explorer** and choose open the **CMake Settings for Project**.
40+
To enable ASan for CMake, right-click on the CMakeLists.txt file in **Solution Explorer** and choose **CMake Settings for Project**.
4141

42-
Make sure you have a Linux configuration (for example **Linux-Debug**) selected in the left pane of the dialog:
42+
Make sure you have a Linux configuration (for example, **Linux-Debug**) selected in the left pane of the dialog:
4343

44-
![Linix Debug Configuration](media/linux-debug-configuration.png)
44+
![Linux Debug Configuration](media/linux-debug-configuration.png)
4545

4646
The ASan options are under **General**. Enter the ASan runtime flags in the format "flag=value", separated by semicolons.
4747

48-
![Linix Debug Configuration](media/cmake-settings-asan-options.png)
48+
![Linux Debug Configuration](media/cmake-settings-asan-options.png)
4949

5050
## Install the ASan debug symbols
5151

52-
To enable the ASan diagnostics, you have to install its debug symbols (libasan-dbg) on your remote Linux machine or WSL installation. The version of libasan-dbg that you load depends on the version of GCC you have installed on your Linux machine:
52+
To enable the ASan diagnostics, you must install its debug symbols (libasan-dbg) on your remote Linux machine or WSL installation. The version of libasan-dbg that you load depends on the version of GCC installed on your Linux machine:
5353

5454
|**ASan version**|**GCC version**|
5555
| --- | --- |
@@ -59,23 +59,22 @@ To enable the ASan diagnostics, you have to install its debug symbols (libasan-d
5959
|libasan4|gcc-7|
6060
|libasan5|gcc-8|
6161

62-
You can determine the version of GCC you have with the following command:
62+
You can determine which version of GCC you have by using this command:
6363

6464
```bash
6565
gcc --version
6666
```
6767

68-
You can also view the version of libasan-dbg you will need by running your program and then looking at the **Debug** pane of the **Output** window. The version of ASan that is loaded corresponds to the version of libasan-dbg you will need on your Linux machine. You can use **Ctrl + F** to search for "libasan" in the window. If you have libasan4, for example, you see a line like this:
68+
To view the version of libasan-dbg you need, run your program, and then look at the **Debug** pane of the **Output** window. The version of ASan that's loaded corresponds to the version of libasan-dbg needed on your Linux machine. You can use **Ctrl + F** to search for "libasan" in the window. If you have libasan4, for example, you see a line like this:
6969

70-
```output
70+
```Output
7171
Loaded '/usr/lib/x86_64-linux-gnu/libasan.so.4'. Symbols loaded.
7272
```
7373

74-
You can install the ASan debug bits on Linux distros that use apt with the following command (this command installs version 4):
74+
You can install the ASan debug bits on Linux distros that use apt with the following command. This command installs version 4:
7575

7676
```bash
7777
sudo apt-get install libasan4-dbg
7878
```
7979

8080
If ASan is enabled, Visual Studio prompts you at the top of the **Debug** pane of the **Output** window to install the ASan debug symbols.
81-

0 commit comments

Comments
 (0)