Bug #5390
closedUninitialized warning with gcc 16
100%
Description
The error message below is from a debug build on Ubuntu 24.04, so with Boost 1.83, but I tried with Boost 1.90 and the error persists.
In member function ‘boost::multi_index::multi_index_container<Value, IndexSpecifierList, Allocator>::final_node_type* boost::multi_index::multi_index_container<Value, IndexSpecifierList, Allocator>::header() const [with Value = ndn::InMemoryStorageEntry*; IndexSpecifierList = boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > >; Allocator = std::allocator<ndn::InMemoryStorageEntry*>]’,
inlined from ‘boost::multi_index::detail::index_base<Value, IndexSpecifierList, Allocator>::final_node_type* boost::multi_index::detail::index_base<Value, IndexSpecifierList, Allocator>::final_header() const [with Value = ndn::InMemoryStorageEntry*; IndexSpecifierList = boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > >; Allocator = std::allocator<ndn::InMemoryStorageEntry*>]’ at /usr/include/boost/multi_index/detail/index_base.hpp:221:61,
inlined from ‘boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::index_node_type* boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::header() const [with SuperMeta = boost::multi_index::detail::nth_layer<2, ndn::InMemoryStorageEntry*, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > >, std::allocator<ndn::InMemoryStorageEntry*> >; TagList = boost::mpl::v_item<ndn::InMemoryStorageLru::byUsedTime, boost::mpl::vector0<mpl_::na>, 0>]’ at /usr/include/boost/multi_index/sequenced_index.hpp:904:59,
inlined from ‘void boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::empty_initialize() [with SuperMeta = boost::multi_index::detail::nth_layer<2, ndn::InMemoryStorageEntry*, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > >, std::allocator<ndn::InMemoryStorageEntry*> >; TagList = boost::mpl::v_item<ndn::InMemoryStorageLru::byUsedTime, boost::mpl::vector0<mpl_::na>, 0>]’ at /usr/include/boost/multi_index/sequenced_index.hpp:908:54,
inlined from ‘boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::sequenced_index(const ctor_args_list&, const allocator_type&) [with SuperMeta = boost::multi_index::detail::nth_layer<2, ndn::InMemoryStorageEntry*, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > >, std::allocator<ndn::InMemoryStorageEntry*> >; TagList = boost::mpl::v_item<ndn::InMemoryStorageLru::byUsedTime, boost::mpl::vector0<mpl_::na>, 0>]’ at /usr/include/boost/multi_index/sequenced_index.hpp:679:21,
inlined from ‘boost::multi_index::detail::hashed_index<KeyFromValue, Hash, Pred, SuperMeta, TagList, Category>::hashed_index(const ctor_args_list&, const allocator_type&) [with KeyFromValue = boost::multi_index::identity<ndn::InMemoryStorageEntry*>; Hash = boost::hash<ndn::InMemoryStorageEntry*>; Pred = std::equal_to<ndn::InMemoryStorageEntry*>; SuperMeta = boost::multi_index::detail::nth_layer<1, ndn::InMemoryStorageEntry*, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > >, std::allocator<ndn::InMemoryStorageEntry*> >; TagList = boost::mpl::v_item<ndn::InMemoryStorageLru::byEntity, boost::mpl::vector0<mpl_::na>, 0>; Category = boost::multi_index::detail::hashed_unique_tag]’ at /usr/include/boost/multi_index/hashed_index.hpp:757:13:
/usr/include/boost/multi_index_container.hpp:640:26: error: ‘((const boost::multi_index::multi_index_container<ndn::InMemoryStorageEntry*, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::multi_index::identity<ndn::InMemoryStorageEntry*>, mpl_::na, mpl_::na>, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na> >, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<ndn::InMemoryStorageEntry*> >*)this)[230584300921369395].boost::multi_index::multi_index_container<ndn::InMemoryStorageEntry*, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > > >::boost::multi_index::detail::header_holder<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::sequenced_index_node<boost::multi_index::detail::index_node_base<ndn::InMemoryStorageEntry*, std::allocator<ndn::InMemoryStorageEntry*> > > >*, boost::multi_index::multi_index_container<ndn::InMemoryStorageEntry*, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > > > >.boost::multi_index::detail::header_holder<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::sequenced_index_node<boost::multi_index::detail::index_node_base<ndn::InMemoryStorageEntry*, std::allocator<ndn::InMemoryStorageEntry*> > > >*, boost::multi_index::multi_index_container<ndn::InMemoryStorageEntry*, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<ndn::InMemoryStorageLru::byEntity>, boost::multi_index::identity<ndn::InMemoryStorageEntry*> >, boost::multi_index::sequenced<boost::multi_index::tag<ndn::InMemoryStorageLru::byUsedTime> > > > >::member’ is used uninitialized [-Werror=uninitialized]
640 | return &*bfm_header::member;
| ^~~~~~
Updated by Davide Pesavento 16 days ago
- Status changed from New to In Progress
I was unable to come up with a small standalone reproducer for this warning, so I can't tell whether this is (a) a bug in Boost, (b) a false positive in gcc 16, or (c) a bug in ndn-cxx. I tend towards excluding the last option because there are several instances of the same warning in ndn-cxx in completely different contexts, and after briefly checking the surrounding code I didn't see any obvious missing initializations. However, I can't be 100% sure.
Since the warning itself can flag real bugs and is generally fairly reliable, I don't think it would be a good idea to disable it completely. Instead, we should make it non-fatal even in debug builds.
Updated by Davide Pesavento 15 days ago
- Status changed from In Progress to Code review
Updated by Davide Pesavento 14 days ago
NFD's DeadNonceList is affected as well.
Updated by Davide Pesavento 13 days ago
- Status changed from Code review to Closed
- % Done changed from 0 to 100