bustub
bustub copied to clipboard
run valgrind failed with ASan runtime related error
When I run these commands, I got this error message.
$ cd build
$ make b_plus_tree_insert_test
$ valgrind --trace-children=yes \
--leak-check=full \
--track-origins=yes \
--soname-synonyms=somalloc=*jemalloc* \
--error-exitcode=1 \
--suppressions=../build_support/valgrind.supp \
./test/b_plus_tree_insert_test
==7536== Memcheck, a memory error detector
==7536== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7536== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==7536== Command: ./test/b_plus_tree_insert_test
==7536==
==7536==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
==7536==
==7536== HEAP SUMMARY:
==7536== in use at exit: 0 bytes in 0 blocks
==7536== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==7536==
==7536== All heap blocks were freed -- no leaks are possible
==7536==
==7536== For lists of detected and suppressed errors, rerun with: -s
==7536== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
I use the Vagrantfile in the project root to set up a VM with VirtualBox and run these commands.
Here is my environment information.
$ uname -a
Linux ubuntu-focal 5.4.0-62-generic #70-Ubuntu SMP Tue Jan 12 12:45:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Actually, I have already fixed this problem on my local environment after searching these error messages and trying for a while. I'm gonna submit a PR later.
But I'm not sure whether or not it is a bug or something. Hope it can help others who encounter the same problem.
We might be deprecating valgrind soon for ASAN, and this issue will be closed then. https://github.com/cmu-db/bustub/issues/277