[llvm-bugs] [Bug 34916] New: [openmp] Casting.h, function doit: Assertion `Val && "isa<> used on a null pointer"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 11 07:19:39 PDT 2017


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

            Bug ID: 34916
           Summary: [openmp] Casting.h, function doit: Assertion `Val &&
                    "isa<> used on a null pointer"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sergey.nesterov at intel.com
                CC: llvm-bugs at lists.llvm.org

compiler crashes when trying to compile the following code: 

==================main.c:==========================
#include <omp.h>
void bar()
{
  int i,k,m;
  #pragma omp taskloop reduction(+: k) 
  for(i=0;i<10;i++) {
      #pragma omp task 
    {
      i++;
    }
  }  
} 
===================================================

$ clang -v
clang version 6.0.0 (trunk 315437)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...

$ clang -c  -O0 -fopenmp main.c
clang-6.0: .../llvm/include/llvm/Support/Casting.h:106: static bool
llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
clang::FieldDecl; From = clang::Decl]: Assertion `Val && "isa<> used on a null
pointer"' failed.
#0 0x0000000003fdd5ef llvm::sys::PrintStackTrace(llvm::raw_ostream&)
.../llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000003fdd680 PrintStackTraceSignalHandler(void*)
.../llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000003fdbb6c llvm::sys::RunSignalHandlers()
.../llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000003fdcf87 SignalHandler(int)
.../llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f35abc88100 __restore_rt (/lib64/libpthread.so.0+0xf100)
#5 0x00007f35aa8805f7 __GI_raise (/lib64/libc.so.6+0x355f7)
#6 0x00007f35aa881ce8 __GI_abort (/lib64/libc.so.6+0x36ce8)
#7 0x00007f35aa879566 __assert_fail_base (/lib64/libc.so.6+0x2e566)
#8 0x00007f35aa879612 (/lib64/libc.so.6+0x2e612)
#9 0x00000000042b94f1 llvm::isa_impl_cl<clang::FieldDecl, clang::Decl
const*>::doit(clang::Decl const*) .../llvm/include/llvm/Support/Casting.h:107:0
#10 0x00000000042b6392 llvm::isa_impl_wrap<clang::FieldDecl, clang::Decl
const*, clang::Decl const*>::doit(clang::Decl const* const&)
.../llvm/include/llvm/Support/Casting.h:134:0
#11 0x00000000042b3fdb llvm::isa_impl_wrap<clang::FieldDecl, clang::Decl*
const, clang::Decl const*>::doit(clang::Decl* const&)
.../llvm/include/llvm/Support/Casting.h:126:0
#12 0x00000000042aebd9 bool llvm::isa<clang::FieldDecl,
clang::Decl*>(clang::Decl* const&)
.../llvm/include/llvm/Support/Casting.h:145:0
#13 0x00000000042a8ba8 llvm::cast_retty<clang::FieldDecl,
clang::Decl*>::ret_type llvm::cast<clang::FieldDecl, clang::Decl>(clang::Decl*)
.../llvm/include/llvm/Support/Casting.h:255:0
#14 0x00000000042a2d71
clang::DeclContext::specific_decl_iterator<clang::FieldDecl>::operator*() const
.../llvm/tools/clang/include/clang/AST/DeclBase.h:1604:0
#15 0x000000000467b9d9 emitProxyTaskFunction(clang::CodeGen::CodeGenModule&,
clang::SourceLocation, clang::OpenMPDirectiveKind, clang::QualType,
clang::QualType, clang::QualType, clang::QualType, clang::QualType,
llvm::Value*, llvm::Value*)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:3863:0
#16 0x000000000467fb32
clang::CodeGen::CGOpenMPRuntime::emitTaskInit(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, clang::OMPExecutableDirective const&, llvm::Value*,
clang::QualType, clang::CodeGen::Address, clang::CodeGen::OMPTaskDataTy const&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:4307:0
#17 0x00000000046824d8
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&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:4616:0
#18 0x000000000431f994 operator()
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:4269:0
#19 0x000000000431f994 operator()
(.../build_315437_DONE/bin/clang-6.0+0x431f994)
#20 0x000000000431f994
clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(clang::OMPLoopDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy
const&)#2}::operator()(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&)
const::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}::operator()(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy) const
(.../build_315437_DONE/bin/clang-6.0+0x431f994)
#21 0x00000000043228c7 void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(clang::OMPLoopDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy
const&)#2}::operator()(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&)
const::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}>(long, clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h:75:0
#22 0x0000000004667735
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:710:0
#23 0x000000000466b648 (anonymous
namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&,
clang::Stmt const*) .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1127:0
#24 0x0000000004688e68
clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(clang::CodeGen::CodeGenFunction&,
clang::OpenMPDirectiveKind, clang::CodeGen::RegionCodeGenTy const&, bool)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:5548:0
#25 0x000000000431fa68 operator()
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:4272:0
#26 0x000000000431fa68
clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(clang::OMPLoopDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy
const&)#2}::operator()(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&) const
(.../build_315437_DONE/bin/clang-6.0+0x431fa68)
#27 0x0000000004322950 void llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)>::callback_fn<clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(clang::OMPLoopDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&)#2}>(long,
clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&) .../llvm/include/llvm/ADT/STLExtras.h:98:0
#28 0x000000000432f634 llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)>::operator()(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&) const
.../llvm/include/llvm/ADT/STLExtras.h:112:0
#29 0x000000000431889a
clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective
const&, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)> const&, clang::CodeGen::OMPTaskDataTy&)
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2909:0
#30 0x000000000431fb02 operator()
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:4282:0
#31 0x000000000431fb02
clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(clang::OMPLoopDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#3}::operator()(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) const
(.../build_315437_DONE/bin/clang-6.0+0x431fb02)
#32 0x0000000004322984 void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(clang::OMPLoopDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#3}>(long, clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h:75:0
#33 0x000000000466770b
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:707:0
#34 0x000000000466b648 (anonymous
namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&,
clang::Stmt const*) .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1127:0
#35 0x0000000004688e68
clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(clang::CodeGen::CodeGenFunction&,
clang::OpenMPDirectiveKind, clang::CodeGen::RegionCodeGenTy const&, bool)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:5548:0
#36 0x0000000004675798
clang::CodeGen::CGOpenMPRuntime::emitTaskgroupRegion(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::RegionCodeGenTy const&, clang::SourceLocation)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:2634:0
#37 0x000000000431ff45
clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(clang::OMPLoopDirective
const&) .../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:4284:0
#38 0x000000000431ff85
clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopDirective(clang::OMPTaskLoopDirective
const&) .../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:4289:0
#39 0x00000000042ea488 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:275:0
#40 0x00000000042eaa90
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:379:0
#41 0x000000000435c2a3
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) .../llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1121:0
#42 0x000000000435ce12
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
.../llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1286:0
#43 0x000000000437a977
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) .../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:3253:0
#44 0x00000000043760c2
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) .../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:2029:0
#45 0x0000000004375243
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
.../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:1806:0
#46 0x000000000437e530
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
.../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:3995:0
#47 0x0000000004d8b85c (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
.../llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp:159:0
#48 0x0000000004d85089
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:170:0
#49 0x0000000005a00cae clang::ParseAST(clang::Sema&, bool, bool)
.../llvm/tools/clang/lib/Parse/ParseAST.cpp:151:0
#50 0x000000000489d1aa clang::ASTFrontendAction::ExecuteAction()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#51 0x0000000004d83966 clang::CodeGenAction::ExecuteAction()
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1028:0
#52 0x000000000489cbeb clang::FrontendAction::Execute()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#53 0x000000000483eece
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
.../llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#54 0x00000000049d4180
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
.../llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#55 0x000000000201e74b cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) .../llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#56 0x0000000002014454 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) .../llvm/tools/clang/tools/driver/driver.cpp:309:0
#57 0x00000000020150dd main .../llvm/tools/clang/tools/driver/driver.cpp:388:0
#58 0x00007f35aa86cb15 __libc_start_main (/lib64/libc.so.6+0x21b15)
#59 0x0000000002011cd9 _start (.../bin/clang-6.0+0x2011cd9)
Stack dump:
0.      Program arguments: .../bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
main.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 main.gcno -resource-dir .../lib/clang/6.0.0
-internal-isystem /usr/local/include -internal-isystem
.../lib/clang/6.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O0 -fdebug-compilation-dir
-ferror-limit 19 -fmessage-length 271 -fopenmp -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o main.o -x c main.c
1.      <eof> parser at end of file
2.      main.c:2:6: LLVM IR generation of declaration 'bar'
3.      main.c:2:6: Generating code for declaration 'bar'
clang-6.0: error: unable to execute command: Aborted
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 315437)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: .../bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/main-969182.c
clang-6.0: note: diagnostic msg: /tmp/main-969182.sh
clang-6.0: note: diagnostic msg:

********************

-- 
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/20171011/d8a2df7f/attachment-0001.html>


More information about the llvm-bugs mailing list