[Mesa-dev] [Bug 81834] New: TGSI constant buffer overrun causes LLVM assertion failure

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jul 28 03:03:27 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=81834

          Priority: medium
            Bug ID: 81834
          Assignee: mesa-dev at lists.freedesktop.org
           Summary: TGSI constant buffer overrun causes LLVM assertion
                    failure
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: michel at daenzer.net
          Hardware: Other
            Status: NEW
           Version: git
         Component: Mesa core
           Product: Mesa

Created attachment 103581
  --> https://bugs.freedesktop.org/attachment.cgi?id=103581&action=edit
TappyChicken output with MESA_GLSL=dump R600_DEBUG=ps

Trying to run any Unreal Engine 4 demo fails with this LLVM assertion failure,
see the backtrace below:

.../llvm/lib/IR/Instructions.cpp:2377: static llvm::CastInst
*llvm::CastInst::Create(Instruction::CastOps, llvm::Value *, llvm::Type *,
const llvm::Twine &, llvm::Instruction *): Assertion `castIsValid(op, S, Ty) &&
"Invalid cast!"' failed.


I'm attaching the output of the TappyChicken demo with MESA_GLSL=dump
R600_DEBUG=ps. The TGSI code uses CONST[3][44], but that constant array is
declared as having only 5 entries:

DCL CONST[3][0..4]
[...]
  0: MAD TEMP[0].xyz, IMM[1].xxyy, CONST[3][44].wwww, CONST[3][44].xyzz

So I guess something goes wrong when converting from GLSL IR to TGSI.

It seems I can work around this by reverting commit
f4b0ab7afd83c811329211eae8167c9bf238870c ('st/mesa: fix incorrect size of UBO
declarations'), but I'm not sure it's directly related.


Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffed324700 (LWP 4227)]
0x00007ffff69c6407 in __GI_raise (sig=sig at entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff69c6407 in __GI_raise (sig=sig at entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff69c77e8 in __GI_abort () at abort.c:89
#2  0x00007ffff69bf526 in __assert_fail_base (fmt=0x7ffff6af5d18 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", 
    assertion=assertion at entry=0x7ffff0af543f "castIsValid(op, S, Ty) &&
\"Invalid cast!\"", file=file at entry=0x7ffff0af30d6
"/home/daenzer/src/llvm-git/llvm/lib/IR/Instructions.cpp", 
    line=line at entry=2377, 
    function=function at entry=0x7ffff0af5469 "static llvm::CastInst
*llvm::CastInst::Create(Instruction::CastOps, llvm::Value *, llvm::Type *,
const llvm::Twine &, llvm::Instruction *)")
    at assert.c:92
#3  0x00007ffff69bf5d2 in __GI___assert_fail (assertion=0x7ffff0af543f
"castIsValid(op, S, Ty) && \"Invalid cast!\"", 
    file=0x7ffff0af30d6
"/home/daenzer/src/llvm-git/llvm/lib/IR/Instructions.cpp", line=2377, 
    function=0x7ffff0af5469 "static llvm::CastInst
*llvm::CastInst::Create(Instruction::CastOps, llvm::Value *, llvm::Type *,
const llvm::Twine &, llvm::Instruction *)") at assert.c:101
#4  0x00007ffff042cf05 in llvm::CastInst::Create (op=<optimized out>,
S=<optimized out>, Ty=<optimized out>, Name=..., InsertBefore=<optimized out>)
    at /home/daenzer/src/llvm-git/llvm/lib/IR/Instructions.cpp:2377
#5  0x00007fffefd3ae06 in llvm::IRBuilder<true, llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter<true> >::CreateCast (this=0x7fffe881dfb0,
Op=<optimized out>, V=0x7fffe8839ac8, 
    DestTy=<optimized out>, Name=...) at
/home/daenzer/src/llvm-git/llvm/include/llvm/IR/IRBuilder.h:1213
#6  0x00007ffff0397615 in CreateBitCast (Name=<error reading variable: Cannot
access memory at address 0xfefefefefefefeff>, this=<optimized out>,
V=<optimized out>, DestTy=<optimized out>)
    at /home/daenzer/src/llvm-git/llvm/include/llvm/IR/IRBuilder.h:1177
#7  LLVMBuildBitCast (B=0x1071, B at entry=0x7fffe881dfb0, Val=0x6,
Val at entry=0x7fffe8839ac8, DestTy=0x0, Name=<optimized out>,
Name at entry=0x7ffff1e3880d "")
    at /home/daenzer/src/llvm-git/llvm/lib/IR/Core.cpp:2430
#8  0x00007ffff1cfcc35 in bitcast (bld_base=<optimized out>,
value=0x7fffe8839ac8, type=TGSI_TYPE_FLOAT) at
../../../../../src/gallium/drivers/radeon/radeon_llvm.h:167
#9  fetch_constant (bld_base=<optimized out>, reg=<optimized out>,
type=TGSI_TYPE_FLOAT, swizzle=<optimized out>) at
../../../../../src/gallium/drivers/radeonsi/si_shader.c:646
#10 0x00007ffff1bbee9e in lp_build_emit_fetch (bld_base=0x7fffed31b600,
inst=0x7fffe884cd00, src_op=2, chan_index=<optimized out>)
    at ../../../../src/gallium/auxiliary/gallivm/lp_bld_tgsi.c:309
#11 0x00007ffff1bbf3e5 in lp_build_fetch_args (emit_data=<optimized out>,
bld_base=<optimized out>) at
../../../../src/gallium/auxiliary/gallivm/lp_bld_tgsi.c:177
#12 lp_build_tgsi_inst_llvm (bld_base=bld_base at entry=0x7fffed31b600,
inst=inst at entry=0x7fffe884cd00) at
../../../../src/gallium/auxiliary/gallivm/lp_bld_tgsi.c:249
#13 0x00007ffff1bbf775 in lp_build_tgsi_llvm
(bld_base=bld_base at entry=0x7fffed31b600, tokens=<optimized out>) at
../../../../src/gallium/auxiliary/gallivm/lp_bld_tgsi.c:476
#14 0x00007ffff1d00817 in si_pipe_shader_create (ctx=ctx at entry=0x4792530,
shader=shader at entry=0x7fffe880d410) at
../../../../../src/gallium/drivers/radeonsi/si_shader.c:2869
#15 0x00007ffff1d0761c in si_shader_select (ctx=ctx at entry=0x4792530,
sel=sel at entry=0x7fffe8033450) at
../../../../../src/gallium/drivers/radeonsi/si_state.c:2192
#16 0x00007ffff1d076e7 in si_create_shader_state (ctx=0x4792530,
state=0x7fffe8033200, pipe_shader_type=1) at
../../../../../src/gallium/drivers/radeonsi/si_state.c:2224
#17 0x00007ffff190cfc3 in st_translate_fragment_program (st=st at entry=0x4944a10,
stfp=stfp at entry=0x7fffe8763760, key=key at entry=0x7fffed323710)
    at ../../../src/mesa/state_tracker/st_program.c:808
#18 0x00007ffff190daa6 in st_get_fp_variant (st=st at entry=0x4944a10,
stfp=stfp at entry=0x7fffe8763760, key=key at entry=0x7fffed323710) at
../../../src/mesa/state_tracker/st_program.c:845
#19 0x00007ffff18c4424 in update_fp (st=0x4944a10) at
../../../src/mesa/state_tracker/st_atom_shader.c:96
#20 0x00007ffff18bf5d1 in st_validate_state (st=st at entry=0x4944a10) at
../../../src/mesa/state_tracker/st_atom.c:213
#21 0x00007ffff18c9eb1 in st_Clear (ctx=0x49e15b0, mask=256) at
../../../src/mesa/state_tracker/st_cb_clear.c:446
#22 0x00007ffff16cd778 in _mesa_ClearBufferfv (buffer=6144,
drawbuffer=<optimized out>, value=0x7fffed323ba0) at
../../../src/mesa/main/clear.c:536

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140728/b90f9358/attachment-0001.html>


More information about the mesa-dev mailing list