Skip to content

Commit 2ec5be1

Browse files
[BH-1822] Disable Address Sanitizer
Due to using wrappers for the glibc syscalls the ASAN doesn't work well. We also had trouble with integrating this tool with GCC12. The ASAN is still available but is turned off by default. Use -DLINUX_ENABLE_SANITIZER=ON to turn on. Our recommendation is to use Valgrind as the runtime profiling tool. It's added for visual studio code.
1 parent b932e06 commit 2ec5be1

File tree

4 files changed

+48
-2
lines changed

4 files changed

+48
-2
lines changed

.vscode/tasks.json

+45
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@
3838
},
3939
"detail": "Build dir has to be configured with Cmake using Ninja",
4040
},
41+
{
42+
"type": "shell",
43+
"label": "Run PurePhone (Linux + Valgrind)",
44+
"command": "valgrind",
45+
"args": [
46+
"./PurePhone.elf"
47+
],
48+
"options": {
49+
"cwd": "${workspaceFolder}/build-PurePhone-linux-Debug"
50+
},
51+
"group": {
52+
"kind": "build",
53+
//"isDefault": true
54+
},
55+
"detail": "Build dir has to be configured with Cmake using Ninja",
56+
},
4157
{
4258
"type": "shell",
4359
"label": "Configure and Build PurePhone (Linux)",
@@ -46,6 +62,14 @@
4662
"dependsOrder": "sequence",
4763
"detail": "Configure cmake project and build with Ninja",
4864
},
65+
{
66+
"type": "shell",
67+
"label": "Build and Run PurePhone (Linux + Valgrind)",
68+
"group": "build",
69+
"dependsOn": ["Build PurePhone (Linux)", "Run PurePhone (Linux + Valgrind)"],
70+
"dependsOrder": "sequence",
71+
"detail": "Configure cmake project and build with Ninja",
72+
},
4973

5074
{
5175
"type": "shell",
@@ -79,6 +103,19 @@
79103
"group": "build",
80104
"detail": "Build dir has to be configured with Cmake using Ninja",
81105
},
106+
{
107+
"type": "shell",
108+
"label": "Run BellHybrid (Linux + Valgrind)",
109+
"command": "valgrind",
110+
"args": [
111+
"./BellHybrid.elf"
112+
],
113+
"options": {
114+
"cwd": "${workspaceFolder}/build-BellHybrid-linux-Debug"
115+
},
116+
"group": "build",
117+
"detail": "Build dir has to be configured with Cmake using Ninja",
118+
},
82119
{
83120
"type": "shell",
84121
"label": "Build BellHybrid Disk Image (Linux)",
@@ -100,6 +137,14 @@
100137
"dependsOrder": "sequence",
101138
"detail": "Configure cmake project and build with Ninja",
102139
},
140+
{
141+
"type": "shell",
142+
"label": "Build and Run BellHybrid (Linux + Valgrind)",
143+
"group": "build",
144+
"dependsOn": ["Build BellHybrid (Linux)", "Run BellHybrid (Linux + Valgrind)"],
145+
"dependsOrder": "sequence",
146+
"detail": "Configure cmake project and build with Ninja",
147+
},
103148

104149
// RT1051
105150

Target_Linux.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set(TARGET_LIBRARIES
99

1010
link_libraries(pthread rt)
1111

12-
option (LINUX_ENABLE_SANITIZER "Enable address sanitizer for Linux" ON)
12+
option (LINUX_ENABLE_SANITIZER "Enable address sanitizer for Linux" OFF)
1313
if (LINUX_ENABLE_SANITIZER)
1414
add_compile_options(-fsanitize=address)
1515
add_link_options(-fsanitize=address)

doc/quickstart.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ This can be done manually, by editing the `.cmake` files (not recommended though
195195
| `MUDITA_USB_ID` | Enable using Mudita registered USB Vendor ID and Pure Phone USB Product ID| OFF |
196196
| `ENABLE_APP_X` | Build and enable application X | ON |
197197
| `OPTIMIZE_APP_X` | Optimize application X in debug build | ON |
198-
| `LINUX_ENABLE_SANITIZER` | Enable address sanitizer for Linux | ON |
198+
| `LINUX_ENABLE_SANITIZER` | Enable address sanitizer for Linux | OFF |
199199
| `ENABLE_SECURE_BOOT` | Build signed binary for Secure Boot | OFF |
200200
| `THIRD_PARTY_DEBUG_OPTIMIZE` | Optimize third party in debug | ON |
201201
| `ENABLE_TEST_LOGS` | Enable logs in unit tests | OFF |

harmony_changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
### Changed / Improved
1414
* Optimize the way Relaxation is loading music files
15+
* Disabled Address Sanitizer for the Linux simulator
1516

1617
## [2.2.2 2023-11-14]
1718

0 commit comments

Comments
 (0)