Clang crashes while building Apple Swift code on ppc64le.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Clang crashes while building Apple Swift code on ppc64le.

Alex Denisov via cfe-dev
Hi,
 
I have been trying to build latest version of Apple Swift on ppc64le. The swift code has a native copy of Clang 5.0 as a submodule. I have filed a bug in LLVM bugzilla (https://bugs.llvm.org/show_bug.cgi?id=34913) as well.
 
While building Swift I get following crash dump in terminal from Clang:
 
#0 0x00000000114e1bd8 PrintStackTraceSignalHandler(void*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x114e1bd8)
#1 0x00000000114e1fe4 SignalHandler(int) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x114e1fe4)
#2 0x00003fff91e704d8  0x4d8 clang::CodeGen::swiftcall::SwiftAggLowering::shouldPassIndirectly(bool) const
#3 0x00003fff91e704d8
#4 0x00003fff91e704d8 classifyType(clang::CodeGen::CodeGenModule&, clang::CanQual<clang::Type>, bool) (+0x4d8)
#5 0x0000000000000000
#6 0x000000001198988c clang::CodeGen::swiftcall::computeABIInfo(clang::CodeGen::CodeGenModule&, clang::CodeGen::CGFunctionInfo&) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1198988c)
#7 0x0000000011989f18 clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>, bool, bool, llvm::ArrayRef<clang::CanQual<clang::Type> >, clang::FunctionType::ExtInfo, llvm::ArrayRef<clang::FunctionProtoType::ExtParameterInfo>, clang::CodeGen::RequiredArgs) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11989f18)
#8 0x000000001198a0d4 arrangeLLVMFunctionInfo(clang::CodeGen::CodeGenTypes&, bool, llvm::SmallVectorImpl<clang::CanQual<clang::Type> >&, clang::CanQual<clang::FunctionProtoType>, clang::FunctionDecl const*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1198a0d4)
#9 0x000000001185ca48 clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(clang::FunctionDecl const*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1185ca48)
#10 0x000000001185ce20 clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(clang::GlobalDecl) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1185ce20)
#11 0x000000001185e718 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1185e718)
#12 0x000000001185f60c clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1185f60c)
#13 0x000000001177ea58 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1177ea58)
#14 0x0000000011779094 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11779094)
#15 0x000000001177ce5c clang::CodeGen::CodeGenModule::EmitDeclContext(clang::DeclContext const*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1177ce5c)
#16 0x0000000011781910 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11781910)
#17 0x000000001178549c (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x1178549c)
#18 0x0000000011781f48 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11781f48)
#19 0x0000000011e4ff4c clang::ParseAST(clang::Sema&, bool, bool) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11e4ff4c)
#20 0x0000000011e4c68c clang::ASTFrontendAction::ExecuteAction() (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11e4c68c)
#21 0x0000000012449764 clang::CodeGenAction::ExecuteAction() (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x12449764)
#22 0x0000000011af6cd4 clang::FrontendAction::Execute() (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11af6cd4)
#23 0x0000000011e4b8d4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11e4b8d4)
#24 0x0000000011af6530 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11af6530)
#25 0x0000000011ab3ed0 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11ab3ed0)
#26 0x0000000011b9ad48 main (/root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0+0x11b9ad48)
#27 0x00000000103f8cbc generic_start_main /build/glibc-4qbSlT/glibc-2.23/csu/../csu/libc-start.c:291:0
#28 0x00000000103f75dc __libc_start_main /build/glibc-4qbSlT/glibc-2.23/csu/../sysdeps/unix/sysv/linux/powerpc/libc-start.c:116:0
Stack dump:
0.      Program arguments: /root/swift-source/build/buildbot/llvm-linux-powerpc64le/bin/clang-5.0 -cc1 -triple powerpc64le-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name ErrorObjectNative.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu ppc64le -mfloat-abi hard -target-abi elfv2 -momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -ffunction-sections -fdata-sections -coverage-notes-file /root/swift-source/build/buildbot/swift-linux-powerpc64le/stdlib/public/runtime/CMakeFiles/swiftRuntime-linux-powerpc64le.dir/ErrorObjectNative.cpp.gcno -resource-dir /root/swift-source/build/buildbot/llvm-linux-powerpc64le/lib/clang/5.0.0 -dependency-file stdlib/public/runtime/CMakeFiles/swiftRuntime-linux-powerpc64le.dir/ErrorObjectNative.cpp.o.d -MT stdlib/public/runtime/CMakeFiles/swiftRuntime-linux-powerpc64le.dir/ErrorObjectNative.cpp.o -isystem /usr/include/powerpc64le-linux-gnu -D CMARK_STATIC_DEFINE -D GTEST_HAS_RTTI=0 -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I stdlib/public/runtime -I /root/swift-source/swift/stdlib/public/runtime -I include -I /root/swift-source/swift/include -I /root/swift-source/llvm/include -I /root/swift-source/build/buildbot/llvm-linux-powerpc64le/include -I /root/swift-source/build/buildbot/llvm-linux-powerpc64le/tools/clang/include -I /root/swift-source/llvm/tools/clang/include -I /root/swift-source/cmark/src -I /root/swift-source/build/buildbot/cmark-linux-powerpc64le/src -D OBJC_OLD_DISPATCH_PROTOTYPES=0 -D LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1 -D NDEBUG -D __SWIFT_CURRENT_DYLIB=swiftCore -D swiftCore_EXPORTS -D NDEBUG -internal-isystem /usr/lib/gcc/powerpc64le-linux-gnu/5.4.0/../../../../include/c++/5.4.0 -internal-isystem /usr/lib/gcc/powerpc64le-linux-gnu/5.4.0/../../../../include/powerpc64le-linux-gnu/c++/5.4.0 -internal-isystem /usr/lib/gcc/powerpc64le-linux-gnu/5.4.0/../../../../include/powerpc64le-linux-gnu/c++/5.4.0 -internal-isystem /usr/lib/gcc/powerpc64le-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward -internal-isystem /usr/local/include -internal-isystem /root/swift-source/build/buildbot/llvm-linux-powerpc64le/lib/clang/5.0.0/include -internal-externc-isystem /usr/include/powerpc64le-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unknown-warning-option -Werror=unguarded-availability-new -Werror=date-time -Werror=unguarded-availability-new -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -Wglobal-constructors -Wexit-time-destructors -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /root/swift-source/build/buildbot/swift-linux-powerpc64le -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fvisibility-inlines-hidden -fno-rtti -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o stdlib/public/runtime/CMakeFiles/swiftRuntime-linux-powerpc64le.dir/ErrorObjectNative.cpp.o -x c++ /root/swift-source/swift/stdlib/public/runtime/ErrorObjectNative.cpp
1.      /root/swift-source/swift/stdlib/public/runtime/ErrorObjectNative.cpp:95:1: current parser token 'void'
2.      /root/swift-source/swift/stdlib/public/runtime/ErrorObjectNative.cpp:67:17 <Spelling=/root/swift-source/swift/include/swift/Runtime/../../../stdlib/public/SwiftShims/Visibility.h:107:37>: LLVM IR generation of declaration
3.      /root/swift-source/swift/stdlib/public/runtime/ErrorObjectNative.cpp:69:8: Generating code for declaration 'swift::swift_allocError'
clang-5.0: error: unable to execute command: Segmentation fault
clang-5.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 5.0.0 (https://github.com/apple/swift-clang.git 46db7f08078412299ec1dd7c58d8bf617403ca91) (https://github.com/apple/swift-llvm.git 7ec498b125e5fae4cab76bd0bc09e6930c369e2d)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /root/swift-source/build/buildbot/llvm-linux-powerpc64le/./bin
 
What could be the best approach for fixing this issue? In case any additional details are required, please let me know. The crash has created a .cpp and a .sh file, but the CPP file seems to be huge (~5mb), so I am unable to attach it anywhere (in the bugzilla as well as in mailing list).
 
Thanks and best regards,
Atul.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev