Open bieryAtFnal opened 2 years ago
I'm not sure if these are also relevant for the readoutlibs package. Maybe there should instead be reported against hsilibs?
[108/126] Building CXX object hsilibs/CMakeFiles/hsilibs_HSIDataLinkHandler_duneDAQModule.dir/plugins/HSIDataLinkHandler.cpp.o
In file included from /home/nfs/dunedaq/daqsw/25SepDevTest/sourcecode/readoutlibs/include/readoutlibs/models/IterableQueueModel.hpp:335,
from /home/nfs/dunedaq/daqsw/25SepDevTest/sourcecode/readoutlibs/include/readoutlibs/models/BinarySearchQueueModel.hpp:16,
from /home/nfs/dunedaq/daqsw/25SepDevTest/sourcecode/hsilibs/plugins/HSIDataLinkHandler.cpp:16:
/home/nfs/dunedaq/daqsw/25SepDevTest/sourcecode/readoutlibs/include/readoutlibs/models/detail/IterableQueueModel.hxx: In instantiation of 'void dunedaq::readoutlibs::IterableQueueModel~~^~~~
In member function 'bool dunedaq::readoutlibs::IterableQueueModel~~~~~~~~~~~~~
/home/nfs/dunedaq/daqsw/25SepDevTest/sourcecode/readoutlibs/include/readoutlibs/models/detail/IterableQueueModel.hxx: In member function 'void dunedaq::readoutlibs::IterableQueueModel~~
Concerning the first post, in which there's a warning about folly's ConcurrentSkipList
class:
gcc 12.1.0
seems to be warning merely of the possibility of an out-of-bounds array error, rather than identifying a concrete violation. Even creating a one-liner test program where the body of main()
looks like "std::shared_ptr<SkipListT> skl(SkipListT::createInstance(2));
" and where the application immediately returns after, the warning still appears. This is basically a heavily-truncated version of test_composite_key_app.cxx
. It looks like to this day the classic C-style array is still used for ConcurrentSkipList
in folly, so upgrading's not going to quiet this warning; we may want to consider doing so manually using #pragma
s, as this may actually be an appropriate use of them.
Concerning the second post, discussing readoutlibs
-based code causing a warning when hsilibs
is built:
For starters, it's of course "interesting" that the warnings appear when hsilibs
is built, but not when the actual source of the warning, readoutlibs
, is built. The reason for this is that there isn't any place in the readoutlibs
codebase where an IterableQueueModel
instance is actually created. If, say, a unit test for IterableQueueModel
were written, then the warning would appear when readoutlibs
was built and not discovered when developing other packages. In the case of hsilibs
, we do get a warning since a derived class of IterableQueueModel
gets instantiated in a plugin.
As far as the warnings themselves: the first one will go away if we make numa_node
an int
rather than a uint8_t
, which has the added advantage of adhering more closely to our coding guideline "Don't declare a variable unsigned unless it's really needed, like with a bit pattern". This will likely also require us to make the change in the corresponding jsonnet file. The second one will go away with a change as simple as replacing T element;
with T element = T();
since it seems gcc 12.1.0
wants to be sure the default construction is a conscious decision on the part of the developer.
[34/126] Building CXX object readoutlibs/CMakeFiles/readoutlibs_test_composite_key.dir/test/apps/test_composite_key_app.cxx.o In file included from /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList.h:130, from /home/nfs/dunedaq/daqsw/25SepDevTest/sourcecode/readoutlibs/test/apps/test_composite_key_app.cxx:15: In member function 'size_t folly::detail::SkipListRandomHeight::getSizeLimit(int) const', inlined from 'std::pair<folly::detail::SkipListNode, long unsigned int> folly::ConcurrentSkipList<T, Comp, NodeAlloc, MAX_HEIGHT>::addOrGetData(U&&) [with U = dunedaq::readoutlibs::types::DUMMY_FRAME_STRUCT; T = dunedaq::readoutlibs::types::DUMMY_FRAME_STRUCT; Comp = std::less; NodeAlloc = folly::SysAllocator; int MAX_HEIGHT = 24]' at /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList.h:352:63:
/cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList-inl.h:199:34: warning: array subscript 64 is above array bounds of 'const sizet [64]' {aka 'const long unsigned int [64]'} [-Warray-bounds]
199 | return sizeLimitTable[height];
| , long unsigned int> folly::ConcurrentSkipList<T, Comp, NodeAlloc, MAX_HEIGHT>::addOrGetData(U&&) [with U = dunedaq::readoutlibs::types::DUMMY_FRAME_STRUCT; T = dunedaq::readoutlibs::types::DUMMY_FRAME_STRUCT; Comp = std::less; NodeAlloc = folly::SysAllocator; int MAXHEIGHT = 24]':
/cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList-inl.h:232:10: note: while referencing 'folly::detail::SkipListRandomHeight::sizeLimitTable'
232 | sizet sizeLimitTable[kMaxHeight];
| ^, long unsigned int> folly::ConcurrentSkipList<T, Comp, NodeAlloc, MAX_HEIGHT>::addOrGetData(U&&) [with U = dunedaq::readoutlibs::types::DUMMY_FRAME_STRUCT; T = dunedaq::readoutlibs::types::DUMMY_FRAME_STRUCT; Comp = std::less; NodeAlloc = folly::SysAllocator; int MAX_HEIGHT = 24]' at /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList.h:352:63:
/cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList-inl.h:199:34: warning: array subscript 64 is above array bounds of 'const sizet [64]' {aka 'const long unsigned int [64]'} [-Warray-bounds]
199 | return sizeLimitTable[height];
| , long unsigned int> folly::ConcurrentSkipList<T, Comp, NodeAlloc, MAX_HEIGHT>::addOrGetData(U&&) [with U = dunedaq::readoutlibs::types::DUMMY_FRAME_STRUCT; T = dunedaq::readoutlibs::types::DUMMY_FRAME_STRUCT; Comp = std::less; NodeAlloc = folly::SysAllocator; int MAXHEIGHT = 24]':
/cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList-inl.h:232:10: note: while referencing 'folly::detail::SkipListRandomHeight::sizeLimitTable'
232 | sizet sizeLimitTable[kMaxHeight];
| ^
~~~~~~^ /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList-inl.h: In member function 'std::pair<folly::detail::SkipListNode~~~~~~ [34/126] Building CXX object hsilibs/CMakeFiles/hsilibs_HSIController_duneDAQModule.dir/plugins/HSIController.cpp.o [35/126] Building CXX object readoutlibs/CMakeFiles/readoutlibs_test_lb_allocation.dir/test/apps/test_lb_allocation_app.cxx.o [35/126] Generating codegen/include/dfmodules/datawriter/Structs.hpp [36/126] Building CXX object readoutlibs/CMakeFiles/readoutlibs_test_skiplist.dir/test/apps/test_skiplist_app.cxx.o In file included from /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList.h:130, from /home/nfs/dunedaq/daqsw/25SepDevTest/sourcecode/readoutlibs/test/apps/test_skiplist_app.cxx:15: In member function 'size_t folly::detail::SkipListRandomHeight::getSizeLimit(int) const', inlined from 'std::pair<folly::detail::SkipListNode~~~~~~^ /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v1.0/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/folly-2021.12.13.00-acobv4yxnw7pfvnjabizdyahmmb7fmd4/include/folly/ConcurrentSkipList-inl.h: In member function 'std::pair<folly::detail::SkipListNode~~~~~~