[Mesa-dev] [Bug 94503] OpenCL segfaults during compilation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 11 20:38:43 UTC 2016


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

            Bug ID: 94503
           Summary: OpenCL segfaults during compilation
           Product: Mesa
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Other
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: twhitehead at gmail.com
        QA Contact: mesa-dev at lists.freedesktop.org

Created attachment 122238
  --> https://bugs.freedesktop.org/attachment.cgi?id=122238&action=edit
Simplified kernel that causes compiler segfault

I'm running Debian unstable with the mesa 11.1.2 packages installed and ran
into an issue whereby the the OpenCL compiler is segfaulting.

I've chopped my kernel down as much as I could and have attached it.  Here is
an example run and backtrace

https://github.com/twhitehead/clcc

$ clcc -l
Platform 0: Clover
  Device 0: AMD PITCAIRN (DRM 2.43.0, LLVM 3.7.1)
      Type = [ GPU, Accelerator, Custom ]
      Maximum compute units = 20
      Maximum work item dimensions = 3
      Maximum work item sizes = [ 256, 256, 256 ]
      Maximum work group size = 256
      Image support = False
      Global memory size = 1073741824
      Local memory size = 32768
Platform 1: Intel Gen OCL Driver
  Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
      Type = [ GPU, Accelerator, Custom ]
      Maximum compute units = 20
      Maximum work item dimensions = 3
      Maximum work item sizes = [ 512, 512, 512 ]
      Maximum work group size = 512
      Image support = True
        Image2D maximum width = 8192
        Image2D maximum height = 8192
        Image3D maximum width = 8192
        Image3D maximum height = 8192
        Image3D maximum depth = 2048
      Global memory size = 2147483648
      Local memory size = 65536

$ clcc -p "Clover" test.c
Segmentation fault

With the dbg packages installed the gdb backtrace functions give

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff48a77de in llvm::SlotIndex::getIndex (this=<synthetic pointer>)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/include/llvm/CodeGen/SlotIndexes.h:134

#0  0x00007ffff48a77de in llvm::SlotIndex::getIndex (this=<synthetic pointer>)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/include/llvm/CodeGen/SlotIndexes.h:134
#1  llvm::SlotIndex::operator>= (other=..., this=<synthetic pointer>)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/include/llvm/CodeGen/SlotIndexes.h:202
#2  llvm::LiveRange::find (this=this at entry=0x1df48570, Pos=..., Pos at entry=...)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/CodeGen/LiveInterval.cpp:307
#3  0x00007ffff499e477 in llvm::LiveRange::find (Pos=..., this=0x1df48570)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/include/llvm/CodeGen/LiveInterval.h:272
#4  llvm::LiveRange::liveAt (index=..., this=0x1df48570)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/include/llvm/CodeGen/LiveInterval.h:373
#5  (anonymous namespace)::RegisterCoalescer::updateRegDefsUses
(this=this at entry=0x1f7e3f80, SrcReg=2147485471, 
    DstReg=2147485589, SubIdx=17)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/CodeGen/RegisterCoalescer.cpp:1199
#6  0x00007ffff49a3e62 in (anonymous namespace)::RegisterCoalescer::joinCopy
(Again=<synthetic pointer>, 
    CopyMI=0x18fa720, this=0x1f7e3f80)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/CodeGen/RegisterCoalescer.cpp:1440
#7  (anonymous namespace)::RegisterCoalescer::copyCoalesceWorkList
(this=this at entry=0x1f7e3f80, CurrList=...)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/CodeGen/RegisterCoalescer.cpp:2767
#8  0x00007ffff49a5ecb in (anonymous
namespace)::RegisterCoalescer::coalesceLocals (this=this at entry=0x1f7e3f80)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/CodeGen/RegisterCoalescer.cpp:2892
#9  0x00007ffff49a6646 in (anonymous
namespace)::RegisterCoalescer::joinAllIntervals (this=0x1f7e3f80)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/CodeGen/RegisterCoalescer.cpp:2923
#10 (anonymous namespace)::RegisterCoalescer::runOnMachineFunction
(this=0x1f7e3f80, fn=...)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/CodeGen/RegisterCoalescer.cpp:2968
#11 0x00007ffff41ff037 in llvm::FPPassManager::runOnFunction (this=0x1f7382a0,
F=...)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/IR/LegacyPassManager.cpp:1520
#12 0x00007ffff41ff28b in llvm::FPPassManager::runOnModule (this=0x1f7382a0,
M=...)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/IR/LegacyPassManager.cpp:1540
#13 0x00007ffff41fecc4 in (anonymous namespace)::MPPassManager::runOnModule
(M=..., this=0x1685c760)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/IR/LegacyPassManager.cpp:1596
#14 llvm::legacy::PassManagerImpl::run (this=0x1dad02a0, M=...)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/IR/LegacyPassManager.cpp:1698
#15 0x00007ffff41fee59 in llvm::legacy::PassManager::run
(this=this at entry=0x7fffffffc380, M=...)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/IR/LegacyPassManager.cpp:1729
#16 0x00007ffff4c737a7 in LLVMTargetMachineEmit (T=T at entry=0x1948d20,
M=M at entry=0xa40dc0, OS=..., 
    codegen=codegen at entry=LLVMObjectFile,
ErrorMessage=ErrorMessage at entry=0x7fffffffc498)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/Target/TargetMachineC.cpp:217
#17 0x00007ffff4c73950 in LLVMTargetMachineEmitToMemoryBuffer
(T=T at entry=0x1948d20, M=M at entry=0xa40dc0, 
    codegen=codegen at entry=LLVMObjectFile,
ErrorMessage=ErrorMessage at entry=0x7fffffffc498, 
    OutMemBuf=OutMemBuf at entry=0x7fffffffc628)
    at
/build/llvm-toolchain-3.7-dRkmpB/llvm-toolchain-3.7-3.7.1/lib/Target/TargetMachineC.cpp:241
#18 0x00007ffff6733c14 in (anonymous namespace)::emit_code
(tm=tm at entry=0x1948d20, mod=mod at entry=0xa40dc0, 
    file_type=file_type at entry=LLVMObjectFile,
out_buffer=out_buffer at entry=0x7fffffffc628, 
    r_log="test.c:3:21: warning: double precision constant requires
cl_khr_fp64, casting to single precision\ntest.c:3:32: warning: double
precision constant requires cl_khr_fp64, casting to single precision\ntest"...)
    at
../../../../../../src/gallium/state_trackers/clover/llvm/invocation.cpp:621
#19 0x00007ffff6738977 in (anonymous namespace)::compile_native (
    r_log="test.c:3:21: warning: double precision constant requires
cl_khr_fp64, casting to single precision\ntest.c:3:32: warning: double
precision constant requires cl_khr_fp64, casting to single precision\ntest"..., 
    dump_asm=<optimized out>, processor="pitcairn", triple="amdgcn--",
mod=0xa40dc0)
    at
../../../../../../src/gallium/state_trackers/clover/llvm/invocation.cpp:675
#20 clover::compile_program_llvm (
    source="#line 1 \"test.c\"\n//", '-' <repeats 111 times>, "//\n__constant
const float16 mg_lbT =\n  (float16)(        1.,        0."..., headers=...,
ir=<optimized out>, target="pitcairn-amdgcn--", opts="", 
    r_log="test.c:3:21: warning: double precision constant requires
cl_khr_fp64, casting to single precision\ntest.c:3:32: warning: double
precision constant requires cl_khr_fp64, casting to single precision\ntest"...)
---Type <return> to continue, or q <return> to quit---
    at
../../../../../../src/gallium/state_trackers/clover/llvm/invocation.cpp:886
#21 0x00007ffff672e9b0 in clover::program::build (this=this at entry=0xabab90,
devs=..., opts=opts at entry=0x736ab0 "", 
    headers=std::vector of length 0, capacity 0)
    at ../../../../../../src/gallium/state_trackers/clover/core/program.cpp:63
#22 0x00007ffff6710278 in clBuildProgram (d_prog=0xabab98, num_devs=1,
d_devs=0x7fffffffdcc0, 
    p_opts=<optimized out>, pfn_notify=0x0, user_data=0x0)
    at ../../../../../../src/gallium/state_trackers/clover/api/program.cpp:184
#23 0x000000000040460f in CL_programCreate (context=0x702be8, device=0x644fb8,
codes=..., options=...)
    at clcc.c:1466
#24 0x0000000000406651 in Action_compile (settings=...) at clcc.c:1716
#25 0x0000000000406344 in main (argc=2, argv=0x7fffffffdfd8) at clcc.c:1658

I also tried the Debian mesa 11.2.0~rc3 packages without success (there is no
dbg package for them though so I can't provide a backtrace).

Thanks!  -Tyson

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160311/574c2ec8/attachment-0001.html>


More information about the mesa-dev mailing list