Investigate valgrind failures reported in jenkins
We started running valgrind on unit tests in our automated pipeline. We should look at the reported valgrind errors and ideally determine if each of them is an issue or not, so we can properly suppress the false positives, and also fix the ones that are issues. Valgrind is known for being overly verbose, but try not to take that for granted.
You can check the reported valgrind errors at:
- https://reports.kea.isc.org/tests_status/valgrind.html
- or https://jenkins.aws.isc.org/job/kea-dev/job/valgrind/lastCompletedBuild/testReport/
Here is a summary of the 46 reported errors run on the latest job(325 at the moment of writing):
Leak_StillReachable.0x4842F95 /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so operator new(unsigned long) /builddir/build/BUILD/valgrind-3.22.0/coregrind/m_replacemalloc
Leak_StillReachable libkea-asiolink.so.70.0.0 isc::asiolink::IOService::IOService() /home/fedora/workspace/kea-dev/valgrind/src/lib/asiolink io_service.cc 126
Leak_StillReachable libkea-asiolink.so.70.0.0 IOServiceImpl /home/fedora/workspace/kea-dev/valgrind/src/lib/asiolink io_service.cc 33
Leak_StillReachable libkea-asiolink.so.70.0.0 shared_count boost::asio::io_context::work /usr/include/boost/smart_ptr/detail shared_count.hpp
Leak_StillReachable libkea-asiolink.so.70.0.0 shared_count isc::asiolink::IOServiceImpl /usr/include/boost/smart_ptr/detail shared_count.hpp
Leak_StillReachable libkea-asiolink.so.70.0.0 execution_context /usr/include/boost/asio/impl execution_context.ipp 28
Leak_StillReachable libkea-asiolink.so.70.0.0 boost::asio::io_context::io_context() /usr/include/boost/asio/impl io_context.ipp 39
Leak_StillReachable libkea-asiolink.so.70.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-cfgclient.so.64.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-asiolink.so.70.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-asiolink.so.70.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-asiolink.so.70.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-cfgclient.so.64.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-asiolink.so.70.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-asiolink.so.70.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-asiolink.so.70.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-asiolink.so.70.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-cfgclient.so.64.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-cfgclient.so.64.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
Leak_StillReachable libkea-cfgclient.so.64.0.0 ~do_init /usr/include/boost/asio/ssl/detail/impl openssl_init.ipp 90
UninitCondition libkea-pgsql.so.67.0.0 deallocate /usr/include/c++/13/bits new_allocator.h 168
UninitCondition libkea-dhcp++.so.88.0.0 operator std::char_traits char /usr/include/c++/13
UninitCondition libkea-dhcp++.so.88.0.0 operator std::char_traits char /usr/include/c++/13
UninitCondition libkea-dhcp++.so.88.0.0 allocate /usr/include/c++/13/bits new_allocator.h 147
UninitCondition libkea-dhcp++.so.88.0.0 copy /usr/include/c++/13/bits char_traits.h 445
UninitCondition libkea-dhcp++.so.88.0.0 operator char, std::char_traits char
UninitCondition libkea-log.so.60.0.0 replace /usr/include/c++/13/bits basic_string.h 2144
UninitCondition libkea-log.so.60.0.0 find /usr/include/c++/13/bits basic_string.tcc 621
UninitCondition libkea-log.so.60.0.0 find /usr/include/c++/13/bits basic_string.tcc 621
UninitCondition libkea-log.so.60.0.0 find /usr/include/c++/13/bits basic_string.tcc 630
UninitCondition libkea-log.so.60.0.0 find /usr/include/c++/13/bits char_traits.h 415
UninitCondition libkea-log.so.60.0.0 find /usr/include/c++/13/bits char_traits.h 421
UninitCondition libkea-log.so.60.0.0 _M_check_length /usr/include/c++/13/bits basic_string.h 389
UninitCondition libkea-log.so.60.0.0 _M_replace /usr/include/c++/13/bits basic_string.tcc 515
UninitCondition libkea-log.so.60.0.0 _M_replace /usr/include/c++/13/bits basic_string.tcc 543
UninitCondition libkea-log.so.60.0.0 deallocate /usr/include/c++/13/bits new_allocator.h 168
UninitCondition libkea-log.so.60.0.0 operator char, std::char_traits char
UninitCondition libkea-log.so.60.0.0 _M_high_mark /usr/include/c++/13 sstream 442
UninitCondition libkea-log.so.60.0.0 isc::log::LoggerImpl::outputRaw(isc::log::Severity const , std::__cxx11::basic_string
UninitValue libkea-dhcp++.so.88.0.0 operator std::char_traits char /usr/include/c++/13
UninitValue libkea-dhcp++.so.88.0.0 copy /usr/include/c++/13/bits char_traits.h 445
UninitValue libkea-dhcp++.so.88.0.0 copy /usr/include/c++/13/bits char_traits.h 445
UninitValue libkea-dhcp++.so.88.0.0 operator char, std::char_traits char
UninitValue libkea-log.so.60.0.0 replace /usr/include/c++/13/bits basic_string.h 2144
UninitValue libkea-log.so.60.0.0 assign /usr/include/c++/13/bits char_traits.h 368
UninitValue libkea-log.so.60.0.0 isc::log::LoggerImpl::outputRaw(isc::log::Severity const , std::__cxx11::basic_string
There are many more suppressed valgrind errors: counting 1601. You can find them here: https://gitlab.isc.org/isc-private/qa-dhcp/-/blob/master/kea/valgrind.supp. There was no logical attempt at suppressing false positives. We just tried to supress all of them to test suppresson, so you may look at them as if they weren't suppressed in the first place. We'll refine it in time, maybe after this issue is solved.
So along with Kea fixes, please also include a list of false positives you think should be included as suppressions. The closer the list is to the format of valgrind.supp above, the better. If this issue won't address all valgrind errors, I suppose there could also be a list of suppressions that could be excluded from valgrind.supp.