[英]Swift MultipeerConnectivity crash DateComponents unconditionallyBridgeFromObjectiveC
[英]Swift 5 Ubuntu 16.04 Crash with dateComponents
這是我的代碼:
import Foundation
if let utc = TimeZone(abbreviation: "UTC") {
let calendar = Calendar.current
print("\(calendar.description)")
print("Before dateComponents")
let componentsDate1 = calendar.dateComponents(in: utc, from: Date())
print("\(componentsDate1)")
}
else {
print("Could not create timezone")
}
我在Docker下運行Ubuntu 16.04。 結果是:
gregorian (current)
Before dateComponents
Segmentation fault
看來dateComponents調用正在崩潰。
建議?
更新 1)我剛剛在一個運行在Virtual box下的Ubuntu 16.04系統上復制了這個系統,安裝了Ubuntu 16.04的Swift 5.0.1版本: https : //swift.org/builds/swift-5.0.1-release/ubuntu1604/ SWIFT-5.0.1-RELEASE / SWIFT-5.0.1-RELEASE-ubuntu16.04.tar.gz
我剛剛被告知這確實是已知當前修復的已知錯誤: https : //forums.swift.org/t/possible-bug-in-datecomponents-method-running-on-ubuntu-16-04/25702
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.