Using static asan

This commit is contained in:
WolverinDEV 2021-01-24 11:26:43 +01:00
parent ffd5b64177
commit 9a5aa1d42b
2 changed files with 12 additions and 4 deletions

View File

@ -10,7 +10,7 @@ set(TEASPEAK_SERVER ON)
#set(MEMORY_DEBUG_FLAGS " -fsanitize=leak -fsanitize=address -fstack-protector-all ")
#set(MEMORY_DEBUG_FLAGS "-fsanitize=address -fstack-protector-all")
#set(MEMORY_DEBUG_FLAGS "-fstack-protector-all")
set(MEMORY_DEBUG_FLAGS " -fsanitize=address ")
set(MEMORY_DEBUG_FLAGS " -fsanitize=address -static-libasan")
if (NOT BUILD_OS_ARCH)
set(BUILD_OS_ARCH $ENV{build_os_arch})

View File

@ -299,9 +299,17 @@ int main(int argc, char** argv) {
}
/*
{
void* ptr = malloc(1234);
free(ptr);
free(ptr);
auto a = malloc(10); // 0xa04010
auto b = malloc(10); // 0xa04030
auto c = malloc(10); // 0xa04050
free(a);
free(b); // To bypass "double free or corruption (fasttop)" check
free(a); // Double Free !!
auto d = malloc(10); // 0xa04010
auto e = malloc(10); // 0xa04030
auto f = malloc(10); // 0xa04010 - Same as 'd' !
}
*/
/*