Skip to content

Commit 3c693ff

Browse files
committed
Add options and instructions for seeing line numbers in sanitizer backtraces
1 parent df9f0fe commit 3c693ff

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ all sanitizers or fail if none are available. If a command-separated list of
6464
specific sanitizers is given, configure will fail unless they all are available.
6565
Note that the some sanitizers may incur a performance penalty, and the Address
6666
Sanitizer may require a runtime library.
67+
To see line numbers in backtraces, declare these environment variables
68+
(adjust the llvm-symbolizer path as needed for your system):
69+
70+
``` sh
71+
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4
72+
export ASAN_OPTIONS=symbolize=1
73+
```
6774

6875
### Linux and other Unixes
6976

ext/mysql2/extconf.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def asplode(lib)
150150
end
151151
$CFLAGS << " -fsanitize=#{s}"
152152
end
153+
# Options for line numbers in backtraces
154+
$CFLAGS << ' -g -fno-omit-frame-pointer'
153155
end
154156

155157
if RUBY_PLATFORM =~ /mswin|mingw/

0 commit comments

Comments
 (0)