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

Compiler crash on Xcode 8.3 #101

Closed
ukreator opened this issue Apr 28, 2017 · 5 comments
Closed

Compiler crash on Xcode 8.3 #101

ukreator opened this issue Apr 28, 2017 · 5 comments

Comments

@ukreator
Copy link

Crashes on any use of boost::sml in optimisation modes -O1 or -O0 for arm64 architecture. I'm aware that it's the problem of clang developers (I reported a bug vs Xcode), but maybe someone has some ideas how to workaround this. Currently it makes iOS development harder.

How to reproduce:
use any sml example and build it on mac with following flags:

clang++ -std=c++14 test.cpp -o test -O0 -g -I. -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk
@krzysztof-jusiak
Copy link
Collaborator

krzysztof-jusiak commented Apr 28, 2017

Thanks, @ukreator for reporting that. Would you be able to provide a link to the issue, please? I don't own a mac so if you could please provide a call stack I will try to figure it out. In the meantime, I'll add Xcode-8.3 on travis too.

@ukreator
Copy link
Author

Apple's bug tracker is not open as far as I understand. I managed to reproduce with Android NDK r15-beta under Linux. Also happens only for arm64 builds:

dmitry@dmitry8:~$ ./android-ndk-r15-beta1/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -c example.cpp -std=c++14 -o example.o -target arm64-v8a
clang++: error: unable to execute command: Segmentation fault (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
Android clang version 3.8.275480  (based on LLVM 3.8.275480)
Target: arm64-v8a
Thread model: posix
InstalledDir: /home/dmitry/./android-ndk-r15-beta1/toolchains/llvm/prebuilt/linux-x86_64/bin
clang++: 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++: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/example-72dc2f.cpp
clang++: note: diagnostic msg: /tmp/example-72dc2f.sh
clang++: note: diagnostic msg:

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

This time I haven't submitted the bug to LLVM yet

@ukreator
Copy link
Author

stack trace (not likely to help, but anyway):

0   clang                         	0x000000010f1de1c0 getCopyFromParts(llvm::SelectionDAG&, llvm::SDLoc const&, llvm::SDValue const*, unsigned int, llvm::MVT, llvm::EVT, llvm::Value const*, llvm::Optional<llvm::ISD::NodeType>) + 96
1   clang                         	0x000000010f1ddd1f llvm::RegsForValue::getCopyFromRegs(llvm::SelectionDAG&, llvm::FunctionLoweringInfo&, llvm::SDLoc const&, llvm::SDValue&, llvm::SDValue*, llvm::Value const*) const + 1871
2   clang                         	0x000000010f0f5ece llvm::SelectionDAGBuilder::getValueImpl(llvm::Value const*) + 1518
3   clang                         	0x000000010f0f5316 llvm::SelectionDAGBuilder::getValue(llvm::Value const*) + 150
4   clang                         	0x000000010f1ece55 llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite, llvm::SDValue, bool, llvm::BasicBlock const*) + 373
5   clang                         	0x000000010f1e9f07 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 599
6   clang                         	0x000000010f0f394a llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 58
7   clang                         	0x000000010f07e1a0 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 8640
8   clang                         	0x000000010f075afb llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 987
9   clang                         	0x000000010f0753f0 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 112
10  clang                         	0x000000010f04004e llvm::FPPassManager::runOnFunction(llvm::Function&) + 574
11  clang                         	0x000000010f05ec73 llvm::FPPassManager::runOnModule(llvm::Module&) + 51
12  clang                         	0x000000010f044709 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 489
13  clang                         	0x000000010f01999d clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) + 5261
14  clang                         	0x000000010eff19b9 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 393
15  clang                         	0x000000010ed8d279 clang::ParseAST(clang::Sema&, bool, bool) + 265
16  clang                         	0x000000010ed8a845 clang::FrontendAction::Execute() + 37
17  clang                         	0x000000010ed4e844 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 292
18  clang                         	0x000000010ed4c913 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3107
19  clang                         	0x000000010ed1b196 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 3510
20  clang                         	0x000000010ed16c5b main + 9051
21  libdyld.dylib                 	0x00007fffc99a5235 start + 1

@ukreator
Copy link
Author

reference to android NDK issue: android/ndk#386

@ukreator
Copy link
Author

fixed in XCode 9 and clang 5 (neither of them released yet)

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