swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.67k stars 1.32k forks source link

[SR-10059] Issues with “HoverResponse” during “Installing swiftpm” while building Apple Swift 5 toolchain on PowerPC64LE #4875

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-10059
Radar None
Original Reporter stamba (JIRA User)
Type Bug

Attachment: Download

Environment PowerPC64LE
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler, Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 2f99689a0725123e4fba11675ff00c41

Issue Description:

While building Apple Swift 5 toolchain on PowerPC64LE, found that the execution fails at following step during final "Installing swiftpm" stage:-

/home/sar/swift-source/swift-nightly-install/usr/bin/swiftc -module-name LanguageServerProtocol -incremental -emit-dependencies -emit-module -emit-module-path /home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le/powerpc64le-unknown-linux/release/LanguageServerProtocol.swiftmodule -output-file-map /home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le/powerpc64le-unknown-linux/release/LanguageServerProtocol.build/output-file-map.json -parse-as-library -whole-module-optimization -num-threads 8 -c /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/CancelRequest.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/ClientCapabilities.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/CodeActionKind.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Completion.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/CompletionItem.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/CompletionItemKind.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Configuration.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Connection.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/DefinitionRequest.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Diagnostic.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/DocumentHighlight.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Error.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/FoldingRange.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/FoldingRangeKind.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Formatting.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Hover.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/InitializationOptions.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/InitializeRequest.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Language.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/LanguageServer.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Location.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/LogMessage.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/MarkupContent.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Message.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/MessageRegistry.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Messages.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Position.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/PositionRange.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/PublishDiagnostics.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/ReferencesRequest.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Request.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/RequestID.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/ServerCapabilities.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/ShowMessageRequest.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/Shutdown.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/SymbolInfo.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/SymbolKind.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/TextDocumentContentChangeEvent.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/TextDocumentEdit.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/TextDocumentIdentifier.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/TextDocumentItem.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/TextDocumentSaveReason.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/TextEdit.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/TextSynchronization.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/VersionedTextDocumentIdentifier.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/WindowMessageType.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/WorkspaceFolder.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/WorkspaceFolders.swift /home/sar/swift-source/sourcekit-lsp/Sources/LanguageServerProtocol/WorkspaceSettings.swift -I /home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le/powerpc64le-unknown-linux/release -target powerpc64le-unknown-linux -swift-version 4.2 -sdk / -O -j8 -DSWIFT_PACKAGE -Xcc -fmodule-map-file=/home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le/checkouts/swift-package-manager/Sources/clibc/include/module.modulemap -I /home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le/checkouts/swift-package-manager/Sources/clibc/include -module-cache-path /home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le/powerpc64le-unknown-linux/release/ModuleCache -enable-testing

Following is a part of the stack dump:-

swift: /home/sar/swift-source/llvm/lib/Target/PowerPC/PPCISelLowering.cpp:12111: llvm::SDValue combineBVOfConsecutiveLoads(llvm::SDNode *, llvm::SelectionDAG &): Assertion `!(InputsAreConsecutiveLoads && InputsAreReverseConsecutive) && "The loads cannot be both consecutive and reverse consecutive."' failed. Stack dump: 0. Running pass 'Function Pass Manager' on module '/home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le/powerpc64le-unknown-linux/release/LanguageServerProtocol.build/CancelRequest.swift.o'. 1. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@"$s22LanguageServerProtocol13HoverResponseV8contents5rangeAcA13MarkupContentV_SnyAA8PositionVGSgtcfC"' #​0 0x00000000150ab2e8 PrintStackTraceSignalHandler(void*) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x150ab2e8) #​1 0x00000000150a8588 llvm::sys::RunSignalHandlers() (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x150a8588) #​2 0x00000000150ab9a8 SignalHandler(int) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x150ab9a8) #​3 0x00003fff8e8e04d8 0x4d8 gsignal #​4 0x00003fff8e8e04d8 #​5 0x00003fff8e8e04d8 abort (+0x4d8) #​6 0x00003fff8e25ec90 (/lib/powerpc64le-linux-gnu/libc.so.6+0x3ec90) #​7 0x00003fff8e2611f4 __assert_fail (/lib/powerpc64le-linux-gnu/libc.so.6+0x411f4) #​8 0x00003fff8e2541c0 llvm::PPCTargetLowering::DAGCombineBuildVector(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/lib/powerpc64le-linux-gnu/libc.so.6+0x341c0) #​9 0x00003fff8e2542b4 llvm::PPCTargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/lib/powerpc64le-linux-gnu/libc.so.6+0x342b4) #​10 0x0000000011c5ea68 (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x11c5ea68) #​11 0x0000000011c606d8 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOpt::Level) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x11c606d8) #​12 0x0000000011f5d178 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x11f5d178) #​13 0x0000000011f5b9b0 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, bool&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x11f5b9b0) #​14 0x00000000120e487c llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x120e487c) #​15 0x00000000120e4058 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x120e4058) #​16 0x00000000120e27f4 (anonymous namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x120e27f4) #​17 0x00000000120de4dc llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x120de4dc) #​18 0x0000000011bf66e4 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x11bf66e4) #​19 0x0000000012aefdb4 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x12aefdb4) #​20 0x0000000014eb7740 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x14eb7740) #​21 0x0000000014eb7b84 llvm::legacy::PassManager::run(llvm::Module&) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x14eb7b84) #​22 0x0000000014eb8264 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex, llvm::GlobalVariable, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x14eb8264) #​23 0x0000000014eb8b04 ThreadEntryPoint(swift::irgen::IRGenerator*, llvm::sys::SmartMutex, int) (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x14eb8b04) #​24 0x00000000101cc93c std::thread::_Impl<std::_Bind_simple<void ( (swift::irgen::IRGenerator*, llvm::sys::SmartMutex, int))(swift::irgen::IRGenerator, llvm::sys::SmartMutex*, int)> >::_M_run() (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x101cc93c) #​25 0x00000000101d2360 (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x101d2360) #​26 0x00000000101d3f8c start_thread (/home/sar/swift-source/swift-nightly-install/usr/bin/swift+0x101d3f8c) #​27 0x00003fff8e504974 clone (/usr/lib/powerpc64le-linux-gnu/libstdc++.so.6+0xe4974) .... :0: error: unable to execute command: Aborted :0: error: compile command failed due to signal 6 (use -v to see invocation) /home/sar/swift-source/swift-nightly-install/usr/bin/swift build --package-path /home/sar/swift-source/sourcekit-lsp --build-path /home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le --configuration release --verbose -Xswiftc -enable-testing -Xcxx -I -Xcxx /home/sar/swift-source/swift-nightly-install/usr/lib/swift Traceback (most recent call last): File "/home/sar/swift-source/sourcekit-lsp/Utilities/build-script-helper.py", line 80, in main() File "/home/sar/swift-source/sourcekit-lsp/Utilities/build-script-helper.py", line 70, in main swiftpm('build', swift_exec, swiftpm_args) File "/home/sar/swift-source/sourcekit-lsp/Utilities/build-script-helper.py", line 14, in swiftpm subprocess.check_call(cmd, env=env) File "/usr/lib/python2.7/subprocess.py", line 541, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/sar/swift-source/swift-nightly-install/usr/bin/swift', 'build', '--package-path', '/home/sar/swift-source/sourcekit-lsp', '--build-path', '/home/sar/swift-source/build/buildbot_linux/sourcekitlsp-linux-powerpc64le', '-configuration', 'release', '-verbose', '-Xswiftc', '-enable-testing', '-Xcxx', '-I', '-Xcxx', '/home/sar/swift-source/swift-nightly-install/usr/lib/swift']' returned non-zero exit status 1 Building the standard library for: swift-stdlib-linux-powerpc64le Running Swift tests for: check-swift-all-linux-powerpc64le check-swift-all-optimize-linux-powerpc64le ./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting ./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

Analyzing "s22LanguageServerProtocol13HoverResponseV8contents5rangeAcA13MarkupContentV_SnyAA8PositionVGSgtcfC", this probably fails at following call in "sourcekit-lsp/Sources/SourceKit/sourcekitd/SwiftLanguageServer.swift" line 455 (this is the only reference I could find to "HoverResponse" in the entire source, besides "Hover.swift" file):-

  req.reply(HoverResponse(contents: MarkupContent(kind: .markdown, value: result), range: nil))
     I am not able to figure out the exact issue, since I am not well versed with Swift programming language.

Any inputs/suggestions/pointers would greatly help.Thanks!

benlangmuir commented 5 years ago

Removed lsp tag, since this isn't a bug in sourcekit-lsp, but a compiler bug exposed in our code.

swift-ci commented 5 years ago

Comment by Sarvesh Tamba (JIRA)

Hi @benlangmuir any fixes/solution planned for the compiler bug exposed in the code?

swift-ci commented 5 years ago

Comment by Sarvesh Tamba (JIRA)

Similar issues are also seen in TextDocumentContentChangeEvent.swift

benlangmuir commented 5 years ago

@jckarter does this crash look like an IRGen issue, or maybe an llvm bug? Any suggestions?

jckarter commented 5 years ago

Looks like an LLVM bug to me.

swift-ci commented 5 years ago

Comment by Sarvesh Tamba (JIRA)

@jckarter any suggestions/inputs on what could be the likely LLVM issue?

swift-ci commented 5 years ago

Comment by Sarvesh Tamba (JIRA)

Filed bug at :- https://bugs.llvm.org/show_bug.cgi?id=41177

swift-ci commented 5 years ago

Comment by Sarvesh Tamba (JIRA)

Hi @jckarter, @benlangmuir,

I have already raised this on llvm bugtracker:-
https://bugs.llvm.org/show_bug.cgi?id=41177

I got the response from community members - "This is a swift-related issue, report on their bugtrack."

Please suggest. Would appreciate a prompt response.

swift-ci commented 5 years ago

Comment by Sarvesh Tamba (JIRA)

Can some one please have a look and comment on this? This is blocking building Apple Swift 5 toolchain on PPC64LE.