Open akien-mga opened 3 years ago
Some others which I see in latest 3.x
branch with GCC 12 with production=yes target=release_debug tools=yes
. Raised in bullet, vhacd, and mbedtls.
The bullet and vhacd __builtin_memset
warnings have been reported upstream here: https://github.com/bulletphysics/bullet3/discussions/3998
In member function 'resize',
inlined from 'compute.constprop' at thirdparty/vhacd/src/btConvexHullComputer.cpp:2413:17:
thirdparty/vhacd/inc/btAlignedObjectArray.h:209:17: warning: '__builtin_memset' writing between 4 and 8589934592 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
209 | new (&m_data[i]) T(fillData);
| ^
thirdparty/vhacd/inc/btAlignedObjectArray.h: In member function 'compute.constprop':
thirdparty/vhacd/inc/btAlignedObjectArray.h:111:13: note: at offset [-8589934592, -4] into destination object 'MEM[(struct btAlignedObjectArray *)this_2(D) + 64B].m_data' of size [0, 9223372036854775807]
111 | if (m_data) {
| ^
In member function 'resize',
inlined from 'compute.constprop' at thirdparty/bullet/LinearMath/btConvexHullComputer.cpp:2676:30:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 4 and 8589934592 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'compute.constprop':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-8589934592, -4] into destination object 'MEM[(struct btAlignedObjectArray *)this_2(D) + 32B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'compute.constprop' at thirdparty/bullet/LinearMath/btConvexHullComputer.cpp:2678:14:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 4 and 8589934592 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'compute.constprop':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-8589934592, -4] into destination object 'MEM[(struct btAlignedObjectArray *)this_2(D) + 96B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
thirdparty/vhacd/src/VHACD.cpp: In member function 'ComputeBestClippingPlane.constprop':
thirdparty/vhacd/src/VHACD.cpp:703:48: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
703 | Mesh* chs = new Mesh[2 * m_ompNumProcessors];
| ^
/usr/include/c++/11/new:128:26: note: in a call to allocation function 'operator new []' declared here
128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^
thirdparty/vhacd/src/VHACD.cpp:703:48: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
703 | Mesh* chs = new Mesh[2 * m_ompNumProcessors];
| ^
/usr/include/c++/11/new:128:26: note: in a call to allocation function 'operator new []' declared here
128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^
In member function 'resize',
inlined from 'processConstraints' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:185:18:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'processConstraints':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)this_13(D) + 56B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'processConstraints' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:186:21:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'processConstraints':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)this_13(D) + 88B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'processConstraints' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:187:23:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'processConstraints':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)this_13(D) + 120B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
thirdparty/mbedtls/library/ssl_tls.c: In function 'ssl_calc_finished_tls_sha384':
thirdparty/mbedtls/library/ssl_tls.c:6411:5: warning: 'mbedtls_sha512_finish_ret' accessing 64 bytes in a region of size 48 [-Wstringop-overflow=]
6411 | mbedtls_sha512_finish_ret( &sha512, padbuf );
| ^
thirdparty/mbedtls/library/ssl_tls.c:6411:5: note: referencing argument 2 of type 'unsigned char *'
thirdparty/mbedtls/library/sha512.c:405:5: note: in a call to function 'mbedtls_sha512_finish_ret'
405 | int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
| ^
In member function 'resize',
inlined from 'convertBodies' at thirdparty/bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp:1366:49:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 4 and 8589934592 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'convertBodies':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-8589934592, -4] into destination object 'MEM[(struct btAlignedObjectArray *)this_32(D) + 304B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'setup' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:118:18,
inlined from 'solveConstraints' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:698:31:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'solveConstraints':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)_7 + 56B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'setup' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:119:21,
inlined from 'solveConstraints' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:698:31:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'solveConstraints':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)_7 + 88B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'setup' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:120:23,
inlined from 'solveConstraints' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:698:31:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'solveConstraints':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)_7 + 120B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'buildIslands' at thirdparty/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp:202:25,
inlined from 'buildAndProcessIslands' at thirdparty/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp:345:14,
inlined from 'solveConstraints' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:702:41:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'solveConstraints':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)_16 + 40B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'processIslands' at thirdparty/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp:442:25,
inlined from 'buildAndProcessIslands' at thirdparty/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp:346:19,
inlined from 'solveConstraints' at thirdparty/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:702:41:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'solveConstraints':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)_16 + 72B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'processCollision' at thirdparty/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp:261:23:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'processCollision':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)this_44(D) + 48B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'processCollision' at thirdparty/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp:276:25:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'processCollision':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)this_44(D) + 48B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'collideTVNoStackAlloc' at thirdparty/bullet/BulletCollision/BroadphaseCollision/btDbvt.h:1199:15,
inlined from 'processCollision' at thirdparty/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp:293:30:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'processCollision':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)this_44(D) + 16B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'processCollision' at thirdparty/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp:310:23:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'processCollision':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'MEM[(struct btAlignedObjectArray *)this_44(D) + 48B].m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
In member function 'resize',
inlined from 'processCollision' at thirdparty/bullet/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp:337:25:
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:223:33: warning: '__builtin_memset' writing between 8 and 17179869184 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
223 | new (&m_data[i]) T(fillData);
| ^
thirdparty/bullet/LinearMath/btAlignedObjectArray.h: In member function 'processCollision':
thirdparty/bullet/LinearMath/btAlignedObjectArray.h:109:21: note: at offset [-17179869184, -8] into destination object 'manifoldArray.m_data' of size [0, 9223372036854775807]
109 | if (m_data)
| ^
So I looked into this:
thirdparty/mbedtls/library/ssl_tls.c: In function 'ssl_calc_finished_tls_sha384':
thirdparty/mbedtls/library/ssl_tls.c:6411:5: warning: 'mbedtls_sha512_finish_ret' accessing 64 bytes in a region of size 48 [-Wstringop-overflow=]
6411 | mbedtls_sha512_finish_ret( &sha512, padbuf );
| ^
thirdparty/mbedtls/library/ssl_tls.c:6411:5: note: referencing argument 2 of type 'unsigned char *'
thirdparty/mbedtls/library/sha512.c:405:5: note: in a call to function 'mbedtls_sha512_finish_ret'
405 | int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
| ^
It has been worked around upstream with a #pragma diagnostic ignored
: https://github.com/ARMmbed/mbedtls/pull/4498
But that doesn't seem to work with LTO: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80922
So some of the warnings reported above by GCC might be due to this upstream bug, and if so unfixable on our end.
Godot version
3.x (52df2940bc3e8dfbe97bd2029badb831d772257c)
System information
Fedora 34 host, multiple target platforms
Issue description
When building official builds with https://github.com/godotengine/godot-build-scripts with LTO, I get a number of linking warnings. This is not new and doesn't prevent linking, but I'm finally taking time to list them so that we can see if they're fixable.
Windows MinGW GCC 10
Editor 64-bit release_debug
Template 64-bit release
Linux GCC 10
Editor, release_debug
Template 64-bit release
Template 32-bit release
Steps to reproduce
Build official builds using scripts from https://github.com/godotengine/godot-build-scripts and containers from https://github.com/godotengine/build-containers
Or possibly simpler steps by just reproducing a single build with similar toolchains and build options.
Minimal reproduction project
No response