-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The program compiled and run with lsan alone reports an error. #1710
Comments
I also encountered the same, but with GCC version 11.4: #include <stdio.h>
int main() {
printf("Hello world!!!");
} $ gcc -fsanitize=leak hello.c -o hello
$ ./hello
==15193==Sanitizer CHECK failed: ../../../../libsanitizer/lsan/lsan_interceptors.cpp:55 ((!lsan_init_is_running)) != (0) (0, 0) Similar issue: magma/magma#15279. |
Same on ubuntu 20.04:
code: int main()
{
int a = 1;
while (1) {
}
return 0;
} result:
|
Same issue
|
With installation with
Maybe we can close this issue. |
I am not sure that if you are really using gcc-11, try using |
gcc-9 has the issue, gcc-11 doesn't |
Does not reproduce for me on Godbolt: https://godbolt.org/z/bnvjGov9T (with neither GCC 9.4, nor any newer version) Closing per the above comments. |
I have written some test programs for memory leaks as follows:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, const char *argv[]) {
char s = (char)malloc(100);
strcpy(s, "Hello world!");
printf("string is: %s\n", s);
return 0;
}
And I compiled it using 'g++ test_asan.cpp -o testasan -fsanitize=leak'. However, I got the following error message:
==2691129==Sanitizer CHECK failed: ../../../../src/libsanitizer/lsan/lsan_interceptors.cpp:53 ((!lsan_init_is_running)) != (0) (0, 0)
What could be the reason for this error? Some online resources suggest that it could be due to a lower version of g++, but my g++ version is ‘g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0.‘
The text was updated successfully, but these errors were encountered: