[llvm-bugs] [Bug 40513] New: Segmentation fault in clang::CodeGen::CGOpenMPRuntime::emitTaskInit

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 29 02:58:50 PST 2019


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

            Bug ID: 40513
           Summary: Segmentation fault in
                    clang::CodeGen::CGOpenMPRuntime::emitTaskInit
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P
         Component: OpenMP
          Assignee: unassignedclangbugs at nondot.org
          Reporter: asolokha at gmx.com
                CC: llvm-bugs at lists.llvm.org

clang crashes when compiling the following snippet w/ -fopenmp starting from
3.9.0 up to the current trunk:

void
bl (int j4)
{
  int lh;
  int *u4 = &lh;

#pragma omp parallel
#pragma omp taskloop lastprivate (lh)
  for (lh = 0; lh < j4; ++lh)
    {
    }
}

% /usr/lib/llvm/7/bin/clang -fopenmp -c innqpe1h.c
Stack dump:                          
0.      Program arguments: /usr/lib64/llvm/7/bin/clang-7 -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name innqpe1h.c -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 -debugger-tuning=gdb -coverage-notes-file /tmp/innqpe1h.gcno
-resource-dir /usr/lib64/llvm/7/bin/../../../../lib/clang/7.0.1
-internal-isystem /usr/local/include -internal-isystem
/usr/lib64/llvm/7/bin/../../../../lib/clang/7.0.1/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 134 -fopenmp
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o innqpe1h.o
-x c innqpe1h.c -faddrsig 
1.      <eof> parser at end of file
2.      innqpe1h.c:2:1: LLVM IR generation of declaration 'bl'
3.      innqpe1h.c:2:1: Generating code for declaration 'bl'
#0 0x00007fee28a6dafa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib64/llvm/7/bin/../lib64/libLLVMSupport.so.7+0x5eafa)
#1 0x00007fee28a6f254 llvm::sys::RunSignalHandlers()
(/usr/lib64/llvm/7/bin/../lib64/libLLVMSupport.so.7+0x60254)
#2 0x00007fee28a6f3d5
(/usr/lib64/llvm/7/bin/../lib64/libLLVMSupport.so.7+0x603d5)
#3 0x00007fee27b151a0 (/lib64/libc.so.6+0x381a0)
#4 0x00007fee283136b7
clang::CodeGen::CGOpenMPRuntime::emitTaskInit(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, clang::OMPExecutableDirective const&, llvm::Value*,
clang::QualType, clang::CodeGen::Address, clang::CodeGen::OMPTaskDataTy const&)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1f96b7)
#5 0x00007fee282f848b
clang::CodeGen::CGOpenMPRuntime::emitTaskLoopCall(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, clang::OMPLoopDirective const&, llvm::Value*,
clang::QualType, clang::CodeGen::Address, clang::Expr const*,
clang::CodeGen::OMPTaskDataTy const&)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1de48b)
#6 0x00007fee282ae217
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x194217)
#7 0x00007fee2831fa77
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const (/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x205a77)
#8 0x00007fee2830813f
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1ee13f)
#9 0x00007fee282ef8b3
clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(clang::CodeGen::CodeGenFunction&,
clang::OpenMPDirectiveKind, clang::CodeGen::RegionCodeGenTy const&, bool)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1d58b3)
#10 0x00007fee2829cfd0
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x182fd0)
#11 0x00007fee282bb731
clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective
const&, clang::OpenMPDirectiveKind, clang::CodeGen::RegionCodeGenTy const&,
llvm::function_ref<void (clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&)> const&, clang::CodeGen::OMPTaskDataTy&)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1a1731)
#12 0x00007fee282a53c2
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x18b3c2)
#13 0x00007fee2831fa36
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const (/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x205a36)
#14 0x00007fee2830813f
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1ee13f)
#15 0x00007fee282ef8b3
clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(clang::CodeGen::CodeGenFunction&,
clang::OpenMPDirectiveKind, clang::CodeGen::RegionCodeGenTy const&, bool)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1d58b3)
#16 0x00007fee28318619
clang::CodeGen::CGOpenMPRuntime::emitTaskgroupRegion(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::RegionCodeGenTy const&, clang::SourceLocation)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1fe619)
#17 0x00007fee282bcfa6
clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(clang::OMPLoopDirective
const&) (/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1a2fa6)
#18 0x00007fee282d6377 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1bc377)
#19 0x00007fee282c3c35
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1a9c35)
#20 0x00007fee2831fa77
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const (/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x205a77)
#21 0x00007fee2830813f
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1ee13f)
#22 0x00007fee282d1af9
clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(clang::CapturedStmt
const&) (/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1b7af9)
#23 0x00007fee2830a4dc
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1f04dc)
#24 0x00007fee2830a630
clang::CodeGen::CGOpenMPRuntime::emitParallelOutlinedFunction(clang::OMPExecutableDirective
const&, clang::VarDecl const*, clang::OpenMPDirectiveKind,
clang::CodeGen::RegionCodeGenTy const&)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1f0630)
#25 0x00007fee282bf67d
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1a567d)
#26 0x00007fee282bff41
clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(clang::OMPParallelDirective
const&) (/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1a5f41)
#27 0x00007fee282d62f7 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1bc2f7)
#28 0x00007fee282d91e3
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1bf1e3)
#29 0x00007fee282916eb
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x1776eb)
#30 0x00007fee28299621
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x17f621)
#31 0x00007fee281d7528
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0xbd528)
#32 0x00007fee28287c80
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x16dc80)
#33 0x00007fee28288420
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x16e420)
#34 0x00007fee281d7fbb
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0xbdfbb)
#35 0x00007fee2820bddf
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0xf1ddf)
#36 0x00007fee2829e18d
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x18418d)
#37 0x00007fee26d67604 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib64/llvm/7/bin/../lib64/../lib64/libclangParse.so.7+0xd0604)
#38 0x00007fee2829b905 clang::CodeGenAction::ExecuteAction()
(/usr/lib64/llvm/7/bin/../lib64/libclangCodeGen.so.7+0x181905)
#39 0x00007fee27ed0096 clang::FrontendAction::Execute()
(/usr/lib64/llvm/7/bin/../lib64/libclangFrontend.so.7+0x89096)
#40 0x00007fee27f0f236
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib64/llvm/7/bin/../lib64/libclangFrontend.so.7+0xc8236)
#41 0x00007fee27e43b07
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib64/llvm/7/bin/../lib64/libclangFrontendTool.so.7+0x4b07)
#42 0x0000559fa609b378 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib64/llvm/7/bin/clang-7+0x14378)
#43 0x0000559fa60961b9 main (/usr/lib64/llvm/7/bin/clang-7+0xf1b9)
#44 0x00007fee27b001bb __libc_start_main (/lib64/libc.so.6+0x231bb)
#45 0x0000559fa609690a _start (/usr/lib64/llvm/7/bin/clang-7+0xf90a)
clang-7: error: unable to execute command: Segmentation fault (core dumped)
clang-7: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/7/bin

-- 
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/20190129/c3e3df7a/attachment.html>


More information about the llvm-bugs mailing list