When I compile Godot with all Undefinied Sanitizer options, then I see a lot of errors.
To see errors you need to compile Godot with sanitizers support and special ubsan arguments(integrated into this repository - https://github.com/qarmin/godot/tree/bb) and use LLVM(doesn't work on Windows and it is a little unstable(crashes a lot))
core/class_db.cpp:440:29: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'uint64_t' (aka 'unsigned long') changed the value to 18446744073709551615 (64-bit, unsigned)
core/command_queue_mt.h:331:48: runtime error: implicit conversion from type 'int' of value -8 (32-bit, signed) to type 'unsigned long' changed the value to 18446744073709551608 (64-bit, unsigned)
core/command_queue_mt.h:373:41: runtime error: implicit conversion from type 'int' of value -8 (32-bit, signed) to type 'unsigned long' changed the value to 18446744073709551608 (64-bit, unsigned)
core/command_queue_mt.h:431:42: runtime error: implicit conversion from type 'int' of value -2 (32-bit, signed) to type 'unsigned int' changed the value to 4294967294 (32-bit, unsigned)
core/hashfuncs.h:102:24: runtime error: unsigned integer overflow: 3419404768 + 3596517327 cannot be represented in type 'unsigned int'
core/hashfuncs.h:119:24: runtime error: unsigned integer overflow: 12770922021182837856 + 14810610120747550883 cannot be represented in type 'unsigned long'
core/hashfuncs.h:57:23: runtime error: unsigned integer overflow: 2402952384 + 2088358182 cannot be represented in type 'unsigned int'
core/hashfuncs.h:74:34: runtime error: unsigned integer overflow: 5863209 + 4294966197 cannot be represented in type 'unsigned int'
core/hashfuncs.h:79:11: runtime error: unsigned integer overflow: 13854873893642593893 + 7378697629483925504 cannot be represented in type 'unsigned long'
core/hashfuncs.h:79:11: runtime error: unsigned integer overflow: 18446744073709551613 + 524288 cannot be represented in type 'unsigned long'
core/hashfuncs.h:81:8: runtime error: unsigned integer overflow: 13839561648464986112 * 21 cannot be represented in type 'unsigned long'
core/hashfuncs.h:81:8: runtime error: unsigned integer overflow: 9547524425524499183 * 21 cannot be represented in type 'unsigned long'
core/hashfuncs.h:83:8: runtime error: unsigned integer overflow: 13931839403097828352 + 6194006260202536960 cannot be represented in type 'unsigned long'
core/hashfuncs.h:83:8: runtime error: unsigned integer overflow: 16024871226882627506 + 11020834466462821504 cannot be represented in type 'unsigned long'
core/hashfuncs.h:85:9: runtime error: implicit conversion from type 'int' of value -251287892 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4043679404 (32-bit, unsigned)
core/hashfuncs.h:85:9: runtime error: implicit conversion from type 'int' of value -399682699 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 3895284597 (32-bit, unsigned)
core/image.cpp:1287:15: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'uint32_t' (aka 'unsigned int')
core/image.cpp:658:40: runtime error: unsigned integer overflow: 37376 - 37632 cannot be represented in type 'unsigned int'
core/image.cpp:659:42: runtime error: unsigned integer overflow: 37376 - 37632 cannot be represented in type 'unsigned int'
core/image.cpp:660:51: runtime error: unsigned integer overflow: 18688 - 35072 cannot be represented in type 'unsigned int'
core/io/resource_loader.h:135:94: runtime error: unsigned integer overflow: 3661741246 + 715307540 cannot be represented in type 'unsigned int'
core/io/resource_loader.h:135:94: runtime error: unsigned integer overflow: 4017695364 + 715307540 cannot be represented in type 'unsigned int'
core/io/resource_loader.h:135:94: runtime error: unsigned integer overflow: 4107908486 + 715307540 cannot be represented in type 'unsigned int'
core/io/resource_loader.h:135:94: runtime error: unsigned integer overflow: 4216973687 + 715307540 cannot be represented in type 'unsigned int'
core/math/random_pcg.cpp:42:45: runtime error: unsigned integer overflow: 2832489 * 12114003972236794897 cannot be represented in type 'unsigned long'
core/math/random_pcg.cpp:42:45: runtime error: unsigned integer overflow: 2905591 * 12114003972236794897 cannot be represented in type 'unsigned long'
core/math/random_pcg.cpp:42:57: runtime error: unsigned integer overflow: 17405449380241845078 + 1442695040888963407 cannot be represented in type 'unsigned long long'
core/method_bind.gen.inc:681:17: runtime error: implicit conversion from type 'VisualShaderNodeCubeMap::Source' of value 3200171710 (32-bit, unsigned) to type 'int' changed the value to -1094795586 (32-bit, signed)
core/oa_hash_map.h:77:17: runtime error: unsigned integer overflow: 0 - 61 cannot be represented in type 'unsigned int'
core/oa_hash_map.h:77:32: runtime error: unsigned integer overflow: 4294967235 + 64 cannot be represented in type 'unsigned int'
core/typedefs.h:177:2: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int'
core/typedefs.h:184:9: runtime error: unsigned integer overflow: 4294967295 + 1 cannot be represented in type 'unsigned int'
core/ustring.cpp:1409:17: runtime error: implicit conversion from type 'char' of value -60 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 196 (8-bit, unsigned)
core/ustring.cpp:2205:25: runtime error: unsigned integer overflow: 2459999264 + 2090140897 cannot be represented in type 'unsigned int'
core/ustring.cpp:2248:25: runtime error: unsigned integer overflow: 2434698624 + 2089350252 cannot be represented in type 'unsigned int'
core/variant.cpp:1189:20: runtime error: implicit conversion from type 'int64_t' (aka 'long') of value -1 (64-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
core/variant.cpp:2162:15: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long') of value 12047754176567800795 (64-bit, unsigned) to type 'int64_t' (aka 'long') changed the value to -6398989897141750821 (64-bit, signed)
core/variant.cpp:2690:11: runtime error: implicit conversion from type 'int64_t' (aka 'long') of value -1 (64-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned)
core/variant.cpp:2808:11: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long') of value 107271114928693 (64-bit, unsigned) to type 'uint32_t' (aka 'unsigned int') changed the value to 11743797 (32-bit, unsigned)
drivers/gles2/rasterizer_storage_gles2.cpp:540:14: runtime error: implicit conversion from type 'int' of value -2 (32-bit, signed) to type 'unsigned int' changed the value to 4294967294 (32-bit, unsigned)
drivers/gles2/shader_gles2.cpp:186:48: runtime error: implicit conversion from type 'int' of value -2147483648 (32-bit, signed) to type 'unsigned int' changed the value to 2147483648 (32-bit, unsigned)
drivers/gles2/shader_gles2.h:262:38: runtime error: implicit conversion from type 'int' of value -2147483648 (32-bit, signed) to type 'unsigned int' changed the value to 2147483648 (32-bit, unsigned)
drivers/gles2/shader_gles2.h:264:38: runtime error: implicit conversion from type 'int' of value -17 (32-bit, signed) to type 'unsigned int' changed the value to 4294967279 (32-bit, unsigned)
drivers/gles3/rasterizer_scene_gles3.cpp:2434:57: runtime error: unsigned integer overflow: 18446744073709551489 + 128 cannot be represented in type 'unsigned long'
drivers/gles3/rasterizer_storage_gles3.cpp:627:14: runtime error: implicit conversion from type 'int' of value -2 (32-bit, signed) to type 'unsigned int' changed the value to 4294967294 (32-bit, unsigned)
drivers/gles3/shader_gles3.cpp:535:15: runtime error: implicit conversion from type 'GLuint' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'GLint' (aka 'int') changed the value to -1 (32-bit, signed)
drivers/gles3/shader_gles3.h:389:38: runtime error: implicit conversion from type 'int' of value -5 (32-bit, signed) to type 'unsigned int' changed the value to 4294967291 (32-bit, unsigned)
drivers/png/image_loader_png.cpp:67:51: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'size_t' (aka 'unsigned long') changed the value to 18446744073709551615 (64-bit, unsigned)
drivers/unix/net_socket_posix.cpp:689:9: runtime error: implicit conversion from type 'unsigned long' of value 140484085286312 (64-bit, unsigned) to type 'int' changed the value to 1448 (32-bit, signed)
editor/editor_sectioned_inspector.cpp:311:7: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'ObjectID' (aka 'unsigned long') changed the value to 18446744073709551615 (64-bit, unsigned)
main/main.cpp:1352:43: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long') of value 16189665037908562130 (64-bit, unsigned) to type 'int64_t' (aka 'long') changed the value to -2257079035800989486 (64-bit, signed)
modules/csg/csg.h:136:26: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -99 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967197 (32-bit, unsigned)
modules/gridmap/grid_map_editor_plugin.cpp:43:16: runtime error: upcast of misaligned address 0xbebebebebebebebe for type 'GridMap', which requires 8 byte alignment
modules/visual_script/visual_script.cpp:1290:24: runtime error: load of value 190, which is not a valid value for type 'bool'
platform/x11/os_x11.cpp:1807:28: runtime error: implicit conversion from type 'int' of value -2 (32-bit, signed) to type 'unsigned int' changed the value to 4294967294 (32-bit, unsigned)
platform/x11/os_x11.cpp:1808:28: runtime error: implicit conversion from type 'int' of value -5 (32-bit, signed) to type 'unsigned int' changed the value to 4294967291 (32-bit, unsigned)
scene/2d/tile_map.cpp:1236:15: runtime error: implicit conversion from type 'uint16_t' (aka 'unsigned short') of value 65535 (16-bit, unsigned) to type 'int16_t' (aka 'short') changed the value to -1 (16-bit, signed)
scene/2d/tile_map.cpp:1241:24: runtime error: implicit conversion from type 'int' of value -2147483648 (32-bit, signed) to type 'unsigned int' changed the value to 2147483648 (32-bit, unsigned)
scene/resources/audio_stream_sample.cpp:98:15: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'uint32_t' (aka 'unsigned int')
scene/resources/ray_shape.cpp:48:24: runtime error: load of value 190, which is not a valid value for type 'bool'
scene/resources/visual_shader_nodes.cpp:850:9: runtime error: load of value 3200171710, which is not a valid value for type 'VisualShaderNodeCubeMap::Source'
servers/physics_2d/broad_phase_2d_hash_grid.h:144:10: runtime error: unsigned integer overflow: 18437737054752470420 + 17870294860456355072 cannot be represented in type 'unsigned long'
servers/physics_2d/broad_phase_2d_hash_grid.h:146:11: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long') of value 9216652941687007833 (64-bit, unsigned) to type 'uint32_t' (aka 'unsigned int') changed the value to 3209701977 (32-bit, unsigned)
servers/visual_server.cpp:1013:27: runtime error: implicit conversion from type 'int' of value -262145 (32-bit, signed) to type 'unsigned int' changed the value to 4294705151 (32-bit, unsigned)
Godot version: 3.2.alpha.custom_build. 99cee9038 OS/device including version: Ubuntu 19.10 Issue description:
When I compile Godot with all Undefinied Sanitizer options, then I see a lot of errors. To see errors you need to compile Godot with sanitizers support and special ubsan arguments(integrated into this repository - https://github.com/qarmin/godot/tree/bb) and use LLVM(doesn't work on Windows and it is a little unstable(crashes a lot))
If you don't want to compile godot, then this is compiled version with support of ubsan sanitizer(Linux ) https://www.easypaste.org/file/s3PqQiaT/godot.x11.tools.64.llvms.tar.gz (size ~180MB, Github doesn't allow to host so big files and it will only be active some time)
Issues
Minimal reproduction project: Any project