swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.57k stars 10.36k forks source link

[SR-14867] docc2html crashes swiftc on Linux #57214

Open swift-ci opened 3 years ago

swift-ci commented 3 years ago
Previous ID SR-14867
Radar rdar://problem/80236093
Original Reporter helge (JIRA User)
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 0c9942438dafa80529a13ca4d1d2e687

Issue Description:

Tried 5.3.2, 5.4.2, same issue. Works on macOS.

Run swift build -c debug
  swift build -c debug
  shell: sh -e {0}
Fetching https://github.com/apple/swift-log.git
Fetching https://github.com/DoccZz/DocCArchive.git
Fetching https://github.com/AlwaysRightInstitute/mustache.git
Cloning https://github.com/apple/swift-log.git
Resolving https://github.com/apple/swift-log.git at 1.4.2
Cloning https://github.com/DoccZz/DocCArchive.git
Resolving https://github.com/DoccZz/DocCArchive.git at 0.2.0
Cloning https://github.com/AlwaysRightInstitute/mustache.git
Resolving https://github.com/AlwaysRightInstitute/mustache.git at 1.0.1
[1/15] Compiling mustache HTMLEscape.swift
[2/15] Compiling Logging LogHandler.swift
[3/15] Compiling Logging Logging.swift
...
[38/41] Compiling DocCArchive ImageReference.swift
[39/42] Merging module DocCArchive
[40/60] Wrapping AST for DocCArchive for debugging
swift-frontend: /home/buildnode/jenkins/workspace/oss-swift-5.4-package-linux-ubuntu-16_04/swift/lib/SIL/IR/TypeLowering.cpp:2756: auto swift::Lowering::TypeConverter::getLoweredLocalCaptures(swift::SILDeclRef)::(anonymous class)::operator()(swift::CaptureInfo, swift::DeclContext *) const: Assertion `captureInfo.hasBeenComputed()' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.  Program arguments: /usr/bin/swift-frontend -frontend -c -primary-file /__w/docc2html/docc2html/Sources/docc2html/BuildDocument.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/BuildFolder.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/BuildNavigation.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/ExitCode.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/HTML/ContentHTML.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/HTML/FragmentHTML.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/HTML/InlineContentHTML.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/HTML/ReferenceHTML.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/HTML/SectionHTML.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/Options.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/RenderingContext.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/Templates/CodeListing.swift -primary-file /__w/docc2html/docc2html/Sources/docc2html/Templates/DeclarationSection.swift /__w/docc2html/docc2html/Sources/docc2html/Templates/DocumentContent.swift /__w/docc2html/docc2html/Sources/docc2html/Templates/Navigation.swift /__w/docc2html/docc2html/Sources/docc2html/Templates/Page.swift /__w/docc2html/docc2html/Sources/docc2html/Templates/ParametersSection.swift /__w/docc2html/docc2html/Sources/docc2html/Templates/PrimaryContent.swift /__w/docc2html/docc2html/Sources/docc2html/Templates/Sections.swift /__w/docc2html/docc2html/Sources/docc2html/Templates/Stylesheet.swift /__w/docc2html/docc2html/Sources/docc2html/Templates/TopicTitle.swift /__w/docc2html/docc2html/Sources/docc2html/Utilities/Console.swift /__w/docc2html/docc2html/Sources/docc2html/Utilities/CopyCSS.swift /__w/docc2html/docc2html/Sources/docc2html/Utilities/CopyRaw.swift /__w/docc2html/docc2html/Sources/docc2html/Utilities/HTMLEscape.swift /__w/docc2html/docc2html/Sources/docc2html/main.swift -supplementary-output-file-map /tmp/supplementaryOutputs-038682 -target x86_64-unknown-linux-gnu -disable-objc-interop -I /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug -enable-testing -g -module-cache-path /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -enable-anonymous-context-mangled-names -module-name docc2html -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/BuildDocument.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/BuildFolder.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/BuildNavigation.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/ExitCode.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/HTML/ContentHTML.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/HTML/FragmentHTML.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/HTML/InlineContentHTML.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/HTML/ReferenceHTML.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/HTML/SectionHTML.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/Options.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/RenderingContext.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/Templates/CodeListing.swift.o -o /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/docc2html.build/Templates/DeclarationSection.swift.o -index-store-path /__w/docc2html/docc2html/.build/x86_64-unknown-linux-gnu/debug/index/store -index-system-modules 
1.  Swift version 5.4.2 (swift-5.4.2-RELEASE)
2.  While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/__w/docc2html/docc2html/Sources/docc2html/BuildFolder.swift")
3.  While silgen emitFunction SIL function "@$s9docc2html11buildFolder_4intoy11DocCArchiveADV08DocumentC0V_10Foundation3URLVtF".
 for 'buildFolder(_:into:)' (at /__w/docc2html/docc2html/Sources/docc2html/BuildFolder.swift:12:1)
4.  While getting lowered local captures at 'ensureTargetDir(_:)' (at /__w/docc2html/docc2html/Sources/docc2html/main.swift:49:1)
/usr/bin/swift-frontend[0x5697684]
....
Error: Process completed with exit code 1.

Full details: https://github.com/DoccZz/docc2html/runs/2973560583?check_suite_focus=true

typesanitizer commented 3 years ago

@swift-ci create

swift-ci commented 3 years ago

Comment by Helge Heß (JIRA)

The issue doesn't happen anymore since I separated out things into a Swift library target (out of the tool).
It still breaks in 0.2.0 (which can be retrieved using that tag).