It is easy to accidentally read from uninitialized memory after using resize!
to grow a vector. Is there an equivalent of the memory sanitizer in C or any other tools for catching this when testing?
I never used it before but could give this a shot
Sanitizer support · The Julia Language
When I run the following I get an error.
$ mkdir /tmp/julia
$ SANITIZE_MEMORY=1 contrib/asan/build.sh /tmp/julia/
checking for gcc... /tmp/julia/asan/../toolchain/usr/tools/clang -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -fsanitize=address
checking whether the C compiler works... no
configure: error: in `/tmp/julia/asan/deps/patchelf-0.17.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [/home/nathan/github/julia/deps/patchelf.mk:22: patchelf-0.17.2/build-configured] Error 77
make[1]: Leaving directory '/tmp/julia/asan/deps'
make: *** [/home/nathan/github/julia/Makefile:86: julia-deps] Error 2
make: Leaving directory '/tmp/julia/asan'
There’s possibly some relevant info on the failure there.