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-2707] Swift 3.0 Release Run time Crash With Date/NSDate function #4512

Closed
swift-ci opened this issue Sep 20, 2016 · 1 comment
Closed

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-2707
Radar vapor/vapor#615
Original Reporter Linicks (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Ubuntu 16.04(x64), and Swift 3.0 Release

Additional Detail from JIRA
Votes 3
Component/s Foundation
Labels Bug, Linux, RunTimeCrash
Assignee None
Priority Medium

md5: c48182972ecdfad62f62d8f31242a9ac

relates to:

  • SR-2462 Compiler is sometimes overreleasing CF objects

Issue Description:

All,
I'm experiencing a run time crash when trying to use Date, and NSDate. The bug was discovered while playing with the Kitura, and Vapor frameworks. Here is the original issue posted to the Vapor Projects GitHub for additional details:

vapor/vapor#615


All,
While playing with the Hello tutorial, I added a couple of routs. The first returns the "Hello World" string, and the second returns a current time stamp. When executing the route that calls NSDate(), it works as expected the fist time, then crashes the server. Here is the code:

import Vapor
import Foundation

let drop = Droplet()

drop.get("hello") { request in
return "Hello, world!"
}

drop.get("thedate") { request in
var the_date = NSDate()
return "The Date is: (the_date)"
}

drop.get { req in
let lang = req.headers["Accept-Language"]?.string ?? "en"
return try drop.view.make("welcome", [
"message": Node.string(drop.localization[lang, "welcome", "title"])
])
}

drop.resource("posts", PostController())

drop.run()
I'm developing on Ubuntu 16.04, and Swift 3.0 release.

Thanks!
--Nick

@spevans
Copy link
Collaborator

spevans commented Jan 16, 2020

This was fixed in Swift 3.1 and was probably related to https://bugs.swift.org/browse/SR-2462

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants