Questions tagged [ubsan]

Undefined Behavior sanitizer (ubsan) is a fast undefined behavior detector for Clang and GCC. Various computations will be instrumented to detect undefined behavior at runtime.

Undefined Behavior sanitizer (ubsan) is a fast undefined behavior detector for C and C++ programs and enabled at compile time (but the checks are performed at runtime). It is available since Clang 3.2 and GCC 4.9.

See also:

65 questions
0
votes
1 answer

Does anyone use sanitizer in released software?

Sanitizers, like: address sanitizer (ASAN); undefined behavior sanitizer (UBSAN) etc. are frequently used during development and testing. Are these tools used in released software?
lol lol
  • 319
  • 3
  • 18
0
votes
0 answers

How to get rid of automatically added library provided by GCC?

I'm compiling main.c file by gcc with enabled sanitizer option. As a result, linker command contains "-lubsan" option in its arguments list. Need to say, that I haven't provided "-lubsan" option to gcc explicitly. Moreover, I'm against of using…
lol lol
  • 319
  • 3
  • 18
0
votes
1 answer

UBSan: Store to misaligned address; what is the problem, and should I care

I've been running some code under UBSan, and found an error which I've never seen before: /usr/include/c++/7/bits/stl_algobase.h:324:8: runtime error: store to misaligned address 0x611000001383 for type 'struct complex', which requires 4 byte…
user14717
  • 4,757
  • 2
  • 44
  • 68
0
votes
1 answer

Android nkd r15c and UBSAN clang

I am trying to build a simple Android binary to test out UBSAN (Undefined behavior sanitizer) using ndk r15c and clang. However the build fails when trying to link with the following error: jni/main.cpp:17: error: undefined reference to…
user821602
  • 31
  • 1
  • 4
-4
votes
1 answer

how to correctly cast uint32_t to unsigned

I'm trying to fix some C++ code with address sanitizer. The code says: unsigned result = *(uint32_t*)data; And the sanitizer gives: runtime error: load of misaligned address 0x6280033f410a for type 'uint32_t', which requires 4 byte alignment How…
user1600826
1 2 3 4
5