ubsan reports outside array bounds
Log: https://gitlab.freedesktop.org/okias/mesa/-/jobs/46185857
FAILED: src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_target_nv50.cpp.o
compiler-wrapper-g++.sh -Isrc/nouveau/codegen/libnouveau_codegen.a.p -Isrc/nouveau/codegen -I../src/nouveau/codegen -Isrc -I../src -Iinclude -I../include -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../subprojects/perfetto/sdk -Isrc/compiler/nir -I../src/compiler/nir -I/usr/include/libdrm -fvisibility=hidden -fdiagnostics-color=always -fsanitize=undefined -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c++17 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="23.3.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_OPENGL=1 -DHAVE_OPENGL_ES_1=1 -DHAVE_OPENGL_ES_2=1 -DHAVE_ETNAVIV -DHAVE_FREEDRENO -DHAVE_KMSRO -DHAVE_LIMA -DHAVE_NOUVEAU -DHAVE_PANFROST -DHAVE_SWRAST -DHAVE_TEGRA -DHAVE_V3D -DHAVE_VC4 -DHAVE_ZINK -DVIDEO_CODEC_VC1DEC=1 -DVIDEO_CODEC_H264DEC=1 -DVIDEO_CODEC_H264ENC=1 -DVIDEO_CODEC_H265DEC=1 -DVIDEO_CODEC_H265ENC=1 -DHAVE_X11_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DGLAPI_EXPORT_PROTO_ENTRY_POINTS=0 -DALLOW_KCMP -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -DHAVE_REALLOCARRAY -DHAVE_FMEMOPEN -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DUSE_AARCH64_ASM -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_SYS_INOTIFY_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_POSIX_FALLOCATE -DHAVE_GNU_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_ISSIGNALING -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DUSE_LIBELF -DWL_HIDE_DEPRECATED -DHAVE_DRI -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_DRISW_KMS -DHAVE_PERFETTO -Werror=return-type -Werror=empty-body -Wmisleading-indentation -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -flifetime-dse=1 -Werror=format -Wformat-security -ffunction-sections -fdata-sections -fPIC -pthread -MD -MQ src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_target_nv50.cpp.o -MF src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_target_nv50.cpp.o.d -o src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_target_nv50.cpp.o -c ../src/nouveau/codegen/nv50_ir_target_nv50.cpp
../src/nouveau/codegen/nv50_ir_target_nv50.cpp: In member function 'void nv50_ir::TargetNV50::initOpInfo()':
../src/nouveau/codegen/nv50_ir_target_nv50.cpp:179:28: error: array subscript [0, 255] is outside array bounds of 'nv50_ir::Target::OpInfo [133]' [-Werror=array-bounds]
179 | opInfo[prop->op].srcMods[s] |= NV50_IR_MOD_NEG;
| ~~~~~~~~~~~~~~~^
In file included from ../src/nouveau/codegen/nv50_ir_target_nv50.h:23,
from ../src/nouveau/codegen/nv50_ir_target_nv50.cpp:23:
../src/nouveau/codegen/nv50_ir_target.h:268:11: note: while referencing 'nv50_ir::Target::opInfo'
268 | OpInfo opInfo[OP_LAST + 1];
| ^~~~~~
../src/nouveau/codegen/nv50_ir_target_nv50.cpp:181:28: error: array subscript [0, 255] is outside array bounds of 'nv50_ir::Target::OpInfo [133]' [-Werror=array-bounds]
181 | opInfo[prop->op].srcMods[s] |= NV50_IR_MOD_ABS;
| ~~~~~~~~~~~~~~~^
../src/nouveau/codegen/nv50_ir_target.h:268:11: note: while referencing 'nv50_ir::Target::opInfo'
268 | OpInfo opInfo[OP_LAST + 1];
| ^~~~~~
../src/nouveau/codegen/nv50_ir_target_nv50.cpp:183:28: error: array subscript [0, 255] is outside array bounds of 'nv50_ir::Target::OpInfo [133]' [-Werror=array-bounds]
183 | opInfo[prop->op].srcMods[s] |= NV50_IR_MOD_NOT;
| ~~~~~~~~~~~~~~~^
../src/nouveau/codegen/nv50_ir_target.h:268:11: note: while referencing 'nv50_ir::Target::opInfo'
268 | OpInfo opInfo[OP_LAST + 1];
| ^~~~~~
cc1plus: all warnings being treated as errors
[1243/2359] Compiling C++ object src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir.cpp.o
[1244/2359] Compiling C++ object src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_print.cpp.o
[1245/2359] Compiling C++ object src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_ssa.cpp.o
[1246/2359] Compiling C++ object src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_emit_nv50.cpp.o
[1247/2359] Compiling C++ object src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_lowering_gv100.cpp.o
[1248/2359] Compiling C++ object src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_lowering_gm107.cpp.o
[1249/2359] Compiling C++ object src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_emit_gv100.cpp.o
[1250/2359] Compiling C++ object src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_from_nir.cpp.o
FAILED: src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_from_nir.cpp.o
compiler-wrapper-g++.sh -Isrc/nouveau/codegen/libnouveau_codegen.a.p -Isrc/nouveau/codegen -I../src/nouveau/codegen -Isrc -I../src -Iinclude -I../include -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../subprojects/perfetto/sdk -Isrc/compiler/nir -I../src/compiler/nir -I/usr/include/libdrm -fvisibility=hidden -fdiagnostics-color=always -fsanitize=undefined -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c++17 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="23.3.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_OPENGL=1 -DHAVE_OPENGL_ES_1=1 -DHAVE_OPENGL_ES_2=1 -DHAVE_ETNAVIV -DHAVE_FREEDRENO -DHAVE_KMSRO -DHAVE_LIMA -DHAVE_NOUVEAU -DHAVE_PANFROST -DHAVE_SWRAST -DHAVE_TEGRA -DHAVE_V3D -DHAVE_VC4 -DHAVE_ZINK -DVIDEO_CODEC_VC1DEC=1 -DVIDEO_CODEC_H264DEC=1 -DVIDEO_CODEC_H264ENC=1 -DVIDEO_CODEC_H265DEC=1 -DVIDEO_CODEC_H265ENC=1 -DHAVE_X11_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DGLAPI_EXPORT_PROTO_ENTRY_POINTS=0 -DALLOW_KCMP -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -DHAVE_REALLOCARRAY -DHAVE_FMEMOPEN -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DUSE_AARCH64_ASM -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_SYS_INOTIFY_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_POSIX_FALLOCATE -DHAVE_GNU_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_ISSIGNALING -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DUSE_LIBELF -DWL_HIDE_DEPRECATED -DHAVE_DRI -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_DRISW_KMS -DHAVE_PERFETTO -Werror=return-type -Werror=empty-body -Wmisleading-indentation -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -flifetime-dse=1 -Werror=format -Wformat-security -ffunction-sections -fdata-sections -fPIC -pthread -MD -MQ src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_from_nir.cpp.o -MF src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_from_nir.cpp.o.d -o src/nouveau/codegen/libnouveau_codegen.a.p/nv50_ir_from_nir.cpp.o -c ../src/nouveau/codegen/nv50_ir_from_nir.cpp
In member function 'bool {anonymous}::Converter::isResultFloat(nir_op)',
inlined from 'nv50_ir::DataType {anonymous}::Converter::getDType(nir_op, uint8_t)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:291:28,
inlined from 'nv50_ir::DataType {anonymous}::Converter::getDType(nir_alu_instr*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:260:19,
inlined from 'bool {anonymous}::Converter::visit(nir_alu_instr*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:2412:29:
../src/nouveau/codegen/nv50_ir_from_nir.cpp:229:45: error: array subscript [0, 511] is outside array bounds of 'const nir_op_info [428]' [-Werror=array-bounds]
229 | const nir_op_info &info = nir_op_infos[op];
| ~~~~~~~~~~~~~~~^
In file included from ../src/nouveau/codegen/nv50_ir_from_nir.cpp:25:
../src/compiler/nir/nir.h: In member function 'bool {anonymous}::Converter::visit(nir_alu_instr*)':
../src/compiler/nir/nir.h:1547:26: note: while referencing 'nir_op_infos'
1547 | extern const nir_op_info nir_op_infos[nir_num_opcodes];
| ^~~~~~~~~~~~
In member function 'bool {anonymous}::Converter::isResultFloat(nir_op)',
inlined from 'nv50_ir::DataType {anonymous}::Converter::getDType(nir_op, uint8_t)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:291:28,
inlined from 'nv50_ir::DataType {anonymous}::Converter::getDType(nir_alu_instr*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:260:19,
inlined from 'bool {anonymous}::Converter::visit(nir_alu_instr*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:2412:29:
../src/nouveau/codegen/nv50_ir_from_nir.cpp:229:45: error: array subscript [0, 511] is outside array bounds of 'const nir_op_info [428]' [-Werror=array-bounds]
229 | const nir_op_info &info = nir_op_infos[op];
| ~~~~~~~~~~~~~~~^
../src/compiler/nir/nir.h: In member function 'bool {anonymous}::Converter::visit(nir_alu_instr*)':
../src/compiler/nir/nir.h:1547:26: note: while referencing 'nir_op_infos'
1547 | extern const nir_op_info nir_op_infos[nir_num_opcodes];
| ^~~~~~~~~~~~
../src/nouveau/codegen/nv50_ir_from_nir.cpp: In member function 'bool {anonymous}::Converter::visit(nir_intrinsic_instr*)':
../src/nouveau/codegen/nv50_ir_from_nir.cpp:1577:61: error: array subscript [0, 1023] is outside array bounds of 'const nir_intrinsic_info [549]' [-Werror=array-bounds]
1577 | const nir_intrinsic_info &opInfo = nir_intrinsic_infos[op];
| ~~~~~~~~~~~~~~~~~~~~~~^
../src/compiler/nir/nir.h:2024:33: note: while referencing 'nir_intrinsic_infos'
2024 | extern const nir_intrinsic_info nir_intrinsic_infos[nir_num_intrinsics];
| ^~~~~~~~~~~~~~~~~~~
In file included from ../src/nouveau/codegen/nv50_ir_from_nir.cpp:30:
In member function 'unsigned int nv50_ir::TexInstruction::Target::getArgCount() const',
inlined from 'bool {anonymous}::Converter::visit(nir_tex_instr*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:2952:48,
inlined from 'bool {anonymous}::Converter::visit(nir_instr*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:1498:19,
inlined from 'bool {anonymous}::Converter::visit(nir_block*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:1371:17,
inlined from 'bool {anonymous}::Converter::visit(nir_cf_node*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:1350:19:
../src/nouveau/codegen/nv50_ir.h:1017:65: error: array subscript [0, 31] is outside array bounds of 'const nv50_ir::TexInstruction::Target::Desc [18]' [-Werror=array-bounds]
1017 | unsigned int getArgCount() const { return descTable[target].argc; }
| ~~~~~~~~~~~~~~~~^
../src/nouveau/codegen/nv50_ir.h: In member function 'bool {anonymous}::Converter::visit(nir_cf_node*)':
../src/nouveau/codegen/nv50_ir.h:1056:32: note: while referencing 'nv50_ir::TexInstruction::Target::descTable'
1056 | static const struct Desc descTable[TEX_TARGET_COUNT];
| ^~~~~~~~~
In member function 'unsigned int nv50_ir::TexInstruction::Target::getDim() const',
inlined from 'bool {anonymous}::Converter::visit(nir_tex_instr*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:3065:48,
inlined from 'bool {anonymous}::Converter::visit(nir_instr*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:1498:19,
inlined from 'bool {anonymous}::Converter::visit(nir_block*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:1371:17,
inlined from 'bool {anonymous}::Converter::visit(nir_cf_node*)' at ../src/nouveau/codegen/nv50_ir_from_nir.cpp:1350:19:
../src/nouveau/codegen/nv50_ir.h:1018:60: error: array subscript [0, 31] is outside array bounds of 'const nv50_ir::TexInstruction::Target::Desc [18]' [-Werror=array-bounds]
1018 | unsigned int getDim() const { return descTable[target].dim; }
| ~~~~~~~~~~~~~~~~^
../src/nouveau/codegen/nv50_ir.h: In member function 'bool {anonymous}::Converter::visit(nir_cf_node*)':
../src/nouveau/codegen/nv50_ir.h:1056:32: note: while referencing 'nv50_ir::TexInstruction::Target::descTable'
1056 | static const struct Desc descTable[TEX_TARGET_COUNT];
| ^~~~~~~~~
cc1plus: all warnings being treated as errors