Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[OpenMP 5.0] Crash caused by target region inside of task construct with affinity clause #51084

Open Quuxplusone opened 2 years ago

Quuxplusone commented 2 years ago
Bugzilla Link PR52117
Status NEW
Importance P enhancement
Reported by Thomas Huber (thuber@udel.edu)
Reported on 2021-10-08 10:08:48 -0700
Last modified on 2021-10-08 10:08:48 -0700
Version unspecified
Hardware Other Linux
CC llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments reproducer.c (881 bytes, text/x-csrc)
Blocks
Blocked by
See also
Created attachment 25339
C program that reproduces the crash

Overview: Test crashes and produces segmentation fault with Clang 14 when
compiling a test that utilizes a target region inside of a task construct that
specifies the affinity clause.

Steps to Reproduce:
Use 'clang -lm -O3 -fopenmp -fopenmp-targets=nvptx64 reproducer.c' to compile
the attached program.

Actual Results:
Program crashes.

Expected Results:
Test 'passes' with errors variable equal to 0.

Build Date & Hardware:
(Newest available llvm on summit)
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
70391b3468b8a4a07b49df88d7fa88c9644cda77)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /sw/summit/ums/stf010/llvm/14.0.0-20211005/bin

Additional Information:
- Reproducer(reproducer.c) is attached
- Crash backtrace is pasted below

Crash Backtrace:
Stack dump:
0.  Program arguments: /autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-
20211005/bin/clang-14 -cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm-bc -
emit-llvm-uselists -disable-free -disable-llvm-verifier -discard-value-names -
main-file-name reproducer.c -mrelocation-model static -mframe-pointer=none -
fmath-errno -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-
cpu ppc64le -mfloat-abi hard -target-abi elfv2 -debugger-tuning=gdb -fcoverage-
compilation-dir=/ccs/home/tmh97/sollve_vv -resource-dir /autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/lib/clang/14.0.0 -
I/sw/summit/cuda/11.0.3/include -I/sw/summit/spack-envs/base/opt/linux-rhel8-
ppc64le/gcc-8.3.1/spectrum-mpi-10.4.0.3-20210112-
lh62ywknl2livekopzhdwkylukd4pf2z/include -c-isystem
/sw/summit/ums/stf010/llvm/14.0.0-20211005/include -cxx-isystem
/sw/summit/ums/stf010/llvm/14.0.0-20211005/include -internal-isystem
/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-
20211005/lib/clang/14.0.0/include/ppc_wrappers -internal-isystem /autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/lib/clang/14.0.0/include -
internal-isystem /usr/local/include -internal-isystem /sw/summit/gcc/9.1.0-
alpha+20190716/lib/gcc/powerpc64le-unknown-linux-
gnu/9.1.0/../../../../powerpc64le-unknown-linux-gnu/include -internal-externc-
isystem /include -internal-externc-isystem /usr/include -internal-isystem
/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-
20211005/lib/clang/14.0.0/include/ppc_wrappers -internal-isystem /autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/lib/clang/14.0.0/include -
internal-isystem /usr/local/include -internal-isystem /sw/summit/gcc/9.1.0-
alpha+20190716/lib/gcc/powerpc64le-unknown-linux-
gnu/9.1.0/../../../../powerpc64le-unknown-linux-gnu/include -internal-externc-
isystem /include -internal-externc-isystem /usr/include -O3 -fdebug-compilation-
dir=/ccs/home/tmh97/sollve_vv -ferror-limit 19 -fopenmp -fno-signed-char -fgnuc-
version=4.2.1 -fcolor-diagnostics -vectorize-loops -vectorize-slp -disable-llvm-
passes -fopenmp-targets=nvptx64 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o
/tmp/reproducer-8581a5.bc -x c reproducer.c
1.  <eof> parser at end of file
2.  Per-file LLVM IR generation
3.  reproducer.c:8:5: Generating code for declaration 'test_task_affinity'
4.  reproducer.c:17:5: LLVM IR generation of compound statement ('{}')
 #0 0x0000000011843f64 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11843f64)
 #1 0x0000000011844364 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #2 0x0000000011841348 llvm::sys::RunSignalHandlers() (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11841348)
 #3 0x00000000118447ac SignalHandler(int) Signals.cpp:0:0
 #4 0x00002000000504d8 (linux-vdso64.so.1+0x4d8)
 #5 0x0000000011de131c clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(clang::DeclRefExpr const*) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11de131c)
 #6 0x0000000011dd5994 clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11dd5994)
 #7 0x0000000011ddd8c8 clang::CodeGen::CodeGenFunction::EmitCheckedLValue(clang::Expr const*, clang::CodeGen::CodeGenFunction::TypeCheckKind) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11ddd8c8)
 #8 0x0000000011e1b0b4 (anonymous namespace)::ScalarExprEmitter::VisitDeclRefExpr(clang::DeclRefExpr*) CGExprScalar.cpp:0:0
 #9 0x0000000011e0eda0 (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#10 0x0000000011e0ed10
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11e0ed10)
#11 0x0000000011dba334
clang::CodeGen::CodeGenFunction::EmitScalarInit(clang::Expr const*,
clang::ValueDecl const*, clang::CodeGen::LValue, bool) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11dba334)
#12 0x0000000011dbf174
clang::CodeGen::CodeGenFunction::EmitExprAsInit(clang::Expr const*,
clang::ValueDecl const*, clang::CodeGen::LValue, bool) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11dbf174)
#13 0x0000000011dbc804
clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission
const&) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-
14+0x11dbc804)
#14 0x0000000011db83ec
clang::CodeGen::CodeGenFunction::EmitVarDecl(clang::VarDecl const&)
(/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11db83ec)
#15 0x0000000011b856ec (anonymous
namespace)::OMPLexicalScope::OMPLexicalScope(clang::CodeGen::CodeGenFunction&,
clang::OMPExecutableDirective const&, llvm::Optional<llvm::omp::Directive>,
bool) CGStmtOpenMP.cpp:0:0
#16 0x0000000011b87f40
emitCommonOMPTargetDirective(clang::CodeGen::CodeGenFunction&,
clang::OMPExecutableDirective const&, clang::CodeGen::RegionCodeGenTy const&)
CGStmtOpenMP.cpp:0:0
#17 0x0000000011b96cec
clang::CodeGen::CodeGenFunction::EmitOMPTargetDirective(clang::OMPTargetDirective
const&) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-
14+0x11b96cec)
#18 0x0000000011b645ac clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11b645ac)
#19 0x0000000011b649b4
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*,
llvm::ArrayRef<clang::Attr const*>) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11b649b4)
#20 0x0000000011b63f84 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11b63f84)
#21 0x0000000011bb08cc void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&)::$_80>(long, clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) CGStmtOpenMP.cpp:0:0
#22 0x0000000011e9d754
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-
14+0x11e9d754)
#23 0x0000000011baf124 void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective
const&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&,
llvm::function_ref<void (clang::CodeGen::CodeGenFunction&, llvm::Function*,
clang::CodeGen::OMPTaskDataTy const&)> const&,
clang::CodeGen::OMPTaskDataTy&)::$_74>(long, clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) CGStmtOpenMP.cpp:0:0
#24 0x0000000011edb2dc (anonymous
namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&,
clang::Stmt const*) CGOpenMPRuntime.cpp:0:0
#25 0x0000000011b73480
clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(clang::CapturedStmt
const&) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-
14+0x11b73480)
#26 0x0000000011ea3580
clang::CodeGen::CGOpenMPRuntime::emitTaskOutlinedFunction(clang::OMPExecutableDirective
const&, clang::VarDecl const*, clang::VarDecl const*, clang::VarDecl const*,
llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, bool, unsigned
int&) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-
14+0x11ea3580)
#27 0x0000000011b8fe14
clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective
const&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&,
llvm::function_ref<void (clang::CodeGen::CodeGenFunction&, llvm::Function*,
clang::CodeGen::OMPTaskDataTy const&)> const&, clang::CodeGen::OMPTaskDataTy&)
(/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11b8fe14)
#28 0x0000000011b916fc
clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-
14+0x11b916fc)
#29 0x0000000011b64638 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11b64638)
#30 0x0000000011b6ecc4
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11b6ecc4)
#31 0x0000000011bc8c3c
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11bc8c3c)
#32 0x0000000011be9c44
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-
20211005/bin/clang-14+0x11be9c44)
#33 0x0000000011be25d8
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-
20211005/bin/clang-14+0x11be25d8)
#34 0x0000000011bd4914 clang::CodeGen::CodeGenModule::EmitDeferred()
(/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11bd4914)
#35 0x0000000011bd2f70 clang::CodeGen::CodeGenModule::Release() (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x11bd2f70)
#36 0x0000000012765894 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
ModuleBuilder.cpp:0:0
#37 0x0000000012761930
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x12761930)
#38 0x0000000013331c90 clang::ParseAST(clang::Sema&, bool, bool) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x13331c90)
#39 0x0000000012119978 clang::ASTFrontendAction::ExecuteAction() (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x12119978)
#40 0x000000001275fcf8 clang::CodeGenAction::ExecuteAction() (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x1275fcf8)
#41 0x0000000012119224 clang::FrontendAction::Execute() (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x12119224)
#42 0x000000001209f2c8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x1209f2c8)
#43 0x00000000121e79f8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/autofs/nccs-
svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-14+0x121e79f8)
#44 0x000000001061f344 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-20211005/bin/clang-
14+0x1061f344)
#45 0x000000001061d330 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#46 0x000000001061d1f0 main (/autofs/nccs-svm1_sw/summit/ums/stf010/llvm/14.0.0-
20211005/bin/clang-14+0x1061d1f0)
#47 0x00002000004f4078 .annobin_libc_start.c libc-start.c:0:0
#48 0x00002000004f4264 __libc_start_main (/usr/lib64/power9/libc.so.6+0x24264)
clang-14: error: unable to execute command: Segmentation fault (core dumped)
clang-14: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
70391b3468b8a4a07b49df88d7fa88c9644cda77)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /sw/summit/ums/stf010/llvm/14.0.0-20211005/bin
clang-14: note: diagnostic msg: Error generating preprocessed source(s).
Quuxplusone commented 2 years ago

Attached reproducer.c (881 bytes, text/x-csrc): C program that reproduces the crash