Skip to content
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

tapir crash when compiling without -fcilkplus #86

Open
wheatman opened this issue Mar 8, 2019 · 2 comments
Open

tapir crash when compiling without -fcilkplus #86

wheatman opened this issue Mar 8, 2019 · 2 comments

Comments

@wheatman
Copy link

wheatman commented Mar 8, 2019

When I compile the code found in https://github.com/wheatman/extended-csr/tree/tapir_crash
with ./setup.sh clang++ test2.cpp I get a compiler crash instead of just gracefully failing with a message that I have cilk_api calls without cilk

My version is
clang version 6.0.0 (https://github.com/wsmoses/Tapir-Clang.git 190c083a326a7bee7dcf773d3ddd3e2e9240b719) (https://github.com/wsmoses/Tapir-LLVM.git 065b7e7
1c6f144919cb77221)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /efs/tools/tapir-6/build/bin

In file included from test2.cpp:18:
In file included from ./OFM.cpp:2:
In file included from ./helpers.h:4:
/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h:59:9: warning: Cilk API is being used with non-Cilk compiler (or Cilk is disabled) [-W#warnings]

warning Cilk API is being used with non-Cilk compiler (or Cilk is disabled)

    ^

#0 0x000000000152cbda llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x152cbda)
#1 0x000000000152ae2e llvm::sys::RunSignalHandlers() (/efs/tools/tapir-6/build/bin/clang-6.0+0x152ae2e)
#2 0x000000000152af6a SignalHandler(int) (/efs/tools/tapir-6/build/bin/clang-6.0+0x152af6a)
#3 0x00007fa64b5a1330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fa64a588d1c cfree /build/eglibc-oGUzwX/eglibc-2.19/malloc/malloc.c:2929:0
#5 0x0000000001d678a8 llvm::SelectionDAGBuilder::visitInvoke(llvm::InvokeInst const&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x1d678a8)
#6 0x0000000001d6dcbc llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x1d6dcbc)
#7 0x0000000001da2614 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void>, false, true>, bool&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x1da2614)
#8 0x0000000001da9c66 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x1da9c66)
#9 0x0000000001dac2ab llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone .part.964] (/efs/tools/tapir-6/build/bin/clang-6.0+0x1dac2ab)
#10 0x0000000000ae1d84 (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/efs/tools/tapir-6/build/bin/clang-6.0+0xae1d84)
#11 0x0000000000e6b127 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/efs/tools/tapir-6/build/bin/clang-6.0+0xe6b127)
#12 0x00000000011417da llvm::FPPassManager::runOnFunction(llvm::Function&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x11417da)
#13 0x0000000001141873 llvm::FPPassManager::runOnModule(llvm::Module&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x1141873)
#14 0x00000000011421c0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x11421c0)
#15 0x00000000016c9961 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_deletellvm::raw_pwrite_stream >) (/efs/tools/tapir-6/build/bin/clang-6.0+0x16c9961)
#16 0x00000000016cb597 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_deletellvm::raw_pwrite_stream >) (/efs/tools/tapir-6/build/bin/clang-6.0+0x16cb597)
#17 0x0000000001e587ab clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x1e587ab)
#18 0x0000000002025542 clang::ParseAST(clang::Sema&, bool, bool) (/efs/tools/tapir-6/build/bin/clang-6.0+0x2025542)
#19 0x0000000001e58014 clang::CodeGenAction::ExecuteAction() (/efs/tools/tapir-6/build/bin/clang-6.0+0x1e58014)
#20 0x0000000001a5fbfe clang::FrontendAction::Execute() (/efs/tools/tapir-6/build/bin/clang-6.0+0x1a5fbfe)
#21 0x0000000001a37d6d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/efs/tools/tapir-6/build/bin/clang-6.0+0x1a37d6d)
#22 0x0000000001aeb2c4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/efs/tools/tapir-6/build/bin/clang-6.0+0x1aeb2c4)
#23 0x0000000000a75c98 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/efs/tools/tapir-6/build/bin/clang-6.0+0xa75c98)
#24 0x0000000000a12401 main (/efs/tools/tapir-6/build/bin/clang-6.0+0xa12401)
#25 0x00007fa64a527f45 __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#26 0x0000000000a71357 _start (/efs/tools/tapir-6/build/bin/clang-6.0+0xa71357)
Stack dump:
0. Program arguments: /efs/tools/tapir-6/build/bin/clang-6.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test2.cpp -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 -resource-dir /efs/tools/tapir-6/build/lib/clang/6.0.0 -c-isystem /efs/tools/tapir-6/build/lib/clang/5.0.0/include/ -cxx-isystem /efs/tools/tapir-6/build/lib/clang/5.0.0/include/ -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/backward -internal-isystem /usr/local/include -internal-isystem /efs/tools/tapir-6/build/lib/clang/6.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /efs/home/wheatman/extended-csr -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o /tmp/test2-dbef85.o -x c++ test2.cpp

  1. parser at end of file
  2. Code generation
  3. Running pass 'Function Pass Manager' on module 'test2.cpp'.
  4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN3OFM17release_all_locksEjb7reasons'
    clang-6.0: error: unable to execute command: Segmentation fault (core dumped)
    clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)
    clang version 6.0.0 (https://github.com/wsmoses/Tapir-Clang.git 190c083a326a7bee7dcf773d3ddd3e2e9240b719) (https://github.com/wsmoses/Tapir-LLVM.git 065b7e7)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /efs/tools/tapir-6/build/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/test2-f186e0.cpp
clang-6.0: note: diagnostic msg: /tmp/test2-f186e0.sh
clang-6.0: note: diagnostic msg:


@neboat
Copy link
Collaborator

neboat commented Mar 10, 2019

I'm not able to replicate this compiler crash on the latest commit on the Tapir branch you're using. Consider updating your branches and seeing if the error persists.

@neboat
Copy link
Collaborator

neboat commented Mar 10, 2019

Nevermind, I replicated the error once I resolved a different problem with a missing header file. I've figured out the issue, and I'll work on a fix tomorrow.

neboat added a commit that referenced this issue Mar 10, 2019
…structions, in case no Tapir lowering is invoked.

This pass addresses issue #86.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants