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-9858] Swift 5.0 compiler crashes with error 'Bus error: 10' #52265

Closed
swift-ci opened this issue Feb 4, 2019 · 6 comments
Closed

[SR-9858] Swift 5.0 compiler crashes with error 'Bus error: 10' #52265

swift-ci opened this issue Feb 4, 2019 · 6 comments
Assignees
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

@swift-ci
Copy link
Collaborator

swift-ci commented Feb 4, 2019

Previous ID SR-9858
Radar rdar://problem/47787344
Original Reporter mosbah (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 5.0Regression, CompilerCrash
Assignee @aschwaighofer
Priority Medium

md5: 088d915c2a9466a05b5a77f02f864d05

Issue Description:

Using

swift --version
Apple Swift version 5.0 (swiftlang-1001.0.45.7 clang-1001.0.37.7)
Target: x86_64-apple-darwin18.2.0
ABI version: 0.6

Compiler crashes when compiling the attached project with the following error: (only in release build), randomly it fails with a different error:

error: Illegal instruction: 4
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target: Cache-iOS)    cd /Users/Cache    export DEVELOPER_DIR=/Applications/Xcode-10.2.app/Contents/Developer    export SDKROOT=/Applications/Xcode-10.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk    /Applications/Xcode-10.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name Cache -O -whole-module-optimization -enforce-exclusivity=checked -sdk /Applications/Xcode-10.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -target x86_64-apple-ios8.0-simulator -g -module-cache-path /Users/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -swift-version 5 -Xlinker -rpath -Xlinker /usr/lib/swift-0.6 -I /Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Products/Release-iphonesimulator -F /Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Products/Release-iphonesimulator -c -num-threads 4 /Users/Cache/Source/Shared/Storage/DiskStorage.swift /Users/Cache/Source/Shared/Library/ImageWrapper.swift /Users/Cache/Source/Shared/Storage/StorageObservationRegistry.swift /Users/Cache/Source/Shared/Library/Types.swift /Users/Cache/Source/Shared/Extensions/Date+Extensions.swift /Users/Cache/Source/Shared/Library/DataSerializer.swift /Users/Cache/Source/Shared/Storage/StorageAware.swift /Users/Cache/Source/Shared/Library/TypeWrapper.swift /Users/Cache/Source/Shared/Library/JSONDictionaryWrapper.swift /Users/Cache/Source/Shared/Library/MD5.swift /Users/Cache/Source/Shared/Storage/MemoryStorage.swift /Users/Cache/Source/Shared/Library/Optional+Extension.swift /Users/Cache/Source/Shared/Configuration/DiskConfig.swift /Users/Cache/Source/Shared/Library/Transformer.swift /Users/Cache/Source/Shared/Library/Result.swift /Users/Cache/Source/Shared/Library/TransformerFactory.swift /Users/Cache/Source/Shared/Library/JSONArrayWrapper.swift /Users/Cache/Source/Shared/Storage/SyncStorage.swift /Users/Cache/Source/Shared/Library/Expiry.swift /Users/Cache/Source/Shared/Storage/Storage+Transform.swift /Users/Cache/Source/Shared/Library/StorageError.swift /Users/Cache/Source/Shared/Library/ObservationToken.swift /Users/Cache/Source/iOS/UIImage+Extensions.swift /Users/Cache/Source/Shared/Storage/HybridStorage.swift /Users/Cache/Source/Shared/Storage/AsyncStorage.swift /Users/Cache/Source/Shared/Extensions/JSONDecoder+Extensions.swift /Users/Cache/Source/Shared/Storage/KeyObservationRegistry.swift /Users/Cache/Source/Shared/Storage/Storage.swift /Users/Cache/Source/Shared/Library/MemoryCapsule.swift /Users/Cache/Source/Shared/Configuration/MemoryConfig.swift /Users/Cache/Source/Shared/Library/ExpirationMode.swift /Users/Cache/Source/Shared/Library/Entry.swift -output-file-map /Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/Objects-normal/x86_64/Cache-iOS-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/Objects-normal/x86_64/Cache.swiftmodule -Xcc -I/Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/Cache-generated-files.hmap -Xcc -I/Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/Cache-own-target-headers.hmap -Xcc -I/Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/Cache-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/Cache-project-headers.hmap -Xcc -I/Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Products/Release-iphonesimulator/include -Xcc -I/Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/DerivedSources-normal/x86_64 -Xcc -I/Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/DerivedSources/x86_64 -Xcc -I/Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/DerivedSources -emit-objc-header -emit-objc-header-path /Users/Library/Developer/Xcode/DerivedData/Cache-cjqvxvklvcwjiyefzrbaoceyjnfv/Build/Intermediates.noindex/Cache.build/Release-iphonesimulator/Cache-iOS.build/Objects-normal/x86_64/Cache-Swift.h -working-directory /Users/Cache

<unknown>:0: error: unable to execute command: Bus error: 10

<unknown>:0: error: compile command failed due to signal 10 (use -v to see invocation)

Context: after updating Cache to Swift 5.0 with this PR

@swift-ci
Copy link
Collaborator Author

swift-ci commented Feb 6, 2019

Comment by Mohamed Tahar Mosbah (JIRA)

@belkadan I'm interested on working to fix this bug, I see that you marked it as a regression, are you referring to SR-7694 ? because the sample code there works fine for me.

Also is there any resources that explains how to get more information from the compiler ? swiftc -v and xcodebuild -verbose dosen't offer much.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Feb 6, 2019

Comment by Mohamed Tahar Mosbah (JIRA)

One more thing, changing Compilation mode from Whole Module to Incremental seems to "fix" the issue.

@belkadan
Copy link
Contributor

belkadan commented Feb 6, 2019

I assumed it was a regression because you talked about "after updating to Swift 5". Does it crash in Swift 4.2 as well?

@swift-ci
Copy link
Collaborator Author

swift-ci commented Feb 6, 2019

Comment by Mohamed Tahar Mosbah (JIRA)

I see, no it does not crash on Swift 4.2 so indeed it's a regression.

@aschwaighofer
Copy link
Member

Fixed by #23102

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Aug 9, 2019

mosbah (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"?

Thanks!
Anna

@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
This issue was closed.
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

4 participants