629 questions
Advice
0
votes
0
replies
18
views
Adding stack information to jit'd code for sanitization
Disclaimer: I'm expecting that the answer to this question will be that it can't be done, but I'm asking as a just in case.
I am working on a JIT'd language with the compiler and runtime implemented ...
1
vote
0
answers
155
views
Address sanitizer error CHECK failed: Interception failure, stopping early on windows 11, visual studio 2022, x86 project
Recently I have to update from windows 10 to windows 11. I'm using address sanitizer with Visual Studio compiler.
Before update now it was working fine but after switching from win 10 to win 11. I get ...
0
votes
1
answer
204
views
ASAN usage with Visual Studio 2022 [closed]
Using Windows 11 and Visual Studio 17.7.4. Created a new C++ console application and enable address sanitizer in project properties in « C/C++ settings». Adding the following code:
#include <...
0
votes
1
answer
36
views
How to add a build config to xcode that switches on all ASAN diagnostics and environment options
In an XCode project, it seems that in order to build and run with ASAN address sanitizer and memory checks, it is necessary to do 3 things:
in Info, switch Build Configuration to Debug
in Arguments, ...
2
votes
0
answers
103
views
Inspecting AddressSanitizer metadata in a core dump
Suppose I have a core dump from a program compiled with AddressSanitizer (ASan), as well as all relevant libraries and debug info, and suppose further that ASan was configured to record a full stack ...
1
vote
1
answer
149
views
Address sanitizer failing to initialize
I'm trying to use the address sanitizer to pinpoint a memory bug in another program, but I can't get it to work. It compiles but running the executable gives
AddressSanitizer: CHECK failed: ...
1
vote
0
answers
39
views
Can HWASAN support runtime suppressions?
The design document for Hardware-assisted AddressSanitizer does not document whether or not runtime suppressions are possible using the HWASAN_OPTIONS environment variable.
Assuming a program compiled ...
0
votes
0
answers
258
views
AddressSanitizer gives DEADLYSIGNAL error without any stack trace
I’ve built a mini shell in C. When I compiled it with -fsanitize=address sometimes it crashes before even showing the prompt. There’s no stack trace—just a crash. I tried running it after setting ...
4
votes
0
answers
49
views
Does VCASan have some limit on thread-related allocation tracing?
While attempting to utilize AddressSanitizer (as deployed with Visual Studio) in our application, we discovered that under certain conditions various heap-related bugs (eg. heap-use-after-free) would ...
3
votes
0
answers
213
views
Using Address Sanitizer (ASAN) with VCL in Embarcadero C++Builder 12.3
Has anyone had any luck using the Address Sanitizer with VCL forms in C++Builder 12.3? I can't get it to work with even the most trivial of forms.
When running C++Builder with ASAN enabled (Win64X ...
0
votes
0
answers
57
views
Is it undefined behavior to access the elements of a list-initialized std::initializer_list after it has been destroyed? [duplicate]
The following code when compiled with -fsanitize=address emits a stack-use-after-scope error in GCC 12.3 and Clang 20.1, but not GCC 14.2.
#include <functional>
#include <cstdint>
#include ...
2
votes
0
answers
336
views
Leaks are not displayed in macos
I have been missing the leaks messages for a long time now when I compile and run my code with -fsanitize=address I just get this
a.out(45811,0x7ff856c70680) malloc: nano zone abandoned due to ...
2
votes
1
answer
44
views
Memory Leak with SDL_SetRenderDrawColor when changing active window
I create a simple window with SDL like this:
int main(void)
{
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
printf("SDL_Init Error: %s\n", SDL_GetError());
return 1;
}
...
2
votes
2
answers
127
views
confused about address sanitizer limits
So I'm playing around in VS2022 with /fsanitize=address but I fail to understand how is this useful if it only catches only a small number of out of bounds accesses.
For instance, this simple program ...
0
votes
0
answers
99
views
Sanitizer crash inside libc++
A little background:
Our team's developers use mostly Macs while the target servers run Ubuntu. After being bitten by subtle compiler/library differences between the platforms, we decided to ...
0
votes
0
answers
159
views
Android NDK "wrap.sh" and using sanitizers
For some time I am trying to solve a bug in our native C++ shared library using traces but it is not easily reproducable (multithreading/networking involved). We have Android (Java) code instantiating ...
0
votes
0
answers
52
views
Why does adress sanitizer not work for shared library? [duplicate]
I have 3 sources. 2 of them (a.cpp and b.cpp) I want to use as shared library.
a.cpp:
#include <string.h>
int XXX[2] = {2, 3};
extern int YYY[];
int test() {
memset(XXX, 0, 2 * sizeof(int));...
1
vote
0
answers
107
views
How to differentiate address sanitizer error from script error?
When using Address Sanitizer when either of ASAN or the actual program fails, the exitcode is always 1. How can I differentiate one from the other? I tried setting exitcode option in ASAN_OPTIONS to ...
3
votes
0
answers
501
views
AddressSanitizer: alloc-dealloc-mismatch (operator new vs free) on exception
Minimum code.cpp
#include <stdexcept>
#include <iostream>
int main() {
try {
throw std::runtime_error("blah");
} catch (const std::exception& e) {
...
1
vote
0
answers
64
views
Android app integrate HWAddress Sanitizer run app failed
I integrate hwaddress sanitizer according to the document: enter link description here
then run the app, log output shows run wrap.sh failed
#!/system/bin/sh
echo "wrap Running with HWASAN $@&...
4
votes
0
answers
139
views
Why isn't MSVC notifying of an error here?
I had some problems with order of destructors being called on static objects. I wrote this as a test to verify that the error checking is working:
#include <vector>
struct MyStruct
{
int a, ...
0
votes
1
answer
312
views
LLVM Build Fails with MemorySanitizer Enabled
Derived from llvm error when attempt to build libcxx instrumented with memory sanitizer
I am attempting to build LLVM with the libcxx and libcxxabi projects instrumented with MemorySanitizer (Msan) ...
9
votes
3
answers
478
views
Determining if a memory leak is a false positive
I have a simple program written in C++ that build in the following configurations:
Using/linked with libstdc++
Using/linked with libc++
I run both builds using valgrind like so:
valgrind --leak-...
-3
votes
1
answer
159
views
Is there any algorithm to check memory safety and data races at the same time? [closed]
I am aware of the question regarding combining AddressSanitizer and ThreadSanitizer. I am asking about this from the theoretical computer science point of view, prompted by an earlier discussion.
...
0
votes
1
answer
240
views
How do I properly pre-load ASAN libraries on macOS with Java binary (JNI library) with SIP enabled
We have a large C++ library for which we have created Java bindings using SWIG (so a JNI shared library). We build for and run tests on many build platforms across macOS, Linux, and Windows; debug and ...