Skip to content
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

gcc address-sanitiser warnings #40

Open
robertgj opened this issue Nov 13, 2022 · 0 comments
Open

gcc address-sanitiser warnings #40

robertgj opened this issue Nov 13, 2022 · 0 comments

Comments

@robertgj
Copy link

I patched hat-trie-master/configure.ac to enable gcc address sanitiser:

cat > hat-trie-master.patch << 'EOF'
--- hat-trie-master/configure.ac	2018-12-06 11:36:58.000000000 +1100
+++ hat-trie-master-new/configure.ac	2022-11-12 22:28:50.565755292 +1100
@@ -6,7 +6,8 @@
 
 base_CFLAGS="-std=gnu99 -Wall -Wextra -pedantic"
 opt_CFLAGS="${base_CFLAGS} -O3"
-dbg_CFLAGS="${base_CFLAGS} -g -O0"
+dbg_CFLAGS="${base_CFLAGS} -ggdb3 -O0 -ggdb3 -fsanitize=undefined -fsanitize=address -fno-sanitize=vptr -fno-omit-frame-pointer"
+
 
 AC_ARG_ENABLE([debugging],
               [AS_HELP_STRING([--enable-debugging],
 
EOF
unzip hat-trie-master.zip
cd hat-trie-master
patch -p1 < ../hat-trie-master.patch
export LDFLAGS="-ggdb3 -O0 -ggdb3 -fsanitize=undefined -fsanitize=address \
-fno-sanitize=vptr -fno-omit-frame-pointer"
autoreconf -i
./configure --enable-debugging
make
cd test

make check_hattrie
./check_hattrie  > check_hattrie.log 2>&1

check_hattrie.log shows address alignment warnings:
check_hattrie.log

Running valgrind ./check_hattrie on a release build shows no errors or warnings.

I am running Fedora-36 6.0.7-200.fc36.x86_64 GNU/Linux
and gcc version 12.2.1 20220819 (Red Hat 12.2.1-2) (GCC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant