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

Bug: error: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ forming offset 8 is out of the bounds [0, 8] [-Werror=array-bounds=] #5557

Open
jiapei100 opened this issue Apr 30, 2024 · 4 comments
Labels
Bug Global flag to mark a deviation from expected behaviour

Comments

@jiapei100
Copy link

Describe the bug

[ 35%] Building CXX object code/CMakeFiles/assimp.dir/AssetLib/Blender/BlenderScene.cpp.o
cd ....../assimp/build/code && /usr/bin/c++ -DASSIMP_BUILD_DLL_EXPORT -DASSIMP_BUILD_NO_C4D_IMPORTER -DASSIMP_BUILD_NO_M3D_EXPORTER -DASSIMP_BUILD_NO_M3D_IMPORTER -DASSIMP_BUILD_NO_OWN_ZLIB -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 -DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0 -DOPENDDLPARSER_BUILD -DRAPIDJSON_HAS_STDSTRING=1 -DRAPIDJSON_NOMEMBERITERATORCLASS -Dassimp_EXPORTS -I....../assimp/build/include -I....../assimp/build -I....../assimp/include -I....../assimp/code -I....../assimp/. -I....../assimp/code/../contrib/pugixml/src -I....../assimp/code/../contrib/utf8cpp/source -I....../assimp/code/../contrib/rapidjson/include -I....../assimp/code/../contrib -I....../assimp/code/../contrib/openddlparser/include -I....../assimp/code/../include -I....../assimp/build/code/../include -I/usr/include/minizip -fvisibility=hidden -fno-strict-aliasing -Wall -std=c++17 -fPIC -O3 -DNDEBUG -std=gnu++17 -fPIC -Wno-dangling-reference -Wall -Werror -MD -MT code/CMakeFiles/assimp.dir/AssetLib/Blender/BlenderScene.cpp.o -MF CMakeFiles/assimp.dir/AssetLib/Blender/BlenderScene.cpp.o.d -o CMakeFiles/assimp.dir/AssetLib/Blender/BlenderScene.cpp.o -c ....../assimp/code/AssetLib/Blender/BlenderScene.cpp
In file included from /usr/include/c++/13/bits/specfun.h:43,
                 from /usr/include/c++/13/cmath:3699,
                 from ....../assimp/include/assimp/vector2.h:53,
                 from ....../assimp/include/assimp/types.h:64,
                 from ....../assimp/include/assimp/IOStream.hpp:53,
                 from ....../assimp/include/assimp/DefaultIOStream.h:55,
                 from ....../assimp/include/assimp/Exceptional.h:49,
                 from ....../assimp/include/assimp/BaseImporter.h:52,
                 from ....../assimp/code/AssetLib/MDL/MDLLoader.h:48,
                 from ....../assimp/code/AssetLib/MDL/MDLLoader.cpp:51:
In static member function ‘static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = long unsigned int; _Up = long unsigned int; bool _IsMove = false]’,
    inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30,
    inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42,
    inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31,
    inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7,
    inlined from ‘std::vector<bool, _Alloc>::iterator std::vector<bool, _Alloc>::_M_copy_aligned(const_iterator, const_iterator, iterator) [with _Alloc = std::allocator<bool>]’ at /usr/include/c++/13/bits/stl_bvector.h:1342:28,
    inlined from ‘void std::vector<bool, _Alloc>::_M_reallocate(size_type) [with _Alloc = std::allocator<bool>]’ at /usr/include/c++/13/bits/vector.tcc:851:40,
    inlined from ‘void std::vector<bool, _Alloc>::reserve(size_type) [with _Alloc = std::allocator<bool>]’ at /usr/include/c++/13/bits/stl_bvector.h:1130:17,
    inlined from ‘Assimp::MDL::IntSharedData_MDL7::IntSharedData_MDL7()’ at ....../assimp/code/AssetLib/MDL/MDLFileData.h:879:32,
    inlined from ‘void Assimp::MDLImporter::InternReadFile_3DGS_MDL7()’ at ....../assimp/code/AssetLib/MDL/MDLLoader.cpp:1360:29:
/usr/include/c++/13/bits/stl_algobase.h:437:30: error: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ forming offset 8 is out of the bounds [0, 8] [-Werror=array-bounds=]
  437 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To Reproduce
Steps to reproduce the behavior:
Just cmake and build.

Expected behavior
Successfully compiled...

Screenshots
N/A

Platform (please complete the following information):

  • OS: Ubuntu 24.04
  • gcc: 13.2.0

Additional context
N/A

@jiapei100 jiapei100 added the Bug Global flag to mark a deviation from expected behaviour label Apr 30, 2024
@kimkulling
Copy link
Member

Does this happen on the latest release?

@LuLuc
Copy link

LuLuc commented May 13, 2024

Hello,

I have the same issue from the tag v5.3.1 and v5.4.0 using g++ 13.2.0 on debian.
When i build with the parameter -DCMAKE_BUILD_TYPE=Debug it compile but when i build with
-DCMAKE_BUILD_TYPE=Release I have the same error and it doesn't compile.

@dbs4261
Copy link
Contributor

dbs4261 commented May 15, 2024

Seems to still be the case with v5.4.1 and both GCC 13.2.0 and GCC 14.0.1. Release and MinSizeRel fail, while Debug and RelWithDebInfo compile fine.
Same version compiles fine under Clang 18.1.3

@dbs4261
Copy link
Contributor

dbs4261 commented May 15, 2024

Seems to be linked to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107852

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour
Projects
None yet
Development

No branches or pull requests

4 participants