Questions tagged [sanitizer]

Sanitizers are a compiler feature supported by Clang and GCC for instrumenting programs to do dynamic analysis and catch many classes of bugs at runtime.

Sanitizers are a compiler feature supported by Clang and GCC for instrumenting programs to do dynamic analysis. There are sanitizers to detect many issues, including many C and C++ "undefined behaviors", signed integer arithmetic overflow, memory allocation errors, use of uninitialized memory, and data races between threads.

These checks can be enabled at compile time using the -fsanitize= option (for example, -fsanitize=address).

The following sanitizers are supported:

More information on the sanitizers development can be found at http://compiler-rt.llvm.org/.

The current list of supported options can be found in the compiler documentation:

120 questions
0
votes
1 answer

HTML sanitizer version getting error in server build

I have installed a package of HTML sanitizer in my local(v7.0.0). it works fine in my local. So I built the code and deployed to server. But in the server the sanitizer page gets encountered with error wherever I have put sanitizer methods in the…
Rakesh C
  • 1
  • 1
0
votes
1 answer

Undefined Behavior Sanitizer missing addition overflow check

When I use nm | grep '__ubsan', it returns: U __ubsan_handle_add_overflow U __ubsan_handle_divrem_overflow U __ubsan_handle_dynamic_type_cache_miss U __ubsan_handle_load_invalid_value U __ubsan_handle_mul_overflow U __ubsan_handle_negate_overflow U…
JoeManiaci
  • 435
  • 3
  • 15
0
votes
0 answers

New option in GCC : -fsanitize=shadow-call-stack

I have been working with the latest release of gcc (GCC 12.1, released May 6, 2022). There is a new command-line option : -fsanitize=shadow-call-stack. The documentation states: GCC now supports the ShadowCallStack sanitizer, which can be…
DevShark
  • 8,558
  • 9
  • 32
  • 56
0
votes
1 answer

Address Sanitizer - suppress for gtest

Is possible to suppress unit test functions? I have address sanitizer in my project and I am getting reports with info about stack-buffer-overflow, which I want to supress. It's already one stackoverflow page with similar problem here , but solution…
0
votes
1 answer

Can you run a user-defined pass before ASAN sanitizer?

I compile my code with -fsanitize=address switch. I have my own llvm pass that I want to execute. By the time the pass starts, I can see that the ASAN pass was made. Is it possible to run my pass before the ASAN pass?
user11746929
0
votes
0 answers

How to get line numbers with AddressSanitizer output?

How can I get line numbering when running address sanitizer on gcc? I have a simple program to test address santizer (buffer overflow): #include int main(void) { int A[10] = {0}; A[10] = 1; } when running address sanitizer…
0
votes
1 answer

This.sanitizer is undefined outside NgOninit function (Angular, TS)

First, I imported DomSanitizer to the component: import { DomSanitizer, SafeResourceUrl} from '@angular/platform-browser'; After that, I created a class and added it to the constructor: export class BlocklyComponent implements OnInit { …
Sam
  • 19
  • 1
  • 3
0
votes
1 answer

llvm/ompiler-rt sanitizer not support aarch64 ilp32: asan_interceptors_vfork.S incompatible with aarch64 ilp32

I am building libasan.so from compiler-rt(https://github.com/llvm/llvm-project), after patch the sources with https://patches.linaro.org/patch/129368/, all cpps can be built correctly. But I get blocked with an ASM (asan/asan_interceptors_vfork.S),…
Hugh
  • 11
  • 2
0
votes
2 answers

How do I fix "ld: library not found for -lubsan" while compiling with g++?

When I try to compile my eek.cpp file with g++ eek.cpp -o eek -fsanitize=undefined flag, it shows: ld: library not found for -lubsan collect2: error: ld returned 1 exit status but g++ eek.cpp -o eek is working fine. My terminal screenshot here. I'm…
Cow Frog
  • 1
  • 2
0
votes
1 answer

free invalid pointer disappeared after applying address sanitizer

I got a free: invalid pointer when running my project. But when I try to hunt the root cause using -fsanitize=address, the error disappears. When I remove the sanitizer, the error appears again. Can anyone give some hint about what was happening and…
Harper
  • 1,794
  • 14
  • 31
0
votes
1 answer

Are there anyways to work around errors given by ndefinedBehaviorSanitizer

I have the following code: #include #include #include #define _ThreadPoolLength_ 100 class thread_pool { public: thread_pool() : q(_ThreadPoolLength_) {} private: mutable…
shapeare
  • 4,133
  • 7
  • 28
  • 39
0
votes
1 answer

Remove a bad tag completely with html5lib.sanitizer

I'm trying to use html5lib.sanitizer to clean user-input as suggested in the docs The problem is I want to remove bad tags completely and not just escape them (which seems like a bad idea anyway). The workaround suggested in the patch here doesn't…
letoosh
  • 511
  • 2
  • 6
  • 13
0
votes
0 answers

how sanitizer javascript function inside html string

please, i need your help....soon i have this code line in Angular 6: import { DomSanitizer } from '@angular/platform-browser'; constructor(private sanitizer: DomSanitizer) { this.errorMessageMain = 'Lo sentimos, ocurrió un error, debe
0
votes
1 answer

Undefined behaviour or false positive

I have some pieces of C++ code that when run on Xcode with Undefined Behaviour Sanitizer turned on reports: "runtime error: store to misaligned address 0x7f8bcc403771 for type 'int', which requires 4 byte alignment". So I created a small Catch2…
vcarreira
  • 83
  • 3
  • 4
0
votes
1 answer

angular sanitizer and orphan angle bracket in html email content

In my angular app I have applied angular sanitization so invalid html is stripped off(using getTrustedHtml mathod) and valid html goes(HttpPost) to web api. Also HtmlSanitizer in web api is not recommended due to other reasons; so only client side I…
Saurabh
  • 1,545
  • 1
  • 9
  • 9