Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecoTauTag/RecoTau: array bounds warning/error found in gcc 13.3.1 build #47219

Open
gartung opened this issue Jan 30, 2025 · 9 comments
Open

Comments

@gartung
Copy link
Member

gartung commented Jan 30, 2025

In static member function 'static constexpr _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const float; _Up = float; bool _IsMove = false]',
    inlined from 'constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const float*; _OI = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:506:30,
    inlined from 'constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const float*; _OI = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:533:42,
    inlined from 'constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const float*; _OI = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:540:31,
    inlined from 'constexpr _OI std::copy(_II, _II, _OI) [with _II = const float*; _OI = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:633:7,
    inlined from 'constexpr void std::vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const float*; _Tp = float; _Alloc = std::allocator<float>]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/vector.tcc:341:15,
    inlined from 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = float; _Alloc = std::allocator<float>]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_vector.h:790:21,
    inlined from 'virtual reco::SingleTauDiscriminatorContainer reco::tau::PATTauDiscriminationByMVAIsolationRun2::discriminate(const TauDiscriminationProducerBase<pat::Tau, edm::ValueMap<reco::SingleTauDiscriminatorContainer>, reco::SingleTauDiscriminatorContainer, pat::PATTauDiscriminator>::TauRef&) const' at src/RecoTauTag/RecoTau/plugins/PATTauDiscriminationByMVAIsolationRun2.cc:187:30:
  /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:437:30: error: 'void* __builtin_memmove(void*, const void*, long unsigned int)' forming offset 4 is out of the bounds [0, 4] of object '<anonymous>' with type 'const float [1]' [-Werror=array-bounds=]
   437 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/RecoTauTag/RecoTau/plugins/PATTauDiscriminationByMVAIsolationRun2.cc: In member function 'virtual reco::SingleTauDiscriminatorContainer reco::tau::PATTauDiscriminationByMVAIsolationRun2::discriminate(const TauDiscriminationProducerBase<pat::Tau, edm::ValueMap<reco::SingleTauDiscriminatorContainer>, reco::SingleTauDiscriminatorContainer, pat::PATTauDiscriminator>::TauRef&) const':
src/RecoTauTag/RecoTau/plugins/PATTauDiscriminationByMVAIsolationRun2.cc:187:30: note: '<anonymous>' declared here
  187 |       result.rawValues = {-1.};
      |                              ^
In static member function 'static constexpr _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const float; _Up = float; bool _IsMove = false]',
    inlined from 'constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const float*; _OI = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:506:30,
    inlined from 'constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const float*; _OI = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:533:42,
    inlined from 'constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const float*; _OI = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:540:31,
    inlined from 'constexpr _OI std::copy(_II, _II, _OI) [with _II = const float*; _OI = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:633:7,
    inlined from 'static _ForwardIterator std::__uninitialized_copy<true>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const float*; _ForwardIterator = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_uninitialized.h:147:27,
    inlined from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const float*; _ForwardIterator = float*]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_uninitialized.h:185:15,
    inlined from 'constexpr _ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = const float*; _ForwardIterator = float*; _Tp = float]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_uninitialized.h:373:37,
    inlined from 'constexpr void std::vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const float*; _Tp = float; _Alloc = std::allocator<float>]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/vector.tcc:345:35,
    inlined from 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = float; _Alloc = std::allocator<float>]' at /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_vector.h:790:21,
    inlined from 'virtual reco::SingleTauDiscriminatorContainer reco::tau::PATTauDiscriminationByMVAIsolationRun2::discriminate(const TauDiscriminationProducerBase<pat::Tau, edm::ValueMap<reco::SingleTauDiscriminatorContainer>, reco::SingleTauDiscriminatorContainer, pat::PATTauDiscriminator>::TauRef&) const' at src/RecoTauTag/RecoTau/plugins/PATTauDiscriminationByMVAIsolationRun2.cc:187:30:
  /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/el8_amd64_gcc13/external/gcc/13.3.1-92b2d78dc343ed2bc93c8eb414ddc9ff/include/c++/13.3.1/bits/stl_algobase.h:437:30: error: 'void* __builtin_memmove(void*, const void*, long unsigned int)' offset [-9223372036854775803, -1] is out of the bounds [0, 4] of object '<anonymous>' with type 'const float [1]' [-Werror=array-bounds=]
   437 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/RecoTauTag/RecoTau/plugins/PATTauDiscriminationByMVAIsolationRun2.cc: In member function 'virtual reco::SingleTauDiscriminatorContainer reco::tau::PATTauDiscriminationByMVAIsolationRun2::discriminate(const TauDiscriminationProducerBase<pat::Tau, edm::ValueMap<reco::SingleTauDiscriminatorContainer>, reco::SingleTauDiscriminatorContainer, pat::PATTauDiscriminator>::TauRef&) const':
src/RecoTauTag/RecoTau/plugins/PATTauDiscriminationByMVAIsolationRun2.cc:187:30: note: '<anonymous>' declared here
  187 |       result.rawValues = {-1.};
      |                              ^
@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 30, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

A new Issue was created by @gartung.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@makortel
Copy link
Contributor

This looks like a compiler bug (similar to #47218)

reco::SingleTauDiscriminatorContainer result;
result.rawValues = {-1.};

std::vector<float> rawValues; // stores floating point discriminators, like MVA raw values or pt sums.

@makortel
Copy link
Contributor

assign core

@cmsbuild
Copy link
Contributor

New categories assigned: core

@Dr15Jones,@makortel,@smuzaffar you have been requested to review this Pull request/Issue and eventually sign? Thanks

@gartung
Copy link
Member Author

gartung commented Jan 31, 2025

Apparent you have to specify 1.0 is float with 1.f
https://gcc.gnu.org/gcc-13/porting_to.html

@makortel
Copy link
Contributor

Could you try if result.rawValues = {-1.f}; would silence the warning? (although given similar warning in #47218 with int I don't have high hopes)

@gartung
Copy link
Member Author

gartung commented Jan 31, 2025

OK

@gartung
Copy link
Member Author

gartung commented Jan 31, 2025

Unfortunately it didn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants