unhandled operation nir_op_fdot3 in do_alu_action() in gallium/auxiliary/gallivm/lp_bld_nir.c
System information
System: Host: SlavaComputer Kernel: 5.12.6-arch1-1 x86_64 bits: 64 compiler: gcc v: 11.1.0 Desktop: GNOME 40.1
tk: GTK 3.24.29 wm: gnome-shell dm: GDM Distro: Arch Linux
CPU: Info: Dual Core model: Intel Core i5 650 bits: 64 type: MT MCP arch: Nehalem rev: 2 cache: L2: 4 MiB
flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 25547
Speed: 1225 MHz min/max: 1200/3201 MHz boost: enabled Core speeds (MHz): 1: 1225 2: 1526 3: 2521 4: 1325
Graphics: Device-1: NVIDIA G98 [Quadro NVS 295] driver: nouveau v: kernel bus-ID: 01:00.0 chip-ID: 10de:06fd
Display: x11 server: X.Org 1.20.11 compositor: gnome-shell driver: loaded: modesetting
alternate: fbdev,nouveau,nv,vesa resolution: 1680x1050~60Hz s-dpi: 96
OpenGL: renderer: NV98 v: 3.3 Mesa 21.1.1 direct render: Yes
Issue
I'm supporting a very old opengl-based programm and since latest OS update I got crash during old-style picking (through glRenderMode(GL_SELECT)). I've managed to compose quite small example with glut, it is attached. To compile and run:
g++ test.cpp `pkgconf --cflags --libs glut glu gl` -g -O0 && a.out
When you click on the rectangle the program crashes. The stacktrace of crash is:
(gdb) bt
#0 0x00007ffff0a87432 in LLVMBuildBitCast () from /usr/lib/libLLVM-11.so
#1 0x00007ffff6146f90 in visit_alu (bld_base=<optimized out>, instr=0x5555556a3700) at ../mesa-21.1.1/src/gallium/auxiliary/gallivm/lp_bld_nir.c:1016
#2 0x00007ffff6afb1ab in visit_block (block=0x5555556964e0, block=0x5555556964e0, bld_base=0x7fffffff7a20) at ../mesa-21.1.1/src/gallium/auxiliary/gallivm/lp_bld_nir.c:2140
#3 visit_cf_list.isra.1 (bld_base=bld_base@entry=0x7fffffff7a20, list=<optimized out>, list=<optimized out>) at ../mesa-21.1.1/src/gallium/auxiliary/gallivm/lp_bld_nir.c:2200
#4 0x00007ffff611d669 in lp_build_nir_llvm (nir=<optimized out>, bld_base=0x7fffffff7a20) at ../mesa-21.1.1/src/gallium/auxiliary/gallivm/lp_bld_nir.c:2293
#5 lp_build_nir_soa (gallivm=<optimized out>, shader=<optimized out>, params=<optimized out>, outputs=<optimized out>) at ../mesa-21.1.1/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c:2443
#6 0x00007ffff60b2b00 in generate_vs (bld_mask=0x7fffffff84d0, clamp_vertex_color=1 '\001', draw_image=0x5555556bfdf0, draw_sampler=0x5555556bfd40, context_ptr=0x5555555c02c0, system_values=0x7fffffff86c0, inputs=0x7fffffff9bf0, outputs=0x7fffffff91f0, vs_type=..., builder=0x5555556a68d0, variant=0x55555568f010) at ../mesa-21.1.1/src/gallium/auxiliary/draw/draw_llvm.c:973
#7 draw_llvm_generate (llvm=0x5555556e55e0, variant=<optimized out>) at ../mesa-21.1.1/src/gallium/auxiliary/draw/draw_llvm.c:2287
#8 0x00007ffff60bfcf5 in draw_llvm_create_variant (key=0x7fffffffb290, num_inputs=2, llvm=0x5555556e55e0) at ../mesa-21.1.1/src/gallium/auxiliary/draw/draw_llvm.c:909
#9 llvm_middle_end_prepare (middle=<optimized out>, in_prim=<optimized out>, opt=<optimized out>, max_vertices=<optimized out>) at ../mesa-21.1.1/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c:399
#10 0x00007ffff6071f76 in vsplit_prepare (frontend=0x5555556cda90, in_prim=<optimized out>, middle=<optimized out>, opt=<optimized out>) at ../mesa-21.1.1/src/gallium/auxiliary/draw/draw_pt_vsplit.c:229
#11 0x00007ffff6b01486 in draw_pt_arrays.isra.0 (draw=draw@entry=0x5555556b5090, prim=7, draw_info=draw_info@entry=0x7fffffffbf40, num_draws=num_draws@entry=1) at ../mesa-21.1.1/src/gallium/auxiliary/draw/draw_pt.c:129
#12 0x00007ffff60617a5 in draw_instances (draw=draw@entry=0x5555556b5090, info=info@entry=0x7fffffffbf50, draws=draws@entry=0x7fffffffbf40, num_draws=num_draws@entry=1) at ../mesa-21.1.1/src/gallium/auxiliary/draw/draw_pt.c:495
#13 0x00007ffff606b639 in draw_vbo (draw=0x5555556b5090, info=0x7fffffffbf50, indirect=<optimized out>, draws=0x7fffffffbf40, num_draws=1) at ../mesa-21.1.1/src/gallium/auxiliary/draw/draw_pt.c:619
#14 0x00007ffff5c44643 in st_feedback_draw_vbo (ctx=<optimized out>, prims=<optimized out>, nr_prims=<optimized out>, ib=<optimized out>, index_bounds_valid=<optimized out>, primitive_restart=<optimized out>, restart_index=<optimized out>, min_index=<optimized out>, max_index=<optimized out>, num_instances=<optimized out>, base_instance=<optimized out>) at ../mesa-21.1.1/src/mesa/state_tracker/st_draw_feedback.c:461
#15 0x00007ffff5cf12cb in _mesa_draw_gallium_fallback (ctx=0x7fffec3e6010, info=0x7fffec423270, draws=0x7fffec423298, num_draws=1) at ../mesa-21.1.1/src/mesa/main/draw.c:1004
#16 0x00007ffff5ce4713 in _mesa_draw_gallium_complex_fallback (ctx=0x7fffec3e6010, info=0x7fffec423270, draws=0x7fffec423298, mode=0x7fffec423498 "\a", base_vertex=0x0, num_draws=1) at ../mesa-21.1.1/src/mesa/main/draw.c:1087
#17 0x00007ffff5dff1ec in vbo_exec_vtx_flush (exec=0x7fffec421b60) at ../mesa-21.1.1/src/mesa/vbo/vbo_exec_draw.c:336
#18 0x00007ffff5dff565 in vbo_exec_FlushVertices_internal.part.0.lto_priv.0 (exec=0x7fffec421b60, flags=<optimized out>) at ../mesa-21.1.1/src/mesa/vbo/vbo_exec_api.c:685
#19 0x00007ffff5d4814c in vbo_exec_FlushVertices_internal (flags=1, exec=0x7fffec421b60) at ../mesa-21.1.1/src/mesa/vbo/vbo_exec_api.c:1101
#20 vbo_exec_FlushVertices (flags=1, ctx=0x7fffec3e6010) at ../mesa-21.1.1/src/mesa/vbo/vbo_exec_api.c:1119
#21 pop_matrix (stack=0x7fffec3fbc20, ctx=0x7fffec3e6010) at ../mesa-21.1.1/src/mesa/main/matrix.c:381
#22 _mesa_PopMatrix () at ../mesa-21.1.1/src/mesa/main/matrix.c:409
#23 0x00005555555555a9 in draw_block (colorInfill=16711680, x=-0.300000012, y=0, z=-2) at test.cpp:42
#24 0x000055555555560e in gl_draw () at test.cpp:54
#25 0x0000555555555873 in gl_select (x=213, y=220) at test.cpp:114
#26 0x0000555555555910 in mousedw (x=213, y=180, but=0) at test.cpp:127
#27 0x0000555555555945 in mouseClick (button=0, state=0, x=213, y=180) at test.cpp:131
#28 0x00007ffff7f187f9 in fgPlatformProcessSingleEvent () from /usr/lib/libglut.so.3
#29 0x00007ffff7f107f0 in glutMainLoopEvent () from /usr/lib/libglut.so.3
#30 0x00007ffff7f10938 in glutMainLoop () from /usr/lib/libglut.so.3
#31 0x00005555555559d3 in main (argc=1, argv=0x7fffffffe528) at test.cpp:145
Would mesa be built in debug mode, I would get assert(0) in do_alu_action (src/gallium/auxiliary/gallivm/lp_bld_nir.c:518), since the operation nir_op_fdot3 is not supported in the switch there and the function returns an uninitialized pointer.
Regression
Regression since roughly start of the year 2021