Segfault when using LLVM7 -
@thiago
Submitted by Thiago Macieira Assigned to mes..@..op.org
Link to original bug (#108308)
Description
Created attachment 141967 Patch to make compile with LLVM 7
Build of d3682766 using the attached patch to make it compile with LLVM 7. When loading X, it crashes with the backtrace:
(gdb) bt
#6 <signal handler called>
#7 0x00007f1e48432c20 in llvm::djbHash (Buffer=..., H=0) at /usr/src/debug/llvm-7.0.0.src/include/llvm/Support/DJB.h:23
#8 llvm::StringMapImpl::LookupBucketFor (this=<optimized out>, Name=...) at /usr/src/debug/llvm-7.0.0.src/lib/Support/StringMap.cpp:84
#9 0x00007f1e486547f9 in llvm::StringMap<llvm::MDString, llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul> >::try_emplace<>(llvm::StringRef) (this=0xcd3be8, Key=...) at /usr/src/debug/llvm-7.0.0.src/include/llvm/ADT/StringMap.h:396
#10 0x00007f1e4864a271 in llvm::MDString::get (Context=..., Str=...) at /usr/src/debug/llvm-7.0.0.src/lib/IR/Metadata.cpp:456
#11 0x00007f1e485c9bc6 in llvm::DINode::getCanonicalMDString (Context=..., S=...)
at /usr/src/debug/llvm-7.0.0.src/include/llvm/IR/DebugInfoMetadata.h:181
#12 llvm::DIFile::getImpl (Context=..., Filename=..., Directory=..., CS=..., Source=..., Storage=<optimized out>, ShouldCreate=true)
at /usr/src/debug/llvm-7.0.0.src/include/llvm/IR/DebugInfoMetadata.h:556
#13 0x00007f1e485c5e32 in llvm::DIFile::get (Context=..., Filename=..., Directory=..., CS=..., Source=...)
at /usr/src/debug/llvm-7.0.0.src/include/llvm/IR/DebugInfoMetadata.h:571
#14 llvm::DIBuilder::createFile (this=<optimized out>, this@entry=0x7ffd876022a0, Filename=..., Directory=..., CS=..., Source=...)
at /usr/src/debug/llvm-7.0.0.src/lib/IR/DIBuilder.cpp:215
#15 0x00007f1e4b41be11 in SwrJit::Gen_SWR_VERTEX_BUFFER_STATE (pJitMgr=0xcd6e10) at /usr/include/llvm/ADT/StringRef.h:85
#16 SwrJit::Gen_SWR_FETCH_CONTEXT (pJitMgr=0xcd6e10) at rasterizer/jitter/gen_state_llvm.h:903
#17 0x00007f1e4b41ecd3 in JitManager::JitManager (this=0xcd6e10, simdWidth=<optimized out>, arch=<optimized out>, core=<optimized out>)
at rasterizer/jitter/JitManager.cpp:169
#18 0x00007f1e4b41fb0e in JitCreateContext (targetSimdWidth=targetSimdWidth@entry=8, arch=arch@entry=0x7f1e4bb3dec9 "",
core=core@entry=0x7f1e4ba2d0f7 "swr") at rasterizer/jitter/JitManager.cpp:507
#19 0x00007f1e4b3ce063 in swr_create_screen_internal (winsys=winsys@entry=0xcd19b0) at swr_screen.cpp:1184
#20 0x00007f1e4b431692 in swr_create_screen (winsys=winsys@entry=0xcd19b0) at swr_loader.cpp:74
#21 0x00007f1e4a9639f8 in sw_screen_create_named (driver=0x7f1e4ba2d0f7 "swr", winsys=0xcd19b0)
at ../../../../src/gallium/auxiliary/target-helpers/sw_helper.h:39
#22 sw_screen_create (winsys=0xcd19b0) at ../../../../src/gallium/auxiliary/target-helpers/sw_helper.h:81
#23 0x00007f1e4b0bc316 in pipe_loader_sw_create_screen (dev=0xcd1940, config=<optimized out>) at pipe_loader_sw.c:310
#24 0x00007f1e4b0bc12c in pipe_loader_create_screen (dev=0xcd1940) at pipe_loader.c:137
#25 0x00007f1e4ae8b58c in dri_kms_init_screen (sPriv=0xccfc90) at dri2.c:2208
#26 0x00007f1e4ae86923 in driCreateNewScreen2 (scrn=0, fd=13, extensions=<optimized out>, driver_extensions=<optimized out>,
driver_configs=0xc7af58, data=0xc7ad90) at dri_util.c:153
#27 0x00007f1e4c0de30e in dri_screen_create_dri2 (dri=dri@entry=0xc7ad90, driver_name=<optimized out>) at backends/dri/gbm_dri.c:461
#28 0x00007f1e4c0de3ca in dri_screen_create_sw (dri=0xc7ad90) at backends/dri/gbm_dri.c:549
#29 0x00007f1e4c0de6d8 in dri_device_create (fd=13) at backends/dri/gbm_dri.c:1447
#30 0x00007f1e4c0dbbce in gbm_create_device (fd=13) at main/gbm.c:137
#7 0x00007f1e48432c20 in llvm::djbHash (Buffer=..., H=0) at /usr/src/debug/llvm-7.0.0.src/include/llvm/Support/DJB.h:23
23 for (unsigned char C : Buffer.bytes())
Crashed on: 0x00007f1e48432c20 <+192>: movzbl (%rcx),%edi %rcx is 0x3000000002
Buffer is: $5 = {Data = 0x3000000002 <error: Cannot access memory at address 0x3000000002>, Length = 140726874677440}
Confirming on frame 14:
#14 llvm::DIBuilder::createFile (this=<optimized out>, this@entry=0x7ffd876022a0, Filename=..., Directory=..., CS=..., Source=...)
at /usr/src/debug/llvm-7.0.0.src/lib/IR/DIBuilder.cpp:215
215 return DIFile::get(VMContext, Filename, Directory, CS, Source);
(gdb) x/2ga &Source
0x7ffd87602020: 0x3000000002 0x7ffd876020c0
Unfortunately, frame 15 (the first SWR one) is not debuggable due to the inlining of StringRef inside the function and I can't find "Gen_SWR_VERTEX_BUFFER_STATE" in the Mesa sources.
Patch 141967, "Patch to make compile with LLVM 7":
swr.patch
Version: git