Repository navigation
Closed
Description
[ 99%] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/__/__/wallet/test/fuzz/fees.cpp.o
[ 99%] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/__/__/wallet/test/fuzz/notifications.cpp.o
In file included from /usr/include/c++/13/span:41,
from /ci_container_base/src/span.h:10,
from /ci_container_base/src/util/feefrac.h:11,
from /ci_container_base/src/txgraph.h:10,
from /ci_container_base/src/test/fuzz/txgraph.cpp:5:
In member function ‘constexpr const std::array<_Tp, _Nm>::value_type& std::array<_Tp, _Nm>::operator[](size_type) const [with _Tp = long unsigned int; long unsigned int _Nm = 2]’,
inlined from ‘constexpr bool bitset_detail::MultiIntBitSet<I, N>::operator[](unsigned int) const [with I = long unsigned int; unsigned int N = 2]’ at /ci_container_base/src/util/bitset.h:351:22,
inlined from ‘void cluster_linearize::LinearizationChunking<SetType>::BuildChunks() [with SetType = bitset_detail::MultiIntBitSet<long unsigned int, 2>]’ at /ci_container_base/src/cluster_linearize.h:448:24:
/usr/include/c++/13/array:213:24: error: array subscript 2 is above array bounds of ‘std::__array_traits<long unsigned int, 2>::_Type’ {aka ‘const long unsigned int [2]’} [-Werror=array-bounds=]
213 | return _M_elems[__n];
| ~~~~~~~~^
/usr/include/c++/13/array: In member function ‘void cluster_linearize::LinearizationChunking<SetType>::BuildChunks() [with SetType = bitset_detail::MultiIntBitSet<long unsigned int, 2>]’:
/usr/include/c++/13/array:109:55: note: while referencing ‘std::array<long unsigned int, 2>::_M_elems’
109 | typename __array_traits<_Tp, _Nm>::_Type _M_elems;
| ^~~~~~~~
In member function ‘constexpr const std::array<_Tp, _Nm>::value_type& std::array<_Tp, _Nm>::operator[](size_type) const [with _Tp = long unsigned int; long unsigned int _Nm = 2]’,
inlined from ‘constexpr bool bitset_detail::MultiIntBitSet<I, N>::operator[](unsigned int) const [with I = long unsigned int; unsigned int N = 2]’ at /ci_container_base/src/util/bitset.h:351:22,
inlined from ‘void txgraph_fuzz_target(FuzzBufferType)’ at /ci_container_base/src/test/fuzz/txgraph.cpp:490:21:
/usr/include/c++/13/array:213:24: error: array subscript 2 is above array bounds of ‘std::__array_traits<long unsigned int, 2>::_Type’ {aka ‘const long unsigned int [2]’} [-Werror=array-bounds=]
213 | return _M_elems[__n];
| ~~~~~~~~^
/usr/include/c++/13/array: In function ‘void txgraph_fuzz_target(FuzzBufferType)’:
/usr/include/c++/13/array:109:55: note: while referencing ‘std::array<long unsigned int, 2>::_M_elems’
109 | typename __array_traits<_Tp, _Nm>::_Type _M_elems;
| ^~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [src/test/fuzz/CMakeFiles/fuzz.dir/build.make:1742: src/test/fuzz/CMakeFiles/fuzz.dir/txgraph.cpp.o] Error 1
Activity
maflcko commentedon Apr 15, 2025
This is a general bug in GCC (at least 13 and 14). I haven't tried GCC 11, 12, or 15. Also, I haven't looked into a minimal working reproducer, or upstream bugs, or fix, or workaround.
maflcko commentedon Apr 15, 2025
It is a gcc-12 regression. Minimized so far:
sipa commentedon Apr 15, 2025
Weird.
maflcko commentedon Apr 15, 2025
Yeah, trying to reduce it further shows that it is fragile, so I gave up for now. Also there are hundreds of those issues, so I am not sure if it is worth it to report: https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=array-bounds
maflcko commentedon Apr 17, 2025
I tried
creduce, but at some point it seems to have transformed the false positive warning into a true positive warning.Merge bitcoin#32325: ci: Add missing -Wno-error=array-bounds to valgr…
Merge bitcoin/bitcoin#32325: ci: Add missing -Wno-error=array-bounds …
Merge bitcoin/bitcoin#32325: ci: Add missing -Wno-error=array-bounds …
Merge bitcoin/bitcoin#32325: ci: Add missing -Wno-error=array-bounds …