Questions tagged [address-sanitizer]

AddressSanitizer (ASAN) is a fast memory error detector for issues such as out-of-bounds access and more.

AddressSanitizer (ASAN) is a fast memory error detector and consists of compile time instrumentation and a runtime library.

See also:

530 questions
17
votes
2 answers

AddressSanitizer interceptor_via_fun

Would like to suppress the following error detected by AddressSanitizer. ==114064==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffe60fee2f0 at pc 0x000001e6ef34 bp 0x7ffe60feb6c0 sp 0x7ffe60feb6b8 WRITE of size 8 at 0x7ffe60fee2f0…
joaerl
  • 1,012
  • 1
  • 10
  • 21
17
votes
2 answers

Address Sanitizer-like functionality on MSVC

Coming from Linux/gcc/clang I find myself working more and more on Windows/Visual Studio. What I am really missing there is the address sanitizer (bounds checking, leaks, use after free,...). I've done some research and also tried a few things but…
Frank Meerkötter
  • 2,778
  • 2
  • 20
  • 26
17
votes
4 answers

undefined reference to '_asan_init_v4' when compiling

When linking my code compiled with the AddressSanitizer tool, I'm getting many errors of the kind undefined reference to '_asan_init_v4'. clang -fPIC -g -fno-omit-frame-pointer -DNDEBUG -Wl,-z,defs \ -shared -Wl,-soname,libqpid-dispatch.so -o…
vamshi
  • 183
  • 1
  • 1
  • 8
17
votes
1 answer

-fsanitize not using gold linker in GCC-6.1

Update (30-Sept-2016) The Ubuntu build of gcc-6.2 ((Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901) no longer has this issue. I'm using the Ubuntu build of gcc-6.1[1] ((Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511), GNU binutils 2.24, and libstdc++…
Tim
  • 1,517
  • 1
  • 9
  • 15
16
votes
1 answer

std::string_view on temporary string - catch by ASan

This is dangling pointer|reference example: #include #include #include std::string foo() { return "test"; } int main() { std::string_view bar = foo(); // bar is pointed to destructed string std::cout…
vladon
  • 8,158
  • 2
  • 47
  • 91
15
votes
1 answer

LeakSanitizer not working under gdb in Ubuntu 18.04?

I've upgraded my Linux development VM from Ubuntu 16.04 to 18.04 recently, and noticed one thing that has changed. This is on x86-64. With 16.04, I've always had this workflow where I'd build the project I'm working on with gcc (5.4, the stock…
fencekicker
  • 732
  • 1
  • 8
  • 18
14
votes
3 answers

Clang 8 with MinGW-w64: How do I use address- & UB sanitizers?

Clang 8 release notes have this promising line: Allow using Address Sanitizer and Undefined Behaviour Sanitizer on MinGW. However, I unable to figure out how to use those properly. I'm using Clang 8.0.0 with MSYS2 MinGW GCC. Exact details are at…
HolyBlackCat
  • 78,603
  • 9
  • 131
  • 207
13
votes
1 answer

AddressSanitizer, What do these terms mean?

So I'm using the AddressSanitizer. But it uses some dense terms when describing the problem. Shadow bytes around the buggy address: 0x0c067fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c067fff7fc0: 00 00 00 00 00 00 00 00 00 00 00…
Tarick Welling
  • 3,119
  • 3
  • 19
  • 44
13
votes
0 answers

undefined symbol: __asan_option_detect_stack_use_after_return

I'm trying to compile C++ using clang's address sanitizer to output the sanitize results within a core dump, so I added: CXXFLAGS += -fsanitize=address to have the compiler options: /opt/llvm-3.8.0/bin/clang++ --gcc-toolchain=/opt/gcc-5.2.0…
intrigued_66
  • 16,082
  • 51
  • 118
  • 189
13
votes
1 answer

How to generate core dump on AddressSanitizer error

I compiled my code like this to enable Asan: g++ -O0 -g -fsanitize=address -fno-omit-frame-pointer but it never generates a core dump so that I can later examine the details of the error. How can I generate it?
wsy
  • 219
  • 4
  • 8
13
votes
1 answer

using address sanitizer with OpenCV

I'm trying to use Google's Address Sanitizer with a CUDA project, more precisely with OpenCV cuda functions. However I got an 'out of memory' error on the first cuda call. OpenCV Error: Gpu API call (out of memory) in getDevice, file…
Pluc
  • 901
  • 8
  • 21
12
votes
3 answers

Can GCC's ASAN provide the same memory safety as Rust?

Rust is known as a memory-safe language, but there is a security feature in GCC called AddressSanitizer (ASAN): ./configure CFLAGS="-fsanitize=address -g" CXXFLAGS="-fsanitize=address -g" LDFLAGS="-fsanitize=address" make make check Could ASAN…
Hessnov
  • 367
  • 2
  • 7
11
votes
1 answer

Address Sanitizer on a python extension

I am trying to compile a python extension with Address Sanitizer. When I load the extension, I get Traceback (most recent call last): File "test.py", line 2, in from extension import package File…
Alex
  • 871
  • 7
  • 23
11
votes
1 answer

MacOS - clang address sanitizer fails to link

I have been trying to use Clang's address code sanitizer, but the linker will not have it. The linker may be "ld", though my CMAKE settings assure me that clang is the linker. Added -fsanitize=address to compiler and linker flags. Error: Undefined…
iseale
  • 111
  • 1
  • 4
11
votes
1 answer

Address Sanitizer Warning

For a few days now I get the following issue when starting up the Address Sanitizer within Xcode 7.3. The error messages printed to the Xcode console when the Sanitizer found an issue (that was actually suppressed by a file): ==13392==WARNING:…
HelloWorld
  • 2,392
  • 3
  • 31
  • 68
1
2
3
35 36