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

[SR-10206] Linux Swift 5 compiler crash #52606

Open
keith opened this issue Mar 27, 2019 · 3 comments
Open

[SR-10206] Linux Swift 5 compiler crash #52606

keith opened this issue Mar 27, 2019 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 5.0

Comments

@keith
Copy link
Collaborator

keith commented Mar 27, 2019

Previous ID SR-10206
Radar rdar://problem/49380933
Original Reporter @keith
Type Bug
Environment

Ubuntu 18.04

Swift version 5.0 (swift-5.0-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, 5.0Regression, CompilerCrash
Assignee None
Priority Medium

md5: ccca405c547b834e4db17bd67e989462

Issue Description:

When running tests for PathKit at this commit kylef/PathKit@4151a7e on Linux, the compiler crashes with this error:

# swift test
swift: /home/buildnode/jenkins/workspace/oss-swift-5.0-package-linux-ubuntu-18_04/swift/include/swift/SIL/TypeLowering.h:765: swift::SILType swift::Lowering::TypeConverter::getLoweredLoadableType(swift::Type): Assertion `(ti.isLoadable() || !SILModuleConventions(M).useLoweredAddresses()) && "unexpected address-only type"' failed.
Stack dump:
0.      Program arguments: /usr/local/bin/swift -frontend -c -primary-file /code/containers/swiftbase/PathKit/Tests/PathKitTests/PathKitSpec.swift /code/containers/swiftbase/PathKit/Tests/PathKitTests/XCTest.swift -emit-module-path /code/containers/swiftbase/PathKit/.build/x86_64-unknown-linux/debug/PathKitTests.build/PathKitSpec~partial.swiftmodule -emit-module-doc-path /code/containers/swiftbase/PathKit/.build/x86_64-unknown-linux/debug/PathKitTests.build/PathKitSpec~partial.swiftdoc -emit-dependencies-path /code/containers/swiftbase/PathKit/.build/x86_64-unknown-linux/debug/PathKitTests.build/PathKitSpec.d -emit-reference-dependencies-path /code/containers/swiftbase/PathKit/.build/x86_64-unknown-linux/debug/PathKitTests.build/PathKitSpec.swiftdeps -target x86_64-unknown-linux -disable-objc-interop -sdk / -I /code/containers/swiftbase/PathKit/.build/x86_64-unknown-linux/debug -enable-testing -g -module-cache-path /code/containers/swiftbase/PathKit/.build/x86_64-unknown-linux/debug/ModuleCache -swift-version 4.2 -Onone -D SWIFT_PACKAGE -D DEBUG -color-diagnostics -enable-anonymous-context-mangled-names -parse-as-library -module-name PathKitTests -o /code/containers/swiftbase/PathKit/.build/x86_64-unknown-linux/debug/PathKitTests.build/PathKitSpec.swift.o -index-store-path /code/containers/swiftbase/PathKit/.build/x86_64-unknown-linux/debug/index/store -index-system-modules
1.      While emitting SIL for 'testPathKit()' (at /code/containers/swiftbase/PathKit/Tests/PathKitTests/PathKitSpec.swift:10:8)
2.      While silgen emitFunction SIL function "@$s12PathKitTests04testaB0yyF".
 for 'testPathKit()' (at /code/containers/swiftbase/PathKit/Tests/PathKitTests/PathKitSpec.swift:10:8)
3.      While silgen closureexpr SIL function "@$s12PathKitTests04testaB0yyFy7Spectre11ContextType_pXEfU_".
 for expression at [/code/containers/swiftbase/PathKit/Tests/PathKitTests/PathKitSpec.swift:11:21 - line:512:1] RangeText="{
  let fixtures = Path(#file).parent() + "Fixtures"
@keith
Copy link
Collaborator Author

keith commented Mar 27, 2019

A found a diff that works around the issue:

diff --git a/Tests/PathKitTests/PathKitSpec.swift b/Tests/PathKitTests/PathKitSpec.swift
index ad63e9d..e683d99 100644
--- a/Tests/PathKitTests/PathKitSpec.swift
+++ b/Tests/PathKitTests/PathKitSpec.swift
@@ -9,10 +9,11 @@ func == (lhs:ThrowError, rhs:ThrowError) -> Bool { return true }

 public func testPathKit() {
 describe("PathKit") {
-  let fixtures = Path(#file).parent() + "Fixtures"
+  let filePath = #file
+  let fixtures = Path(filePath).parent() + "Fixtures"

   $0.before {
-    Path.current = Path(#file).parent()
+    Path.current = Path(filePath).parent()
   }

   $0.it("provides the system separator") {

@belkadan
Copy link
Contributor

Just to check, this same commit builds fine with Swift 4.2?

@keith
Copy link
Collaborator Author

keith commented Mar 27, 2019

Yes it does with `Swift version 4.2.1 (swift-4.2.1-RELEASE)`

Also note this fails with tools-version 4.2 and 5.0 with the 5.0 release

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 5.0
Projects
None yet
Development

No branches or pull requests

3 participants