Hi.
Built my latency measuring app with clang address sanitizers and got this report:
=================================================================
==8454==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x007faed05a90
#0 0x4e0a28 in operator delete(void*, unsigned long) /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-amp/final/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:172:3
0x007faed05a90 is located 0 bytes inside of 40-byte region [0x007faed05a90,0x007faed05ab8)
allocated by thread T0 here:
#0 0x4b2674 in malloc /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-amp/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
#1 0x7fad02a830 in fnet::String::String(char const*) (/usr/lib/aarch64-linux-gnu/tegra/libnvfnet.so+0x7830)
#2 0x7fb330db34 (/lib/ld-linux-aarch64.so.1+0xdb34)
#3 0x7fb3311cd4 (/lib/ld-linux-aarch64.so.1+0x11cd4)
#4 0x7fb29a4690 in _dl_catch_exception /build/glibc-D9JkfM/glibc-2.27/elf/dl-error-skeleton.c:196
#5 0x7fb3311414 (/lib/ld-linux-aarch64.so.1+0x11414)
#6 0x7fb2bf1010 in dlopen_doit /build/glibc-D9JkfM/glibc-2.27/dlfcn/dlopen.c:66
#7 0x7fb29a4690 in _dl_catch_exception /build/glibc-D9JkfM/glibc-2.27/elf/dl-error-skeleton.c:196
#8 0x7fb29a4734 in _dl_catch_error /build/glibc-D9JkfM/glibc-2.27/elf/dl-error-skeleton.c:215
#9 0x7fb2bf277c in _dlerror_run /build/glibc-D9JkfM/glibc-2.27/dlfcn/dlerror.c:162
#10 0x7fb2bf10e4 in dlopen /build/glibc-D9JkfM/glibc-2.27/dlfcn/dlopen.c:87
#11 0x48aecc in dlopen /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-amp/final/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:6251:15
#12 0x7fb3148a64 (/usr/lib/aarch64-linux-gnu/libv4l2.so.0+0x7a64)
#13 0x5731d4 in NvVideoDecoder::NvVideoDecoder(char const*, int) /mnt/data_nvme/projects/uavTech2/Experimental/jetson_samples/deps/common/classes/NvVideoDecoder.cpp:69:6
#14 0x573240 in NvVideoDecoder::createVideoDecoder(char const*, int) /mnt/data_nvme/projects/uavTech2/Experimental/jetson_samples/deps/common/classes/NvVideoDecoder.cpp:76:31
#15 0x4e3f4c in DecoderContext::DecoderContext(int, int) /mnt/data_nvme/projects/uavTech2/Experimental/jetson_samples/JetLagTest/main.cpp:38:19
#16 0x4e2734 in RunDecoder(std::__1::basic_string_view<char, std::__1::char_traits<char> >) /mnt/data_nvme/projects/uavTech2/Experimental/jetson_samples/JetLagTest/main.cpp:264:17
#17 0x4e3498 in main /mnt/data_nvme/projects/uavTech2/Experimental/jetson_samples/JetLagTest/main.cpp:303:3
#18 0x7fb28b971c in __libc_start_main /build/glibc-D9JkfM/glibc-2.27/csu/../csu/libc-start.c:310
#19 0x442824 in _start /home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/snapshots/glibc.git~release~2.25~master/csu/../sysdeps/aarch64/start.S:83
SUMMARY: AddressSanitizer: alloc-dealloc-mismatch /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-amp/final/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:172:3 in operator delete(void*, unsigned long)
Backtrace between 12 and 13 is not precise enough. There should be NvV4l2Element::NvV4l2Element ctor inbetween. GDB shows that this happens inside v4l2_open call, i.e. 12 frame is actually v4l2_open inside libv4l2.so . Obviously I don’t have source for tegra mulitmedia drivers and libnvfnet, so can’t fix this by myself.
Could you please verify if this is a bug or false positive detection?