[llvm-bugs] [Bug 26194] New: LLVM crash in CXXNameMangler::mangleType

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 18 04:33:11 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26194

            Bug ID: 26194
           Summary: LLVM crash in CXXNameMangler::mangleType
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: reg8162 at runbox.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15656
  --> https://llvm.org/bugs/attachment.cgi?id=15656&action=edit
OpenCL source causing crash

LLVM/clang crashes while compiling an OpenCL file. Built from release_38 branch
svn 254505. Note that this is a regression - it compiles without crash on 3.7.

To reproduce:
clang-3.8 -Xclang -ffake-address-space-map -emit-llvm -x cl -Xclang
-cl-std=CL2.0 -D__OPENCL_C_VERSION__=200 -D__OPENCL_VERSION__=200
-Dcl_khr_byte_addressable_store -Dcl_khr_global_int32_base_atomics
-Dcl_khr_global_int32_extended_atomics -Dcl_khr_local_int32_base_atomics
-Dcl_khr_local_int32_extended_atomics -Dcl_khr_spir -Dcl_khr_int64
-Dcl_khr_fp64 -Dcl_khr_int64_base_atomics -Dcl_khr_int64_extended_atomics -o
attach.bc -c attach.cl

Preprocessed source is attached; original sources are at
https://github.com/pocl/pocl/blob/3254f46a388b3809c6eea1bd70943864198dd56c/ 
files lib/kernel/svm_atomics.cl and include/_kernel.h

Stack dump:
0.    Program arguments: /home/LLVM_380_rwdi_NA_rtti/bin/clang-3.8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free
-disable-llvm-verifier -main-file-name a.cl -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -coverage-file /tmp/a -resource-dir
/home/LLVM_380_rwdi_NA_rtti/bin/../lib/clang/3.8.0 -D __OPENCL_C_VERSION__=200
-D __OPENCL_VERSION__=200 -D cl_khr_byte_addressable_store -D
cl_khr_global_int32_base_atomics -D cl_khr_global_int32_extended_atomics -D
cl_khr_local_int32_base_atomics -D cl_khr_local_int32_extended_atomics -D
cl_khr_spir -D cl_khr_int64 -D cl_khr_fp64 -D cl_khr_int64_base_atomics -D
cl_khr_int64_extended_atomics -internal-isystem /usr/local/include
-internal-isystem /home/LLVM_380_rwdi_NA_rtti/bin/../lib/clang/3.8.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /home/build-pocl-debug -ferror-limit 19
-fmessage-length 159 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -ffake-address-space-map -cl-std=CL2.0  -o
/home/build-pocl-debug/lib/kernel/host/svm_atomics.cl.bc -x cl
/home/devel/a/0/pocl/lib/kernel/svm_atomics.cl
1.    /home/devel/a/0/pocl/lib/kernel/svm_atomics.cl:218:1: current parser
token 'bool'
2.    /home/devel/a/0/pocl/lib/kernel/svm_atomics.cl:210:40: LLVM IR generation
of declaration 'atomic_compare_exchange_strong'
3.    /home/devel/a/0/pocl/lib/kernel/svm_atomics.cl:210:40: Generating code
for declaration 'atomic_compare_exchange_strong'
4.    /home/devel/a/0/pocl/lib/kernel/svm_atomics.cl:210:40: Mangling
declaration 'atomic_compare_exchange_strong'



gdb backtrace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0  std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_M_data (this=<optimized out>, 
    __p=0xfffffffffff4d113 <error: Cannot access memory at address
0xfffffffffff4d113>) at /usr/include/c++/5.3.0/bits/basic_string.h:127
127          { _M_dataplus._M_p = __p; }
(gdb) bt
#0  std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_M_data (this=<optimized out>, 
    __p=0xfffffffffff4d113 <error: Cannot access memory at address
0xfffffffffff4d113>) at /usr/include/c++/5.3.0/bits/basic_string.h:127
#1  std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::basic_string(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >&&) (__str=<optimized out>,
this=0xffff0300) at /usr/include/c++/5.3.0/bits/basic_string.h:495
#2  std::operator+<char, std::char_traits<char>, std::allocator<char> >(char
const*, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >&&) (__rhs=<unknown type in
/home/LLVM_380_rwdi_NA_rtti/lib/.debug/libclangAST.so.debug, CU 0x1a9c8b4, DIE
0x1b6e435>, __lhs=0x7efd4984707e "AS")
    at /usr/include/c++/5.3.0/bits/basic_string.h:4876
#3  (anonymous namespace)::CXXNameMangler::mangleQualifiers (Quals=...,
Quals at entry=..., this=0x7ffecd7dec40, this=0x7ffecd7dec40)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/AST/ItaniumMangle.cpp:1788
#4  0x00007efd4979637f in (anonymous namespace)::CXXNameMangler::mangleType
(this=this at entry=0x7ffecd7dec40, T=...)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/AST/ItaniumMangle.cpp:1931
#5  0x00007efd49798641 in (anonymous namespace)::CXXNameMangler::mangleType
(this=this at entry=0x7ffecd7dec40, T=T at entry=0x1469e60)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/AST/ItaniumMangle.cpp:2302
#6  0x00007efd49796b8e in (anonymous namespace)::CXXNameMangler::mangleType
(this=this at entry=0x7ffecd7dec40, T=...)
    at
/home/unused_LLVM/LLVM_git/tools/clang/include/clang/AST/TypeNodes.def:64
#7  0x00007efd497986cf in (anonymous
namespace)::CXXNameMangler::mangleBareFunctionType (this=0x7ffecd7dec40,
T=0x1469fc0, MangleReturnType=<optimized out>)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/AST/ItaniumMangle.cpp:2198
#8  0x00007efd4979ef98 in (anonymous
namespace)::ItaniumMangleContextImpl::mangleCXXName (this=0xfc4bf0,
D=0x158e208, Out=...)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/AST/ItaniumMangle.cpp:4023
#9  0x00007efd4d803f84 in clang::CodeGen::CodeGenModule::getMangledName
(this=this at entry=0xfc41a0, GD=..., GD at entry=...)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/CodeGenModule.cpp:619
#10 0x00007efd4d808c47 in clang::CodeGen::CodeGenModule::GetAddrOfFunction
(this=this at entry=0xfc41a0, GD=GD at entry=..., Ty=0xfc6060, 
    ForVTable=ForVTable at entry=false, DontDefer=DontDefer at entry=true,
IsForDefinition=IsForDefinition at entry=true)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/CodeGenModule.cpp:1836
#11 0x00007efd4d808d03 in
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition
(this=this at entry=0xfc41a0, GD=GD at entry=..., GV=GV at entry=0x0)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/CodeGenModule.cpp:2665
#12 0x00007efd4d817bdb in clang::CodeGen::CodeGenModule::EmitGlobalDefinition
(this=this at entry=0xfc41a0, GD=GD at entry=..., GV=GV at entry=0x0)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/CodeGenModule.cpp:1646
#13 0x00007efd4d818710 in clang::CodeGen::CodeGenModule::EmitGlobal
(this=this at entry=0xfc41a0, GD=GD at entry=...)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/CodeGenModule.cpp:1464
#14 0x00007efd4d819090 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl
(this=0xfc41a0, D=0x158e208)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/CodeGenModule.cpp:3457
#15 0x00007efd4d860bef in (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl (this=0xfc3a60, DG=...)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/ModuleBuilder.cpp:125
#16 0x00007efd4d7e7564 in clang::BackendConsumer::HandleTopLevelDecl
(this=0xfc3910, D=...)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/CodeGenAction.cpp:114
#17 0x00007efd48e3ff77 in clang::ParseAST (S=..., PrintStats=<optimized out>,
SkipFunctionBodies=<optimized out>)
    at /home/unused_LLVM/LLVM_git/tools/clang/lib/Parse/ParseAST.cpp:159
#18 0x00007efd4d0666ea in clang::ASTFrontendAction::ExecuteAction
(this=this at entry=0xf92990)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/Frontend/FrontendAction.cpp:539
#19 0x00007efd4d7e82f2 in clang::CodeGenAction::ExecuteAction (this=0xf92990)
at /home/unused_LLVM/LLVM_git/tools/clang/lib/CodeGen/CodeGenAction.cpp:797
#20 0x00007efd4d067346 in clang::FrontendAction::Execute
(this=this at entry=0xf92990)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/Frontend/FrontendAction.cpp:439
#21 0x00007efd4d037946 in clang::CompilerInstance::ExecuteAction
(this=this at entry=0xf8f380, Act=...)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/Frontend/CompilerInstance.cpp:841
#22 0x00007efd4cdbf9e5 in clang::ExecuteCompilerInvocation
(Clang=Clang at entry=0xf8f380)
    at
/home/unused_LLVM/LLVM_git/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:222
#23 0x000000000040f0f8 in cc1_main (Argv=..., Argv0=<optimized out>,
MainAddr=MainAddr at entry=0x40d520 <GetExecutablePath[abi:cxx11](char const*,
bool)>)
    at /home/unused_LLVM/LLVM_git/tools/clang/tools/driver/cc1_main.cpp:116
#24 0x000000000040a56e in ExecuteCC1Tool (Tool=..., argv=...) at
/home/unused_LLVM/LLVM_git/tools/clang/tools/driver/driver.cpp:301

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160118/b8faed69/attachment-0001.html>


More information about the llvm-bugs mailing list