-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenMP crash #24037
Comments
Possibly resolved by Chandler's changes. Works fine with r238544 |
Ok reopen was testing a wrong build. |
Compile time crash seems to be resolved but now the resulting executable crashes, how to reproduce:
λ ldd a.out
λ ./a.out 100 Looking under gdb the backtrace looks like an infinite recursion: [...] |
|
Thanks.
I did "ulimit -s unlimited" but the executable still crashes λ ./a.out 100 |
Fixed in revision 239524. |
Thanks I'll try to confirm that, meanwhile can you try the run the app with 100 as input? If that works try 5000 ? gcc works fine with those inputs with 8k stacks. |
It is fixed, try now.
|
Ok, will try |
Well I am on very recent (1 day old) llvm/clang/libiomp trunk on Linux x86-64. |
My results on MacOS $ ./a.out Waiting for 5000 |
Please try on Linux x86-64 just to be sure. |
On Linux x86_64 |
If I compile with -O2 I can't reproduce the crash either, but at -O0 I can reproduce it. |
tsan points out some data races inside libiomp: Atomic read of size 1 at 0x7d680001cd40 by main thread: Previous write of size 1 at 0x7d680001cd40 by thread T5: Location is heap block of size 1504 at 0x7d680001c800 allocated by main thread: Thread T5 (tid=4196, running) created by main thread at: SUMMARY: ThreadSanitizer: data race /usr/src/debug/llvm/stage2/../projects/openmp/runtime/src/z_Linux_util.c:1842:14 in void __kmp_resume_template<kmp_flag_64>(int, kmp_flag_64*)Rendering (100 spp) 0.13%================== Previous write of size 1 at 0x7d680001a940 by thread T8: Location is heap block of size 1504 at 0x7d680001a400 allocated by main thread: Thread T5 (tid=4196, running) created by main thread at: Thread T8 (tid=4199, running) created by main thread at: SUMMARY: ThreadSanitizer: data race /usr/src/debug/llvm/stage2/../projects/openmp/runtime/src/z_Linux_util.c:1842:14 in void __kmp_resume_template<kmp_flag_64>(int, kmp_flag_64*) |
I think it's better to report this problem to openmp-dev mailing list directly. |
Since original bug is fixed, I am closing this bug as fixed. Thank you! For the other crash I'll send an email to openmp-dev. |
Extended Description
Reduced from http://www.kevinbeason.com/smallpt/smallpt.txt
λ clang -v
clang version 3.7.0 (trunk 238128)
Target: x86_64-suse-linux
Thread model: posix
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
λ cat t.cpp
struct t {
double x;
};
int main(){
int h;
t r;
#pragma omp parallel for schedule(dynamic, 1) private(r)
for (int y=0; y<h; y++){
}
}
λ clang++ -fopenmp -O2 t.cpp
clang-3.7: ../tools/clang/lib/CodeGen/CGCleanup.cpp:629: void clang::CodeGen::CodeGenFunction::PopCleanupBlock(bool): Assertio
n `!Scope.isNormalCleanup() || !HasPrebranchedFallthrough || (Scope.getNormalBlock() && FallthroughSource->getTerminator()->ge
tSuccessor(0) == Scope.getNormalBlock())' failed.
#0 0x7f4f62bae778 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/opt/clang/lib64/libLLVMSupport.so.3.7+0xc7778)
#1 0x7f4f62bafc0b (/opt/clang/lib64/libLLVMSupport.so.3.7+0xc8c0b)
#2 0x7f4f610c9440 __restore_rt (/lib64/libc.so.6+0x33440)
#3 0x7f4f610c93c7 __GI_raise /usr/src/debug/glibc-2.21/signal/../sysdeps/unix/sysv/linux/raise.c:55:0
#4 0x7f4f610ca79a __GI_abort /usr/src/debug/glibc-2.21/stdlib/abort.c:80:0
#5 0x7f4f610c22e6 __assert_fail_base /usr/src/debug/glibc-2.21/assert/assert.c:92:0
#6 0x7f4f610c2392 (/lib64/libc.so.6+0x2c392)
#7 0x7f4f5b9eb676 clang::CodeGen::CodeGenFunction::PopCleanupBlock(bool) (/opt/clang/lib64/libclangCodeGen.so.3.7+0xd4676)
#8 0x7f4f5b9eb9d2 clang::CodeGen::CodeGenFunction::PopCleanupBlocks(clang::CodeGen::EHScopeStack::stable_iterator, unsigned lo
ng) (/opt/clang/lib64/libclangCodeGen.so.3.7+0xd49d2)
#9 0x7f4f5baaee2d (/opt/clang/lib64/libclangCodeGen.so.3.7+0x197e2d)
#10 0x7f4f5baabfc2 (/opt/clang/lib64/libclangCodeGen.so.3.7+0x194fc2)
#11 0x7f4f5baca8ed (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1b38ed)
#12 0x7f4f5bac9cc2 clang::CodeGen::CodeGenFunction::EmitOMPWorksharingLoop(clang::OMPLoopDirective const&) (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1b2cc2)
#13 0x7f4f5bad2295 (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1bb295)
#14 0x7f4f5baad851 (/opt/clang/lib64/libclangCodeGen.so.3.7+0x196851)
#15 0x7f4f5bac32cf clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(clang::CapturedStmt const&) (/opt/clang/lib64
/libclangCodeGen.so.3.7+0x1ac2cf)
#16 0x7f4f5baa2be8 clang::CodeGen::CGOpenMPRuntime::emitParallelOutlinedFunction(clang::OMPExecutableDirective const&, clang::
VarDecl const*, llvm::function_ref<void (clang::CodeGen::CodeGenFunction&)> const&) (/opt/clang/lib64/libclangCodeGen.so.3.7+0
x18bbe8)
#17 0x7f4f5bac7931 (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1b0931)
#18 0x7f4f5bacc243 clang::CodeGen::CodeGenFunction::EmitOMPParallelForDirective(clang::OMPParallelForDirective const&) (/opt/c
lang/lib64/libclangCodeGen.so.3.7+0x1b5243)
#19 0x7f4f5bab8b54 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1a
1b54)
#20 0x7f4f5bac02dc clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::Code
Gen::AggValueSlot) (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1a92dc)
#21 0x7f4f5bae4a2a clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctio
nInfo const&) (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1cda2a)
#22 0x7f4f5baf2733 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/cl
ang/lib64/libclangCodeGen.so.3.7+0x1db733)
#23 0x7f4f5baef5c3 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/clang/lib6
4/libclangCodeGen.so.3.7+0x1d85c3)
#24 0x7f4f5baf4169 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1d
d169)
#25 0x7f4f5bb57acf (/opt/clang/lib64/libclangCodeGen.so.3.7+0x240acf)
#26 0x7f4f5badf1e7 (/opt/clang/lib64/libclangCodeGen.so.3.7+0x1c81e7)
#27 0x7f4f5cce7343 clang::ParseAST(clang::Sema&, bool, bool) (/opt/clang/lib64/libclangParse.so.3.7+0x2b343)
#28 0x7f4f61bd82ce clang::FrontendAction::Execute() (/opt/clang/lib64/libclangFrontend.so.3.7+0xa22ce)
#29 0x7f4f61baa2cc clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/clang/lib64/libclangFrontend.so.3.7+0x742cc)
#30 0x7f4f619341ec clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/clang/lib64/libclangFrontendTool.so.3.7+0x31ec)
#31 0x40f5b1 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/clang/bin/clang-3.7+0x40f5b1)
#32 0x40e386 main (/opt/clang/bin/clang-3.7+0x40e386)
#33 0x7f4f610b68c5 __libc_start_main /usr/src/debug/glibc-2.21/csu/libc-start.c:323:0
#34 0x40b959 _start (/opt/clang/bin/clang-3.7+0x40b959)
Stack dump:
0. Program arguments: /opt/clang/bin/clang-3.7 -cc1 -triple x86_64-suse-linux -emit-obj -disable-free -main-file-name t.cpp -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer -dwarf-column-info -resource-dir /opt/clang/bin/../lib64/clang/3.7.0 -internal-isystem /opt/clang/bin/../include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /opt/clang/bin/../lib64/clang/3.7.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -fdeprecated-macro -fdebug-compilation-dir /home/ismail -ferror-limit 19 -fmessage-length 126 -fopenmp -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/t-c07ad4.o -x c++ t.cpp
clang-3.7: error: unable to execute command: Aborted
clang-3.7: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.7.0 (trunk 238128)
Target: x86_64-suse-linux
Thread model: posix
clang-3.7: 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-3.7: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.7: note: diagnostic msg: /tmp/t-cfa054.cpp
clang-3.7: note: diagnostic msg: /tmp/t-cfa054.sh
clang-3.7: note: diagnostic msg:
The text was updated successfully, but these errors were encountered: