Hello,
I've installed FreeBSD13
and want to use AddressSanitizer with clang.
It's a clean system with a minimal installation - just xorg and a window manager (awesome wm). And the c-file is just an empty main function.
Clang is installed (not by me).
When I try to use it, an error occurs.
llvm is installed too:
So I tried to compile with clang12:
Can you use AddresSanitizer with clang?
I've installed FreeBSD13
Code:
:~ $ uname -a
FreeBSD pc.freebsd 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
It's a clean system with a minimal installation - just xorg and a window manager (awesome wm). And the c-file is just an empty main function.
Clang is installed (not by me).
Code:
:~ $ clang --version
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
When I try to use it, an error occurs.
Code:
:~ $ ls -a
. .. a.out main.c
:~ $ clang -std=c11 -Wall -fsanitize=address -fno-omit-frame-pointer main.c
:~ $ ls -a
. .. a.out main.c
:~ $ ./a.out
==22487==Sanitizer CHECK failed: /usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp:71 ((Err)) == ((0)) (-1, 0)
llvm is installed too:
Code:
:~ $ pkg info | grep llvm
llvm12-12.0.1_5 LLVM and Clang
So I tried to compile with clang12:
Code:
:~$ clang12 -std=c11 -Wall -fsanitize=address -fno-omit-frame-pointer main.c
:~ $ ./a.out
==27545==Sanitizer CHECK failed: /wrkdirs/usr/ports/devel/llvm12/work/llvm-project-12.0.1.src/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp:62 ((Err)) == ((0)) (-1, 0)
Can you use AddresSanitizer with clang?
Last edited by a moderator: